summaryrefslogtreecommitdiff
path: root/lisp/replace.el
diff options
context:
space:
mode:
authorRichard M. Stallman <rms@gnu.org>2004-12-03 00:19:52 +0000
committerRichard M. Stallman <rms@gnu.org>2004-12-03 00:19:52 +0000
commit2f4e3f7ac52b6f82e9cd4593f1b9407fbcea7d39 (patch)
tree36de0febe0264a902cd4f3cbdb32e08385c7a584 /lisp/replace.el
parent9dda72d3ead797bf7ddd2fd6d6f70e206e80f588 (diff)
downloademacs-2f4e3f7ac52b6f82e9cd4593f1b9407fbcea7d39.tar.gz
(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.
Diffstat (limited to 'lisp/replace.el')
-rw-r--r--lisp/replace.el17
1 files changed, 10 insertions, 7 deletions
diff --git a/lisp/replace.el b/lisp/replace.el
index 24a6436b4c3..8a5c0a9680c 100644
--- a/lisp/replace.el
+++ b/lisp/replace.el
@@ -751,7 +751,6 @@ Compatibility function for \\[next-error] invocations."
;; 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 @@ If the value is nil, don't highlight the buffer names specially."
: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 @@ If the value is nil, don't highlight the buffer names specially."
(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 @@ See also `multi-occur'."
(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 @@ See also `multi-occur'."
(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