aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJuri Linkov2013-12-20 02:07:08 +0200
committerJuri Linkov2013-12-20 02:07:08 +0200
commit501158bcb9b5fb14e181aad75a9bb612a2cacff5 (patch)
treebb843470e743fae203b41bb5e22f044b72a271d5
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
-rw-r--r--lisp/ChangeLog9
-rw-r--r--lisp/hi-lock.el6
-rw-r--r--lisp/replace.el25
3 files changed, 23 insertions, 17 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 2818f89c784..d91dd13dd28 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,12 @@
12013-12-20 Juri Linkov <juri@jurta.org>
2
3 * replace.el (occur-engine): Use `add-face-text-property'
4 to add the face property to matches and titles. (Bug#14645)
5
6 * hi-lock.el (hi-green): Use lighter color "light green" closer to
7 the palette of other hi-lock colors.
8 (hi-lock-set-pattern): Prepend hi-lock face to the existing face.
9
12013-12-19 Juri Linkov <juri@jurta.org> 102013-12-19 Juri Linkov <juri@jurta.org>
2 11
3 * isearch.el (isearch-mode-map): Bind `M-s e' to `isearch-edit-string'. 12 * isearch.el (isearch-mode-map): Bind `M-s e' to `isearch-edit-string'.
diff --git a/lisp/hi-lock.el b/lisp/hi-lock.el
index d0a82cd97b0..37ca83cba31 100644
--- a/lisp/hi-lock.el
+++ b/lisp/hi-lock.el
@@ -164,9 +164,9 @@ When non-nil, each hi-lock command will cycle through faces in
164 164
165(defface hi-green 165(defface hi-green
166 '((((min-colors 88) (background dark)) 166 '((((min-colors 88) (background dark))
167 (:background "green1" :foreground "black")) 167 (:background "light green" :foreground "black"))
168 (((background dark)) (:background "green" :foreground "black")) 168 (((background dark)) (:background "green" :foreground "black"))
169 (((min-colors 88)) (:background "green1")) 169 (((min-colors 88)) (:background "light green"))
170 (t (:background "green"))) 170 (t (:background "green")))
171 "Face for hi-lock mode." 171 "Face for hi-lock mode."
172 :group 'hi-lock-faces) 172 :group 'hi-lock-faces)
@@ -715,7 +715,7 @@ Otherwise, read face name from minibuffer with completion and history."
715 "Highlight REGEXP with face FACE." 715 "Highlight REGEXP with face FACE."
716 ;; Hashcons the regexp, so it can be passed to remove-overlays later. 716 ;; Hashcons the regexp, so it can be passed to remove-overlays later.
717 (setq regexp (hi-lock--hashcons regexp)) 717 (setq regexp (hi-lock--hashcons regexp))
718 (let ((pattern (list regexp (list 0 (list 'quote face) t)))) 718 (let ((pattern (list regexp (list 0 (list 'quote face) 'prepend))))
719 ;; Refuse to highlight a text that is already highlighted. 719 ;; Refuse to highlight a text that is already highlighted.
720 (unless (assoc regexp hi-lock-interactive-patterns) 720 (unless (assoc regexp hi-lock-interactive-patterns)
721 (push pattern hi-lock-interactive-patterns) 721 (push pattern hi-lock-interactive-patterns)
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