1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-01-08 12:40:49 -08:00

(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.
This commit is contained in:
Richard M. Stallman 2001-11-17 15:42:19 +00:00
parent a5e6715c03
commit fe8c721271
2 changed files with 18 additions and 5 deletions

View file

@ -1,3 +1,9 @@
2001-11-17 Stephen Eglen <stephen@gnu.org>
* locate.el (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.
2001-11-17 Eli Zaretskii <eliz@is.elta.co.il>
* language/european.el ("French"): New language environment.

View file

@ -199,11 +199,18 @@ With prefix arg, prompt for the locate command to run."
(mapconcat 'identity (cdr locate-cmd) " "))
(+ 2 (length (car locate-cmd))))
nil nil 'locate-history-list))
(read-from-minibuffer
"Locate: "
(locate-word-at-point)
nil nil 'locate-history-list)
)))
(let* ((default (locate-word-at-point))
(input
(read-from-minibuffer
(if (> (length default) 0)
(format "Locate (default `%s'): " default)
(format "Locate: "))
nil nil nil 'locate-history-list default t)))
(and (equal input "") default
(setq input default))
input))))
(if (equal search-string "")
(error "Please specify a filename to search for."))
(let* ((locate-cmd-list (funcall locate-make-command-line search-string))
(locate-cmd (car locate-cmd-list))
(locate-cmd-args (cdr locate-cmd-list))