define-word
define-word copied to clipboard
Error in define-word--parse-wordnik
Seems like the \
character causes some problems fordefine-word--parse-wordnik
, such that calling define-word
on the word "backslash" yields an error. With Emacs 29:
- emacs -Q -l ~/.emacs.d/elpa/define-word-20220104.1848/define-word.el
- M-x toggle-debug-on-error
- M-x define-word RET backslash RET
Debugger entered--Lisp error: (error "Invalid use of ‘\\’ in replacement text")
replace-match(#("\\" 0 1 (face link)))
(let ((match (match-string 1))) (replace-match (propertize match 'face face)))
(while (re-search-forward regexp nil t) (let ((match (match-string 1))) (replace-match (propertize match 'face face))))
define-word--regexp-to-face("<xref>\\(.*?\\)</xref>" link)
(while (consp --cl-var--) (progn (setq --cl-var-- (car --cl-var--)) (setq regexp (car-safe (prog1 --cl-var-- (setq --cl-var-- (cdr --cl-var--))))) (setq face (car --cl-var--))) (define-word--regexp-to-face regexp face) (setq --cl-var-- (cdr --cl-var--)))
(let* ((--cl-var-- define-word--tag-faces) (regexp nil) (face nil) (--cl-var--)) (while (consp --cl-var--) (progn (setq --cl-var-- (car --cl-var--)) (setq regexp (car-safe (prog1 --cl-var-- (setq --cl-var-- (cdr --cl-var--))))) (setq face (car --cl-var--))) (define-word--regexp-to-face regexp face) (setq --cl-var-- (cdr --cl-var--))) nil)
(progn (insert str) (let* ((--cl-var-- define-word--tag-faces) (regexp nil) (face nil) (--cl-var--)) (while (consp --cl-var--) (progn (setq --cl-var-- (car --cl-var--)) (setq regexp (car-safe (prog1 --cl-var-- (setq --cl-var-- ...)))) (setq face (car --cl-var--))) (define-word--regexp-to-face regexp face) (setq --cl-var-- (cdr --cl-var--))) nil) (buffer-string))
(unwind-protect (progn (insert str) (let* ((--cl-var-- define-word--tag-faces) (regexp nil) (face nil) (--cl-var--)) (while (consp --cl-var--) (progn (setq --cl-var-- (car --cl-var--)) (setq regexp (car-safe (prog1 --cl-var-- ...))) (setq face (car --cl-var--))) (define-word--regexp-to-face regexp face) (setq --cl-var-- (cdr --cl-var--))) nil) (buffer-string)) (and (buffer-name temp-buffer) (kill-buffer temp-buffer)))
(save-current-buffer (set-buffer temp-buffer) (unwind-protect (progn (insert str) (let* ((--cl-var-- define-word--tag-faces) (regexp nil) (face nil) (--cl-var--)) (while (consp --cl-var--) (progn (setq --cl-var-- (car --cl-var--)) (setq regexp (car-safe ...)) (setq face (car --cl-var--))) (define-word--regexp-to-face regexp face) (setq --cl-var-- (cdr --cl-var--))) nil) (buffer-string)) (and (buffer-name temp-buffer) (kill-buffer temp-buffer))))
(let ((temp-buffer (generate-new-buffer " *temp*" t))) (save-current-buffer (set-buffer temp-buffer) (unwind-protect (progn (insert str) (let* ((--cl-var-- define-word--tag-faces) (regexp nil) (face nil) (--cl-var--)) (while (consp --cl-var--) (progn (setq --cl-var-- ...) (setq regexp ...) (setq face ...)) (define-word--regexp-to-face regexp face) (setq --cl-var-- (cdr --cl-var--))) nil) (buffer-string)) (and (buffer-name temp-buffer) (kill-buffer temp-buffer)))))
define-word--convert-html-tag-to-face(#("noun <i></i> A backward virgule ( \).\nnoun <i..." 0 5 (face define-word-face-1) 5 42 (face define-word-face-2) 43 48 (face define-word-face-1) 48 106 (face define-word-face-2) 107 112 (face define-word-face-1) 112 267 (face define-word-face-2) 268 273 (face define-word-face-1) 273 480 (face define-word-face-2)))
(progn (define-word--convert-html-tag-to-face (define-word--join-results results)))
(if (setq results (nreverse results)) (progn (define-word--convert-html-tag-to-face (define-word--join-results results))))
(let (results beg part) (while (re-search-forward "<li><abbr[^>]*>\\([^<]*\\)</abbr>" nil t) (setq part (match-string 1)) (if (= 0 (length part)) nil (setq part (concat part " "))) (skip-chars-forward " ") (setq beg (point)) (if (re-search-forward "</li>") (progn (setq results (cons (concat (propertize part ... ...) (propertize ... ... ...)) results))))) (if (setq results (nreverse results)) (progn (define-word--convert-html-tag-to-face (define-word--join-results results)))))
(progn (let (results beg part) (while (re-search-forward "<li><abbr[^>]*>\\([^<]*\\)</abbr>" nil t) (setq part (match-string 1)) (if (= 0 (length part)) nil (setq part (concat part " "))) (skip-chars-forward " ") (setq beg (point)) (if (re-search-forward "</li>") (progn (setq results (cons (concat ... ...) results))))) (if (setq results (nreverse results)) (progn (define-word--convert-html-tag-to-face (define-word--join-results results))))))
(unwind-protect (progn (let (results beg part) (while (re-search-forward "<li><abbr[^>]*>\\([^<]*\\)</abbr>" nil t) (setq part (match-string 1)) (if (= 0 (length part)) nil (setq part (concat part " "))) (skip-chars-forward " ") (setq beg (point)) (if (re-search-forward "</li>") (progn (setq results (cons ... results))))) (if (setq results (nreverse results)) (progn (define-word--convert-html-tag-to-face (define-word--join-results results)))))) (set-match-data saved-match-data t))
(let ((saved-match-data (match-data))) (unwind-protect (progn (let (results beg part) (while (re-search-forward "<li><abbr[^>]*>\\([^<]*\\)</abbr>" nil t) (setq part (match-string 1)) (if (= 0 (length part)) nil (setq part (concat part " "))) (skip-chars-forward " ") (setq beg (point)) (if (re-search-forward "</li>") (progn (setq results ...)))) (if (setq results (nreverse results)) (progn (define-word--convert-html-tag-to-face (define-word--join-results results)))))) (set-match-data saved-match-data t)))
define-word--parse-wordnik()
funcall(define-word--parse-wordnik)
(progn (url-insert-buffer-contents buffer url) (funcall parser))
(unwind-protect (progn (url-insert-buffer-contents buffer url) (funcall parser)) (and (buffer-name temp-buffer) (kill-buffer temp-buffer)))
(save-current-buffer (set-buffer temp-buffer) (unwind-protect (progn (url-insert-buffer-contents buffer url) (funcall parser)) (and (buffer-name temp-buffer) (kill-buffer temp-buffer))))
(let ((temp-buffer (generate-new-buffer " *temp*" t))) (save-current-buffer (set-buffer temp-buffer) (unwind-protect (progn (url-insert-buffer-contents buffer url) (funcall parser)) (and (buffer-name temp-buffer) (kill-buffer temp-buffer)))))
(let* ((url (format retriever (downcase word))) (buffer (url-retrieve-synchronously url t t))) (let ((temp-buffer (generate-new-buffer " *temp*" t))) (save-current-buffer (set-buffer temp-buffer) (unwind-protect (progn (url-insert-buffer-contents buffer url) (funcall parser)) (and (buffer-name temp-buffer) (kill-buffer temp-buffer))))))
(if (functionp retriever) (funcall retriever word) (let* ((url (format retriever (downcase word))) (buffer (url-retrieve-synchronously url t t))) (let ((temp-buffer (generate-new-buffer " *temp*" t))) (save-current-buffer (set-buffer temp-buffer) (unwind-protect (progn (url-insert-buffer-contents buffer url) (funcall parser)) (and (buffer-name temp-buffer) (kill-buffer temp-buffer)))))))
(let* ((servicedata (assoc service define-word-services)) (retriever (nth 1 servicedata)) (parser (nth 2 servicedata)) (url-user-agent (if (eq (nth 0 servicedata) 'wordnik) "Mozilla/5.0 (Macintosh; Intel Mac OS X 11_5_2) App..." url-user-agent))) (if (functionp retriever) (funcall retriever word) (let* ((url (format retriever (downcase word))) (buffer (url-retrieve-synchronously url t t))) (let ((temp-buffer (generate-new-buffer " *temp*" t))) (save-current-buffer (set-buffer temp-buffer) (unwind-protect (progn (url-insert-buffer-contents buffer url) (funcall parser)) (and (buffer-name temp-buffer) (kill-buffer temp-buffer))))))))
define-word--to-string("backslash" wordnik)
(let* ((service (or service (if choose-service (intern (completing-read "Service: " define-word-services)) define-word-default-service))) (results (define-word--to-string word service))) (funcall (define-word-displayfn service) (cond ((not results) "0 definitions found") ((define-word--expand "Plural form of \\(.*\\)\\.$" results service)) ((define-word--expand "Past participle of \\(.*\\)\\.$" results service)) ((define-word--expand "Present participle of \\(.*\\)\\.$" results service)) (t results))))
define-word("backslash" nil nil)
funcall-interactively(define-word "backslash" nil nil)
command-execute(define-word record)
execute-extended-command(nil "define-word" nil)
funcall-interactively(execute-extended-command nil "define-word" nil)
command-execute(execute-extended-command)