diff options
| author | Richard M. Stallman | 2005-09-09 01:21:28 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 2005-09-09 01:21:28 +0000 |
| commit | b25dc41feacbaa1894a2f739ecc7cc60040fd1bb (patch) | |
| tree | 18fa703b634907b2195844c8c9fbc6b624a10801 | |
| parent | f57b45cfeeef35336bdba313bb3fd08ef69bbaf8 (diff) | |
| download | emacs-b25dc41feacbaa1894a2f739ecc7cc60040fd1bb.tar.gz emacs-b25dc41feacbaa1894a2f739ecc7cc60040fd1bb.zip | |
(woman-file-name): Provide a default, not initial input.
| -rw-r--r-- | lisp/woman.el | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/lisp/woman.el b/lisp/woman.el index cfc6da83e8e..39a033e5267 100644 --- a/lisp/woman.el +++ b/lisp/woman.el | |||
| @@ -3,7 +3,7 @@ | |||
| 3 | ;; Copyright (C) 2000, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. | 3 | ;; Copyright (C) 2000, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. |
| 4 | 4 | ||
| 5 | ;; Author: Francis J. Wright <F.J.Wright@qmul.ac.uk> | 5 | ;; Author: Francis J. Wright <F.J.Wright@qmul.ac.uk> |
| 6 | ;; Maintainer: Francis J. Wright <F.J.Wright@qmul.ac.uk> | 6 | ;; Maintainer: FSF |
| 7 | ;; Keywords: help, unix | 7 | ;; Keywords: help, unix |
| 8 | ;; Adapted-By: Eli Zaretskii <eliz@gnu.org> | 8 | ;; Adapted-By: Eli Zaretskii <eliz@gnu.org> |
| 9 | ;; Version: see `woman-version' | 9 | ;; Version: see `woman-version' |
| @@ -1221,7 +1221,8 @@ Optional argument RE-CACHE, if non-nil, forces the cache to be re-read." | |||
| 1221 | ;; completions, but to return only a case-sensitive match. This | 1221 | ;; completions, but to return only a case-sensitive match. This |
| 1222 | ;; does not seem to work properly by default, so I re-do the | 1222 | ;; does not seem to work properly by default, so I re-do the |
| 1223 | ;; completion if necessary. | 1223 | ;; completion if necessary. |
| 1224 | (let (files) | 1224 | (let (files |
| 1225 | (default (current-word))) | ||
| 1225 | (or (stringp topic) | 1226 | (or (stringp topic) |
| 1226 | (and (eq t | 1227 | (and (eq t |
| 1227 | (if (boundp 'woman-topic-at-point) | 1228 | (if (boundp 'woman-topic-at-point) |
| @@ -1233,13 +1234,15 @@ Optional argument RE-CACHE, if non-nil, forces the cache to be re-read." | |||
| 1233 | (assoc topic woman-topic-all-completions)) | 1234 | (assoc topic woman-topic-all-completions)) |
| 1234 | (setq topic | 1235 | (setq topic |
| 1235 | (completing-read | 1236 | (completing-read |
| 1236 | "Manual entry: " | 1237 | (if default |
| 1238 | (format "Manual entry (default `%s'): " default) | ||
| 1239 | "Manual entry: ") | ||
| 1237 | woman-topic-all-completions nil 1 | 1240 | woman-topic-all-completions nil 1 |
| 1238 | ;; Initial input suggestion (was nil), with | 1241 | nil |
| 1239 | ;; cursor at left ready to kill suggestion!: | 1242 | 'woman-topic-history |
| 1243 | ;; Default topic. | ||
| 1240 | (and woman-topic-at-point | 1244 | (and woman-topic-at-point |
| 1241 | (cons (or (current-word) "") 0)) ; nearest word | 1245 | default)))) |
| 1242 | 'woman-topic-history))) | ||
| 1243 | ;; Note that completing-read always returns a string. | 1246 | ;; Note that completing-read always returns a string. |
| 1244 | (if (= (length topic) 0) | 1247 | (if (= (length topic) 0) |
| 1245 | nil ; no topic, so no file! | 1248 | nil ; no topic, so no file! |