comparison lisp/woman.el @ 52567:22ddccd48cc0

(woman-file-name, woman-follow-word): If current-word returns nil, use "".
author Richard M. Stallman <rms@gnu.org>
date Mon, 22 Sep 2003 15:15:26 +0000
parents 695cf19ef79e
children 7caa4944980e
comparison
equal deleted inserted replaced
52566:38d8d37f129a 52567:22ddccd48cc0
1219 (if (boundp 'woman-topic-at-point) 1219 (if (boundp 'woman-topic-at-point)
1220 woman-topic-at-point 1220 woman-topic-at-point
1221 ;; Was let-bound when file loaded, so ... 1221 ;; Was let-bound when file loaded, so ...
1222 (setq woman-topic-at-point woman-topic-at-point-default))) 1222 (setq woman-topic-at-point woman-topic-at-point-default)))
1223 (setq topic 1223 (setq topic
1224 (current-word t)) ; only within or adjacent to word 1224 (or (current-word t) "")) ; only within or adjacent to word
1225 (assoc topic woman-topic-all-completions)) 1225 (assoc topic woman-topic-all-completions))
1226 (setq topic 1226 (setq topic
1227 (completing-read 1227 (completing-read
1228 "Manual entry: " 1228 "Manual entry: "
1229 woman-topic-all-completions nil 1 1229 woman-topic-all-completions nil 1
1230 ;; Initial input suggestion (was nil), with 1230 ;; Initial input suggestion (was nil), with
1231 ;; cursor at left ready to kill suggestion!: 1231 ;; cursor at left ready to kill suggestion!:
1232 (and woman-topic-at-point 1232 (and woman-topic-at-point
1233 (cons (current-word) 0)) ; nearest word 1233 (cons (or (current-word) "") 0)) ; nearest word
1234 'woman-topic-history))) 1234 'woman-topic-history)))
1235 ;; Note that completing-read always returns a string. 1235 ;; Note that completing-read always returns a string.
1236 (if (= (length topic) 0) 1236 (if (= (length topic) 0)
1237 nil ; no topic, so no file! 1237 nil ; no topic, so no file!
1238 (cond 1238 (cond
1742 (defun woman-follow-word (event) 1742 (defun woman-follow-word (event)
1743 "Run WoMan with word under mouse as topic. 1743 "Run WoMan with word under mouse as topic.
1744 Argument EVENT is the invoking mouse event." 1744 Argument EVENT is the invoking mouse event."
1745 (interactive "e") ; mouse event 1745 (interactive "e") ; mouse event
1746 (goto-char (posn-point (event-start event))) 1746 (goto-char (posn-point (event-start event)))
1747 (woman (current-word t))) 1747 (woman (or (current-word t) "")))
1748 1748
1749 ;; WoMan menu bar and pop-up menu: 1749 ;; WoMan menu bar and pop-up menu:
1750 (easy-menu-define 1750 (easy-menu-define
1751 woman-menu ; (SYMBOL MAPS DOC MENU) 1751 woman-menu ; (SYMBOL MAPS DOC MENU)
1752 ;; That comment was moved after the symbol `woman-menu' to make 1752 ;; That comment was moved after the symbol `woman-menu' to make