X-Git-Url: https://www.fleuret.org/cgi-bin/gitweb/gitweb.cgi?p=elisp.git;a=blobdiff_plain;f=lookup-dict.el;h=4ac7bf4913ca23b1aa4deb7339e9a051c2429c59;hp=e89c23733bb4ec5ced238770b5f7541c78e543fd;hb=HEAD;hpb=3771096a125c7cff7216ca61ce51b2cda5a7aca1 diff --git a/lookup-dict.el b/lookup-dict.el index e89c237..4ac7bf4 100644 --- a/lookup-dict.el +++ b/lookup-dict.el @@ -58,9 +58,9 @@ argument \\[universal-argument] forces the third." (when (string= word "") (setq word (read-input "Word: "))) - (setq word (replace-regexp-in-string "[^a-zA-Z\- ]" "" (or word ""))) + (setq word (replace-regexp-in-string "[^a-zA-Z\- \.]" "" (or word ""))) - (let ((name (concat "*definition " word "*"))) + (let ((name (concat "*definition of " word "*"))) (if (get-buffer name) (switch-to-buffer name) @@ -98,10 +98,14 @@ argument \\[universal-argument] forces the third." (save-excursion (goto-char (point-min)) (while (re-search-forward "^From.*$" nil t) - (add-text-properties (match-beginning 0) (match-end 0) '(face underline))) + (add-text-properties (match-beginning 0) + (match-end 0) + '(face underline))) (goto-char (point-min)) - (while (re-search-forward word nil t) - (add-text-properties (match-beginning 0) (match-end 0) '(face bold)))) + (while (re-search-forward (concat "[^a-zA-Z]\\\(" word "\\\)[^a-zA-Z]") nil t) + (add-text-properties (match-beginning 1) + (match-end 1) + '(face bold)))) ) (setq buffer-read-only t)