emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] trunk r115619: * lisp/replace.el (occur-engine): Use `add-


From: Juri Linkov
Subject: [Emacs-diffs] trunk r115619: * lisp/replace.el (occur-engine): Use `add-face-text-property'
Date: Fri, 20 Dec 2013 00:07:12 +0000
User-agent: Bazaar (2.6b2)

------------------------------------------------------------
revno: 115619
revision-id: address@hidden
parent: address@hidden
fixes bug: http://debbugs.gnu.org/14645
committer: Juri Linkov <address@hidden>
branch nick: trunk
timestamp: Fri 2013-12-20 02:07:08 +0200
message:
  * 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.
modified:
  lisp/ChangeLog                 changelog-20091113204419-o5vbwnq5f7feedwu-1432
  lisp/hi-lock.el                hilock.el-20091113204419-o5vbwnq5f7feedwu-1889
  lisp/replace.el                replace.el-20091113204419-o5vbwnq5f7feedwu-119
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2013-12-19 22:12:12 +0000
+++ b/lisp/ChangeLog    2013-12-20 00:07:08 +0000
@@ -1,3 +1,12 @@
+2013-12-20  Juri Linkov  <address@hidden>
+
+       * 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  <address@hidden>
 
        * isearch.el (isearch-mode-map): Bind `M-s e' to `isearch-edit-string'.

=== modified file 'lisp/hi-lock.el'
--- a/lisp/hi-lock.el   2013-06-03 08:51:50 +0000
+++ b/lisp/hi-lock.el   2013-12-20 00:07:08 +0000
@@ -164,9 +164,9 @@
 
 (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 @@
   "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)

=== modified file 'lisp/replace.el'
--- a/lisp/replace.el   2013-12-19 00:29:41 +0000
+++ b/lisp/replace.el   2013-12-20 00:07:08 +0000
@@ -1471,13 +1471,12 @@
                        (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 @@
                                   (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 @@
                                         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


reply via email to

[Prev in Thread] Current Thread [Next in Thread]