diff options
| author | Richard M. Stallman | 2001-11-17 15:42:19 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 2001-11-17 15:42:19 +0000 |
| commit | fe8c7212711d93d339a08abd64ffc357e9d5aff7 (patch) | |
| tree | dee0e6e170a184e53686d38fb5c808203de8a740 | |
| parent | a5e6715c0374a8288df140c8374982be5f58f292 (diff) | |
| download | emacs-fe8c7212711d93d339a08abd64ffc357e9d5aff7.tar.gz emacs-fe8c7212711d93d339a08abd64ffc357e9d5aff7.zip | |
(locate): Show default locate pattern within the
prompt, but don't insert it into the minibuffer contents. Catch
the case when pattern is the empty string.
| -rw-r--r-- | lisp/ChangeLog | 6 | ||||
| -rw-r--r-- | lisp/locate.el | 17 |
2 files changed, 18 insertions, 5 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 853e429da23..f7a2c6b1eba 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,9 @@ | |||
| 1 | 2001-11-17 Stephen Eglen <stephen@gnu.org> | ||
| 2 | |||
| 3 | * locate.el (locate): Show default locate pattern within the | ||
| 4 | prompt, but don't insert it into the minibuffer contents. Catch | ||
| 5 | the case when pattern is the empty string. | ||
| 6 | |||
| 1 | 2001-11-17 Eli Zaretskii <eliz@is.elta.co.il> | 7 | 2001-11-17 Eli Zaretskii <eliz@is.elta.co.il> |
| 2 | 8 | ||
| 3 | * language/european.el ("French"): New language environment. | 9 | * language/european.el ("French"): New language environment. |
diff --git a/lisp/locate.el b/lisp/locate.el index 80dc7af7a21..6d5967a5750 100644 --- a/lisp/locate.el +++ b/lisp/locate.el | |||
| @@ -199,11 +199,18 @@ With prefix arg, prompt for the locate command to run." | |||
| 199 | (mapconcat 'identity (cdr locate-cmd) " ")) | 199 | (mapconcat 'identity (cdr locate-cmd) " ")) |
| 200 | (+ 2 (length (car locate-cmd)))) | 200 | (+ 2 (length (car locate-cmd)))) |
| 201 | nil nil 'locate-history-list)) | 201 | nil nil 'locate-history-list)) |
| 202 | (read-from-minibuffer | 202 | (let* ((default (locate-word-at-point)) |
| 203 | "Locate: " | 203 | (input |
| 204 | (locate-word-at-point) | 204 | (read-from-minibuffer |
| 205 | nil nil 'locate-history-list) | 205 | (if (> (length default) 0) |
| 206 | ))) | 206 | (format "Locate (default `%s'): " default) |
| 207 | (format "Locate: ")) | ||
| 208 | nil nil nil 'locate-history-list default t))) | ||
| 209 | (and (equal input "") default | ||
| 210 | (setq input default)) | ||
| 211 | input)))) | ||
| 212 | (if (equal search-string "") | ||
| 213 | (error "Please specify a filename to search for.")) | ||
| 207 | (let* ((locate-cmd-list (funcall locate-make-command-line search-string)) | 214 | (let* ((locate-cmd-list (funcall locate-make-command-line search-string)) |
| 208 | (locate-cmd (car locate-cmd-list)) | 215 | (locate-cmd (car locate-cmd-list)) |
| 209 | (locate-cmd-args (cdr locate-cmd-list)) | 216 | (locate-cmd-args (cdr locate-cmd-list)) |