emacs-devel
[Top][All Lists]
Advanced

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

list-matching-lines is alias for occur


From: Juri Linkov
Subject: list-matching-lines is alias for occur
Date: Wed, 09 Nov 2005 11:28:28 +0200
User-agent: Gnus/5.110004 (No Gnus v0.4) Emacs/22.0.50 (gnu/linux)

The feature that shows in a separate buffer all lines containing a
regexp is known under the name "occur" rather than "list-matching-lines".
The Emacs manual confirms that the primary name is `occur':

    `M-x list-matching-lines'
         Synonym for `M-x occur'.

and code defines `list-matching-lines' is an alias for `occur':

    (defalias 'list-matching-lines 'occur)

Nevertheless, user options used to customize `occur' have the prefix
"list-matching-lines".  The following patch renames their prefixes to
"occur" and creates aliases to the names with "list-matching-lines"
prefix.

Index: lisp/replace.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/replace.el,v
retrieving revision 1.230
diff -c -r1.230 replace.el
*** lisp/replace.el     9 Nov 2005 07:41:48 -0000       1.230
--- lisp/replace.el     9 Nov 2005 09:27:54 -0000
***************
*** 857,882 ****
    :group 'matching
    :version "22.1")
  
! (defcustom list-matching-lines-default-context-lines 0
!   "*Default number of context lines included around `list-matching-lines' 
matches.
  A negative number means to include that many lines before the match.
  A positive number means to include that many lines both before and after."
    :type 'integer
    :group 'matching)
  
  (defalias 'list-matching-lines 'occur)
  
! (defcustom list-matching-lines-face 'match
!   "*Face used by \\[list-matching-lines] to show the text that matches.
  If the value is nil, don't highlight the matching portions specially."
    :type 'face
    :group 'matching)
  
! (defcustom list-matching-lines-buffer-name-face 'underline
!   "*Face used by \\[list-matching-lines] to show the names of buffers.
  If the value is nil, don't highlight the buffer names specially."
    :type 'face
    :group 'matching)
  
  (defcustom occur-excluded-properties
    '(read-only invisible intangible field mouse-face help-echo local-map keymap
--- 857,885 ----
    :group 'matching
    :version "22.1")
  
! (defcustom occur-context-lines 0
!   "*Default number of context lines included around `occur' matches.
  A negative number means to include that many lines before the match.
  A positive number means to include that many lines both before and after."
    :type 'integer
    :group 'matching)
+ (defvaralias 'list-matching-lines-default-context-lines 'occur-context-lines)
  
  (defalias 'list-matching-lines 'occur)
  
! (defcustom occur-match-face 'match
!   "*Face used by \\[occur] to show the text that matches.
  If the value is nil, don't highlight the matching portions specially."
    :type 'face
    :group 'matching)
+ (defvaralias 'list-matching-lines-face 'occur-match-face)
  
! (defcustom occur-buffer-name-face 'underline
!   "*Face used by \\[occur] to show the names of buffers.
  If the value is nil, don't highlight the buffer names specially."
    :type 'face
    :group 'matching)
+ (defvaralias 'list-matching-lines-buffer-name-face 'occur-buffer-name-face)
  
  (defcustom occur-excluded-properties
    '(read-only invisible intangible field mouse-face help-echo local-map keymap
***************
*** 955,962 ****
  This function can not handle matches that span more than one line.
  
  Each line is displayed with NLINES lines before and after, or -NLINES
! before if NLINES is negative.
! NLINES defaults to `list-matching-lines-default-context-lines'.
  Interactively it is the prefix arg.
  
  The lines are shown in a buffer named `*Occur*'.
--- 958,964 ----
  This function can not handle matches that span more than one line.
  
  Each line is displayed with NLINES lines before and after, or -NLINES
! before if NLINES is negative.  NLINES defaults to `occur-context-lines'.
  Interactively it is the prefix arg.
  
  The lines are shown in a buffer named `*Occur*'.
***************
*** 1041,1051 ****
        (erase-buffer)
        (let ((count (occur-engine
                      regexp active-bufs occur-buf
!                     (or nlines list-matching-lines-default-context-lines)
                      (and case-fold-search
                           (isearch-no-upper-case-p regexp t))
!                     list-matching-lines-buffer-name-face
!                     nil list-matching-lines-face
                      (not (eq occur-excluded-properties t)))))
          (let* ((bufcount (length active-bufs))
                 (diff (- (length bufs) bufcount)))
--- 1043,1052 ----
        (erase-buffer)
        (let ((count (occur-engine
                      regexp active-bufs occur-buf
!                     (or nlines occur-context-lines)
                      (and case-fold-search
                           (isearch-no-upper-case-p regexp t))
!                     occur-buffer-name-face nil occur-match-face
                      (not (eq occur-excluded-properties t)))))
          (let* ((bufcount (length active-bufs))
                 (diff (- (length bufs) bufcount)))

-- 
Juri Linkov
http://www.jurta.org/emacs/





reply via email to

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