aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/replace.el
diff options
context:
space:
mode:
authorJuri Linkov2013-12-20 02:07:08 +0200
committerJuri Linkov2013-12-20 02:07:08 +0200
commit501158bcb9b5fb14e181aad75a9bb612a2cacff5 (patch)
treebb843470e743fae203b41bb5e22f044b72a271d5 /lisp/replace.el
parent50ab1da6d67215219c4a26a045edcad28fa0b096 (diff)
downloademacs-501158bcb9b5fb14e181aad75a9bb612a2cacff5.tar.gz
emacs-501158bcb9b5fb14e181aad75a9bb612a2cacff5.zip
* lisp/replace.el (occur-engine): Use `add-face-text-property'
to add the face property to matches and titles. * lisp/hi-lock.el (hi-green): Use lighter color "light green" closer to the palette of other hi-lock colors. (hi-lock-set-pattern): Prepend hi-lock face to the existing face. Fixes: debbugs:14645
Diffstat (limited to 'lisp/replace.el')
-rw-r--r--lisp/replace.el25
1 files changed, 11 insertions, 14 deletions
diff --git a/lisp/replace.el b/lisp/replace.el
index fea8941363d..42f7f3c900a 100644
--- a/lisp/replace.el
+++ b/lisp/replace.el
@@ -1471,13 +1471,12 @@ See also `multi-occur'."
1471 (setq matches (1+ matches)) 1471 (setq matches (1+ matches))
1472 (add-text-properties 1472 (add-text-properties
1473 (match-beginning 0) (match-end 0) 1473 (match-beginning 0) (match-end 0)
1474 (append 1474 '(occur-match t) curstring)
1475 `(occur-match t) 1475 (when match-face
1476 (when match-face 1476 ;; Add `match-face' to faces copied from the buffer.
1477 ;; Use `face' rather than `font-lock-face' here 1477 (add-face-text-property
1478 ;; so as to override faces copied from the buffer. 1478 (match-beginning 0) (match-end 0)
1479 `(face ,match-face))) 1479 match-face nil curstring))
1480 curstring)
1481 ;; Avoid infloop (Bug#7593). 1480 ;; Avoid infloop (Bug#7593).
1482 (let ((end (match-end 0))) 1481 (let ((end (match-end 0)))
1483 (setq start (if (= start end) (1+ start) end))))) 1482 (setq start (if (= start end) (1+ start) end)))))
@@ -1572,11 +1571,9 @@ See also `multi-occur'."
1572 (buffer-name buf)) 1571 (buffer-name buf))
1573 'read-only t)) 1572 'read-only t))
1574 (setq end (point)) 1573 (setq end (point))
1575 (add-text-properties beg end 1574 (add-text-properties beg end `(occur-title ,buf))
1576 (append 1575 (when title-face
1577 (when title-face 1576 (add-face-text-property beg end title-face)))
1578 `(font-lock-face ,title-face))
1579 `(occur-title ,buf))))
1580 (goto-char (point-min))))))) 1577 (goto-char (point-min)))))))
1581 ;; Display total match count and regexp for multi-buffer. 1578 ;; Display total match count and regexp for multi-buffer.
1582 (when (and (not (zerop global-lines)) (> (length buffers) 1)) 1579 (when (and (not (zerop global-lines)) (> (length buffers) 1))
@@ -1592,8 +1589,8 @@ See also `multi-occur'."
1592 global-lines (if (= global-lines 1) "" "s"))) 1589 global-lines (if (= global-lines 1) "" "s")))
1593 (query-replace-descr regexp))) 1590 (query-replace-descr regexp)))
1594 (setq end (point)) 1591 (setq end (point))
1595 (add-text-properties beg end (when title-face 1592 (when title-face
1596 `(font-lock-face ,title-face)))) 1593 (add-face-text-property beg end title-face)))
1597 (goto-char (point-min))) 1594 (goto-char (point-min)))
1598 (if coding 1595 (if coding
1599 ;; CODING is buffer-file-coding-system of the first buffer 1596 ;; CODING is buffer-file-coding-system of the first buffer