# HG changeset patch # User Richard M. Stallman # Date 1102033192 0 # Node ID 5ffd11b70941760774030ef3089ed0ac1db181d4 # Parent 4ea947ec3dac0b3ad2a3b6ba2bad0f9639cc5026 (occur-1): Specify t for KEEP-PROPS to occur-engine. (occur-engine): Use `face' prop rather than `font-lock-face' when specifying use of `match-face'. (occur-accumulate-lines): Change arg from NO-PROPS to KEEP-PROPS. diff -r 4ea947ec3dac -r 5ffd11b70941 lisp/replace.el --- a/lisp/replace.el Fri Dec 03 00:11:21 2004 +0000 +++ b/lisp/replace.el Fri Dec 03 00:19:52 2004 +0000 @@ -751,7 +751,6 @@ ;; In case the *Occur* buffer is visible in a nonselected window. (set-window-point (get-buffer-window (current-buffer)) (point)) (occur-mode-goto-occurrence))) - (defcustom list-matching-lines-default-context-lines 0 "*Default number of context lines included around `list-matching-lines' matches. @@ -774,7 +773,7 @@ :type 'face :group 'matching) -(defun occur-accumulate-lines (count &optional no-props) +(defun occur-accumulate-lines (count &optional keep-props) (save-excursion (let ((forwardp (> count 0)) (result nil)) @@ -784,9 +783,9 @@ (bobp)))) (setq count (+ count (if forwardp -1 1))) (push - (funcall (if no-props - #'buffer-substring-no-properties - #'buffer-substring) + (funcall (if keep-props + #'buffer-substring + #'buffer-substring-no-properties) (line-beginning-position) (line-end-position)) result) @@ -921,7 +920,7 @@ (and case-fold-search (isearch-no-upper-case-p regexp t)) list-matching-lines-buffer-name-face - nil list-matching-lines-face nil))) + nil list-matching-lines-face t))) (let* ((bufcount (length active-bufs)) (diff (- (length bufs) bufcount))) (message "Searched %d buffer%s%s; %s match%s for `%s'" @@ -1004,7 +1003,11 @@ (append `(occur-match t) (when match-face - `(font-lock-face ,match-face))) + ;; Use `face' rather than + ;; `font-lock-face' here + ;; so as to override faces + ;; copied from the buffer. + `(face ,match-face))) curstring) (setq start (match-end 0)))) ;; Generate the string to insert for this match