emacs-pretest-bug
[Top][All Lists]
Advanced

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

Re: patch for locate.el when called with prefix arg


From: Luc Teirlinck
Subject: Re: patch for locate.el when called with prefix arg
Date: Sat, 21 Apr 2007 14:36:48 -0500 (CDT)

        (1) revert-buffer does not work in *Locate* buffers that result from
        C-u locate RET or C-u locate-with-filter RET.

   We have not generally implemented reverting for search command output.

Locate implements a revert-buffer-function, locate-update.
The reported bug can be annoying and confusing to the user.

The following patch fixes the reported bug, as well as a related bug
when locate-prompt-for-command is t, as well as a related bug with
`C-u g' in locate buffers, and provides a doc fix for
locate-prompt-for-command:

===File ~/locate-diff-4=====================================
*** locate.el   21 Apr 2007 00:00:52 -0500      1.42
--- locate.el   21 Apr 2007 14:27:15 -0500      
***************
*** 117,122 ****
--- 117,123 ----
  (defvar locate-current-filter nil)
  (defvar locate-local-filter nil)
  (defvar locate-local-search nil)
+ (defvar locate-local-prompt nil)
  
  (defgroup locate nil
    "Interface to the locate command."
***************
*** 221,227 ****
  
  (defcustom locate-prompt-for-command nil
    "If non-nil, the `locate' command prompts for a command to run.
! Otherwise, that behavior is invoked via a prefix argument."
    :group 'locate
    :type 'boolean)
  
--- 222,231 ----
  
  (defcustom locate-prompt-for-command nil
    "If non-nil, the `locate' command prompts for a command to run.
! Otherwise, that behavior is invoked via a prefix argument.
! 
! Setting this option non-nil actually inverts the meaning of a prefix arg;
! that is, with a prefix arg, you get the default behavior."
    :group 'locate
    :type 'boolean)
  
***************
*** 304,309 ****
--- 308,314 ----
        (setq locate-current-filter filter)
        (set (make-local-variable 'locate-local-search) search-string)
        (set (make-local-variable 'locate-local-filter) filter)
+       (set (make-local-variable 'locate-local-prompt) run-locate-command)
  
        (if run-locate-command
            (shell-command search-string locate-buffer-name)
***************
*** 584,590 ****
    "Revert the *Locate* buffer.
  If `locate-update-when-revert' is non-nil, offer to update the
  locate database using the shell command in `locate-update-command'."
!   (let ((locate-buffer-name (buffer-name)))
      (and locate-update-when-revert
         (yes-or-no-p "Update locate database (may take a few seconds)? ")
         ;; `expand-file-name' is used in order to autoload Tramp if
--- 589,597 ----
    "Revert the *Locate* buffer.
  If `locate-update-when-revert' is non-nil, offer to update the
  locate database using the shell command in `locate-update-command'."
!   (let ((locate-buffer-name (buffer-name))
!       (locate-prompt-for-command locate-local-prompt)
!       (current-prefix-arg nil))
      (and locate-update-when-revert
         (yes-or-no-p "Update locate database (may take a few seconds)? ")
         ;; `expand-file-name' is used in order to autoload Tramp if
============================================================




reply via email to

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