X-Git-Url: https://fleuret.org/cgi-bin/gitweb/gitweb.cgi?a=blobdiff_plain;f=lookup-dict.el;h=97ec375d5f2c7db278165d0c468cd50e4d04e6db;hb=de8dfabe25f8469dff7e8901919a5ae970592725;hp=e89c23733bb4ec5ced238770b5f7541c78e543fd;hpb=3771096a125c7cff7216ca61ce51b2cda5a7aca1;p=elisp.git diff --git a/lookup-dict.el b/lookup-dict.el index e89c237..97ec375 100644 --- a/lookup-dict.el +++ b/lookup-dict.el @@ -58,7 +58,7 @@ 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 "*"))) @@ -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)