(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)
(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)