emacs-devel
[Top][All Lists]
Advanced

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

Re: locate-with-filter


From: Luc Teirlinck
Subject: Re: locate-with-filter
Date: Sun, 12 Mar 2006 17:59:14 -0600 (CST)

Richard Stallman wrote:

   The doc string of locate-with-filter is not clear at all.
   Can someone make it clearer?

I have no problem understanding it myself, so I do not know what the
exact problem is.  However, does the patch below make it clearer?
The other changes in the patch are meant to distinguish more clearly
between the external locate program and the Emacs locate command,
remove a confusing self-referential link in the locate docstring and
replace an alias for `keep-lines' by the current name.

I can install if desired.

===File ~/locate-diff=======================================
*** locate.el   06 Feb 2006 16:01:50 -0600      1.35
--- locate.el   12 Mar 2006 17:45:59 -0600      
***************
*** 190,196 ****
  
  ;;;###autoload
  (defun locate (search-string &optional filter)
!   "Run the program `locate', putting results in `*Locate*' buffer.
  With prefix arg, prompt for the locate command to run."
    (interactive
        (list
--- 190,196 ----
  
  ;;;###autoload
  (defun locate (search-string &optional filter)
!   "Run the locate program, putting results in `*Locate*' buffer.
  With prefix arg, prompt for the locate command to run."
    (interactive
        (list
***************
*** 255,264 ****
  
  ;;;###autoload
  (defun locate-with-filter (search-string filter)
!   "Run the locate command with a filter.
  
! The filter is a regular expression. Only results matching the filter are
! shown; this is often useful to constrain a big search."
    (interactive
     (list (read-from-minibuffer "Locate: " nil nil
                               nil 'locate-history-list)
--- 255,265 ----
  
  ;;;###autoload
  (defun locate-with-filter (search-string filter)
!   "Run the locate program with a filter.
  
! FILTER is a regular expression.  Only the lines in the output of
! the locate program that contain a match for FILTER are shown in
! the `*Locate*' buffer; this is often useful to constrain a big search."
    (interactive
     (list (read-from-minibuffer "Locate: " nil nil
                               nil 'locate-history-list)
***************
*** 269,275 ****
  (defun locate-filter-output (filter)
    "Filter output from the locate command."
    (goto-char (point-min))
!   (delete-non-matching-lines filter))
  
  (defvar locate-mode-map nil
    "Local keymap for Locate mode buffers.")
--- 270,276 ----
  (defun locate-filter-output (filter)
    "Filter output from the locate command."
    (goto-char (point-min))
!   (keep-lines filter))
  
  (defvar locate-mode-map nil
    "Local keymap for Locate mode buffers.")
============================================================




reply via email to

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