emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] Changes to emacs/lisp/locate.el


From: Richard M. Stallman
Subject: [Emacs-diffs] Changes to emacs/lisp/locate.el
Date: Sat, 17 Nov 2001 10:38:59 -0500

Index: emacs/lisp/locate.el
diff -u emacs/lisp/locate.el:1.16 emacs/lisp/locate.el:1.17
--- emacs/lisp/locate.el:1.16   Fri Sep  7 09:32:45 2001
+++ emacs/lisp/locate.el        Sat Nov 17 10:38:59 2001
@@ -199,11 +199,18 @@
                       (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))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]