Mercurial > emacs
comparison lisp/locate.el @ 90519:138ce2701550
Merge from emacs--devo--0
Patches applied:
* emacs--devo--0 (patch 320-342)
- Update from CVS
- Merge from gnus--rel--5.10
- lisp/play/cookie1.el (cookie): Work properly when there's only one entry
- Add note about "link" button-class to etc/TODO
* gnus--rel--5.10 (patch 108-112)
- Merge from emacs--devo--0
- Clean up merge mistakes
- Update from CVS
- Update from CVS: texi/gnus.texi (Summary Buffer Lines): Fix typo.
Revision: emacs@sv.gnu.org/emacs--unicode--0--patch-86
author | Miles Bader <miles@gnu.org> |
---|---|
date | Thu, 06 Jul 2006 08:59:39 +0000 |
parents | e3bacb89536a 6958f9575abf |
children | a1a25ac6c88a |
comparison
equal
deleted
inserted
replaced
90518:64c755511769 | 90519:138ce2701550 |
---|---|
189 This should contain the \"-l\" switch, but not the \"-F\" or \"-b\" switches." | 189 This should contain the \"-l\" switch, but not the \"-F\" or \"-b\" switches." |
190 :type 'string | 190 :type 'string |
191 :group 'locate | 191 :group 'locate |
192 :version "22.1") | 192 :version "22.1") |
193 | 193 |
194 (defcustom locate-update-when-revert nil | |
195 "This option affects how the *Locate* buffer gets reverted. | |
196 If non-nil, offer to update the locate database when reverting that buffer. | |
197 \(Normally, you need to have root privileges for this to work. See the | |
198 option `locate-update-path'.) | |
199 If nil, reverting does not update the locate database." | |
200 :type 'boolean | |
201 :group 'locate | |
202 :version "22.1") | |
203 | |
194 (defcustom locate-update-command "updatedb" | 204 (defcustom locate-update-command "updatedb" |
195 "The executable program used to update the locate database." | 205 "The executable program used to update the locate database." |
196 :type 'string | 206 :type 'string |
197 :group 'locate) | 207 :group 'locate) |
198 | 208 |
209 (defcustom locate-update-path "/" | |
210 "The default directory from where `locate-update-command' is called. | |
211 Usually, root permissions are required to run that command. This | |
212 can be achieved by setting this option to \"/su::\" or \"/sudo::\" | |
213 \(if you have the appropriate authority). If your current user | |
214 permissions are sufficient to run the command, you can set this | |
215 option to \"/\"." | |
216 :type 'string | |
217 :group 'locate | |
218 :version "22.1") | |
219 | |
199 (defcustom locate-prompt-for-command nil | 220 (defcustom locate-prompt-for-command nil |
200 "If non-nil, the `locate' command prompts for a command to run. | 221 "If non-nil, the `locate' command prompts for a command to run. |
201 Otherwise, that behavior is invoked via a prefix argument." | 222 Otherwise, that behavior is invoked via a prefix argument." |
202 :group 'locate | 223 :group 'locate |
203 :type 'boolean | 224 :type 'boolean) |
204 ) | |
205 | 225 |
206 ;; Functions | 226 ;; Functions |
207 | 227 |
208 (defun locate-default-make-command-line (search-string) | 228 (defun locate-default-make-command-line (search-string) |
209 (list locate-command search-string)) | 229 (list locate-command search-string)) |
555 (visit-tags-table tags-table))) | 575 (visit-tags-table tags-table))) |
556 (message "This command only works inside main listing."))) | 576 (message "This command only works inside main listing."))) |
557 | 577 |
558 ;; From Stephen Eglen <stephen@cns.ed.ac.uk> | 578 ;; From Stephen Eglen <stephen@cns.ed.ac.uk> |
559 (defun locate-update (ignore1 ignore2) | 579 (defun locate-update (ignore1 ignore2) |
560 "Update the locate database. | 580 "Revert the *Locate* buffer. |
561 Database is updated using the shell command in `locate-update-command'." | 581 If `locate-update-when-revert' is non-nil, offer to update the |
582 locate database using the shell command in `locate-update-command'." | |
562 (let ((str (car locate-history-list))) | 583 (let ((str (car locate-history-list))) |
563 (cond ((yes-or-no-p "Update locate database (may take a few seconds)? ") | 584 (and locate-update-when-revert |
564 (shell-command locate-update-command) | 585 (yes-or-no-p "Update locate database (may take a few seconds)? ") |
565 (locate str))))) | 586 ;; `expand-file-name' is used in order to autoload Tramp if |
587 ;; necessary. It cannot be loaded when `default-directory' | |
588 ;; is remote. | |
589 (let ((default-directory (expand-file-name locate-update-path))) | |
590 (shell-command locate-update-command))) | |
591 (locate str))) | |
566 | 592 |
567 ;;; Modified three functions from `dired.el': | 593 ;;; Modified three functions from `dired.el': |
568 ;;; dired-find-directory, | 594 ;;; dired-find-directory, |
569 ;;; dired-find-directory-other-window | 595 ;;; dired-find-directory-other-window |
570 ;;; dired-get-filename | 596 ;;; dired-get-filename |