* lisp/replace.el (occur-engine): Use `add-face-text-property'
authorJuri Linkov <juri@jurta.org>
Fri, 20 Dec 2013 00:07:08 +0000 (02:07 +0200)
committerJuri Linkov <juri@jurta.org>
Fri, 20 Dec 2013 00:07:08 +0000 (02:07 +0200)
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

lisp/ChangeLog
lisp/hi-lock.el
lisp/replace.el

index 2818f89..d91dd13 100644 (file)
@@ -1,3 +1,12 @@
+2013-12-20  Juri Linkov  <juri@jurta.org>
+
+       * replace.el (occur-engine): Use `add-face-text-property'
+       to add the face property to matches and titles.  (Bug#14645)
+
+       * 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.
+
 2013-12-19  Juri Linkov  <juri@jurta.org>
 
        * isearch.el (isearch-mode-map): Bind `M-s e' to `isearch-edit-string'.
index d0a82cd..37ca83c 100644 (file)
@@ -164,9 +164,9 @@ When non-nil, each hi-lock command will cycle through faces in
 
 (defface hi-green
   '((((min-colors 88) (background dark))
-     (:background "green1" :foreground "black"))
+     (:background "light green" :foreground "black"))
     (((background dark)) (:background "green" :foreground "black"))
-    (((min-colors 88)) (:background "green1"))
+    (((min-colors 88)) (:background "light green"))
     (t (:background "green")))
   "Face for hi-lock mode."
   :group 'hi-lock-faces)
@@ -715,7 +715,7 @@ Otherwise, read face name from minibuffer with completion and history."
   "Highlight REGEXP with face FACE."
   ;; Hashcons the regexp, so it can be passed to remove-overlays later.
   (setq regexp (hi-lock--hashcons regexp))
-  (let ((pattern (list regexp (list 0 (list 'quote face) t))))
+  (let ((pattern (list regexp (list 0 (list 'quote face) 'prepend))))
     ;; Refuse to highlight a text that is already highlighted.
     (unless (assoc regexp hi-lock-interactive-patterns)
       (push pattern hi-lock-interactive-patterns)
index fea8941..42f7f3c 100644 (file)
@@ -1471,13 +1471,12 @@ See also `multi-occur'."
                        (setq matches (1+ matches))
                        (add-text-properties
                         (match-beginning 0) (match-end 0)
-                        (append
-                         `(occur-match t)
-                         (when match-face
-                           ;; Use `face' rather than `font-lock-face' here
-                           ;; so as to override faces copied from the buffer.
-                           `(face ,match-face)))
-                        curstring)
+                        '(occur-match t) curstring)
+                       (when match-face
+                         ;; Add `match-face' to faces copied from the buffer.
+                         (add-face-text-property
+                          (match-beginning 0) (match-end 0)
+                          match-face nil curstring))
                        ;; Avoid infloop (Bug#7593).
                        (let ((end (match-end 0)))
                          (setq start (if (= start end) (1+ start) end)))))
@@ -1572,11 +1571,9 @@ See also `multi-occur'."
                                   (buffer-name buf))
                           'read-only t))
                  (setq end (point))
-                 (add-text-properties beg end
-                                      (append
-                                       (when title-face
-                                         `(font-lock-face ,title-face))
-                                       `(occur-title ,buf))))
+                 (add-text-properties beg end `(occur-title ,buf))
+                 (when title-face
+                   (add-face-text-property beg end title-face)))
                (goto-char (point-min)))))))
       ;; Display total match count and regexp for multi-buffer.
       (when (and (not (zerop global-lines)) (> (length buffers) 1))
@@ -1592,8 +1589,8 @@ See also `multi-occur'."
                                         global-lines (if (= global-lines 1) "" "s")))
                          (query-replace-descr regexp)))
          (setq end (point))
-         (add-text-properties beg end (when title-face
-                                        `(font-lock-face ,title-face))))
+         (when title-face
+           (add-face-text-property beg end title-face)))
        (goto-char (point-min)))
       (if coding
          ;; CODING is buffer-file-coding-system of the first buffer