Changeset 4111 for trunk/lisp/locate.el
- Timestamp:
- 07/16/06 08:36:52 (2 years ago)
- Files:
-
- trunk/lisp/locate.el (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/lisp/locate.el
r4058 r4111 192 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 204 (defcustom locate-update-command "updatedb" 195 205 "The executable program used to update the locate database." … … 197 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 220 (defcustom locate-prompt-for-command nil 200 221 "If non-nil, the `locate' command prompts for a command to run. 201 222 Otherwise, that behavior is invoked via a prefix argument." 202 223 :group 'locate 203 :type 'boolean 204 ) 224 :type 'boolean) 205 225 206 226 ;; Functions … … 558 578 ;; From Stephen Eglen <stephen@cns.ed.ac.uk> 559 579 (defun locate-update (ignore1 ignore2) 560 "Update the locate database. 561 Database is updated using the shell command in `locate-update-command'." 580 "Revert the *Locate* buffer. 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 583 (let ((str (car locate-history-list))) 563 (cond ((yes-or-no-p "Update locate database (may take a few seconds)? ") 564 (shell-command locate-update-command) 565 (locate str))))) 584 (and locate-update-when-revert 585 (yes-or-no-p "Update locate database (may take a few seconds)? ") 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 593 ;;; Modified three functions from `dired.el':
