Commit cb5e49a3 authored by Glenn Morris's avatar Glenn Morris
Browse files

* lisp/locate.el (locate, locate-mode): Doc fixes.

parent 381d186f
2010-11-01 Glenn Morris <rgm@gnu.org>
* locate.el (locate, locate-mode): Doc fixes.
2010-11-01 Chong Yidong <cyd@stupidchicken.com> 2010-11-01 Chong Yidong <cyd@stupidchicken.com>
* server.el (server-start): New arg INHIBIT-PROMPT prevents asking * server.el (server-start): New arg INHIBIT-PROMPT prevents asking
......
...@@ -270,7 +270,7 @@ that is, with a prefix arg, you get the default behavior." ...@@ -270,7 +270,7 @@ that is, with a prefix arg, you get the default behavior."
(defun locate (search-string &optional filter arg) (defun locate (search-string &optional filter arg)
"Run the program `locate', putting results in `*Locate*' buffer. "Run the program `locate', putting results in `*Locate*' buffer.
Pass it SEARCH-STRING as argument. Interactively, prompt for SEARCH-STRING. Pass it SEARCH-STRING as argument. Interactively, prompt for SEARCH-STRING.
With prefix arg, prompt for the exact shell command to run instead. With prefix arg ARG, prompt for the exact shell command to run instead.
This program searches for those file names in a database that match This program searches for those file names in a database that match
SEARCH-STRING and normally outputs all matching absolute file names, SEARCH-STRING and normally outputs all matching absolute file names,
...@@ -286,7 +286,8 @@ the variables `locate-command' or `locate-make-command-line'. ...@@ -286,7 +286,8 @@ the variables `locate-command' or `locate-make-command-line'.
The main use of FILTER is to implement `locate-with-filter'. See The main use of FILTER is to implement `locate-with-filter'. See
the docstring of that function for its meaning. the docstring of that function for its meaning.
ARG is the interactive prefix arg." After preparing the results buffer, this runs `dired-mode-hook' and
then `locate-post-command-hook'."
(interactive (interactive
(list (list
(locate-prompt-for-search-string) (locate-prompt-for-search-string)
...@@ -300,8 +301,7 @@ ARG is the interactive prefix arg." ...@@ -300,8 +301,7 @@ ARG is the interactive prefix arg."
(locate-cmd-args (cdr locate-cmd-list)) (locate-cmd-args (cdr locate-cmd-list))
(run-locate-command (run-locate-command
(or (and arg (not locate-prompt-for-command)) (or (and arg (not locate-prompt-for-command))
(and (not arg) locate-prompt-for-command))) (and (not arg) locate-prompt-for-command))))
)
;; Find the Locate buffer ;; Find the Locate buffer
(save-window-excursion (save-window-excursion
...@@ -323,16 +323,13 @@ ARG is the interactive prefix arg." ...@@ -323,16 +323,13 @@ ARG is the interactive prefix arg."
(and filter (and filter
(locate-filter-output filter)) (locate-filter-output filter))
(locate-do-setup search-string) (locate-do-setup search-string)))
))
(and (not (string-equal (buffer-name) locate-buffer-name)) (and (not (string-equal (buffer-name) locate-buffer-name))
(switch-to-buffer-other-window locate-buffer-name)) (switch-to-buffer-other-window locate-buffer-name))
(run-hooks 'dired-mode-hook) (run-hooks 'dired-mode-hook)
(dired-next-line 3) ;move to first matching file. (dired-next-line 3) ;move to first matching file.
(run-hooks 'locate-post-command-hook) (run-hooks 'locate-post-command-hook)))
)
)
;;;###autoload ;;;###autoload
(defun locate-with-filter (search-string filter &optional arg) (defun locate-with-filter (search-string filter &optional arg)
...@@ -447,6 +444,7 @@ file name or is inside a subdirectory." ...@@ -447,6 +444,7 @@ file name or is inside a subdirectory."
\\<locate-mode-map>\ \\<locate-mode-map>\
In that buffer, you can use almost all the usual dired bindings. In that buffer, you can use almost all the usual dired bindings.
\\[locate-find-directory] visits the directory of the file on the current line. \\[locate-find-directory] visits the directory of the file on the current line.
This function runs `locate-mode-hook' before returning.
Operating on listed files works, but does not always Operating on listed files works, but does not always
automatically update the buffer as in ordinary Dired. automatically update the buffer as in ordinary Dired.
...@@ -687,5 +685,4 @@ the database on the command line." ...@@ -687,5 +685,4 @@ the database on the command line."
(provide 'locate) (provide 'locate)
;; arch-tag: 60c4d098-b5d5-4b3c-a3e0-51a2e9f43898
;;; locate.el ends here ;;; locate.el ends here
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment