Show
Ignore:
Timestamp:
07/16/06 08:36:52 (2 years ago)
Author:
miyoshi
Message:

Sync up with Emacs CVS HEAD.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/lisp/locate.el

    r4058 r4111  
    192192  :version "22.1") 
    193193 
     194(defcustom locate-update-when-revert nil 
     195  "This option affects how the *Locate* buffer gets reverted. 
     196If 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 
     198option `locate-update-path'.) 
     199If nil, reverting does not update the locate database." 
     200  :type 'boolean 
     201  :group 'locate 
     202  :version "22.1") 
     203 
    194204(defcustom locate-update-command "updatedb" 
    195205  "The executable program used to update the locate database." 
     
    197207  :group 'locate) 
    198208 
     209(defcustom locate-update-path "/" 
     210  "The default directory from where `locate-update-command' is called. 
     211Usually, root permissions are required to run that command.  This 
     212can be achieved by setting this option to \"/su::\" or \"/sudo::\" 
     213\(if you have the appropriate authority).  If your current user 
     214permissions are sufficient to run the command, you can set this 
     215option to \"/\"." 
     216  :type 'string 
     217  :group 'locate 
     218  :version "22.1") 
     219 
    199220(defcustom locate-prompt-for-command nil 
    200221  "If non-nil, the `locate' command prompts for a command to run. 
    201222Otherwise, that behavior is invoked via a prefix argument." 
    202223  :group 'locate 
    203   :type 'boolean 
    204   ) 
     224  :type 'boolean) 
    205225 
    206226;; Functions 
     
    558578;; From Stephen Eglen <stephen@cns.ed.ac.uk> 
    559579(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. 
     581If `locate-update-when-revert' is non-nil, offer to update the 
     582locate database using the shell command in `locate-update-command'." 
    562583  (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))) 
    566592 
    567593;;; Modified three functions from `dired.el':