emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] master 943c45f: Don't pulse the indentation, or the newlin


From: Dmitry Gutov
Subject: [Emacs-diffs] master 943c45f: Don't pulse the indentation, or the newline
Date: Mon, 04 May 2015 20:25:02 +0000

branch: master
commit 943c45f68b7b954f311ec3c1c35ed21830223333
Author: Dmitry Gutov <address@hidden>
Commit: Dmitry Gutov <address@hidden>

    Don't pulse the indentation, or the newline
    
    * lisp/cedet/pulse.el (pulse-lighten-highlight)
    (pulse-reset-face): Fall back to the inherited background
    attribute in FACE.
    (pulse-momentary-highlight-region): Add autoload cookie.
    
    * lisp/progmodes/xref.el (xref--maybe-pulse): Don't highlight the
    indentation, or the newline, if the line's non-empty
    (http://lists.gnu.org/archive/html/emacs-devel/2015-05/msg00118.html).
---
 lisp/cedet/pulse.el    |    6 ++++--
 lisp/progmodes/xref.el |   10 +++++++++-
 2 files changed, 13 insertions(+), 3 deletions(-)

diff --git a/lisp/cedet/pulse.el b/lisp/cedet/pulse.el
index 59fd518..07882ef 100644
--- a/lisp/cedet/pulse.el
+++ b/lisp/cedet/pulse.el
@@ -133,7 +133,8 @@ Return t if there is more drift to do, nil if completed."
     (let* ((frame (color-values (face-background 'default)))
           (start (color-values (face-background
                                 (get 'pulse-highlight-face
-                                     :startface))))
+                                     :startface)
+                                 nil t)))
           (frac  (list (/ (- (nth 0 frame) (nth 0 start)) pulse-iterations)
                        (/ (- (nth 1 frame) (nth 1 start)) pulse-iterations)
                        (/ (- (nth 2 frame) (nth 2 start)) pulse-iterations)))
@@ -154,7 +155,7 @@ Return t if there is more drift to do, nil if completed."
   "Reset the pulse highlighting FACE."
   (set-face-background 'pulse-highlight-face
                       (if face
-                          (face-background face)
+                          (face-background face nil t)
                         (face-background 'pulse-highlight-start-face)
                         ))
   (put 'pulse-highlight-face :startface (or face
@@ -238,6 +239,7 @@ Optional argument FACE specifies the face to do the 
highlighting."
                  (point))))
       (pulse-momentary-highlight-region start end face))))
 
+;;;###autoload
 (defun pulse-momentary-highlight-region (start end &optional face)
   "Highlight between START and END, unhighlighting before next command.
 Optional argument FACE specifies the face to do the highlighting."
diff --git a/lisp/progmodes/xref.el b/lisp/progmodes/xref.el
index a73085f..ae0fbb8 100644
--- a/lisp/progmodes/xref.el
+++ b/lisp/progmodes/xref.el
@@ -313,7 +313,15 @@ or when the command has been called with the prefix 
argument."
 
 (defun xref--maybe-pulse ()
   (when xref-pulse-on-jump
-    (pulse-momentary-highlight-one-line (point))))
+    (let (beg end)
+      (save-excursion
+        (back-to-indentation)
+        (if (eolp)
+            (setq beg (line-beginning-position)
+                  end (1+ (point)))
+          (setq beg (point)
+                end (line-end-position))))
+      (pulse-momentary-highlight-region beg end 'next-error))))
 
 ;; etags.el needs this
 (defun xref-clear-marker-stack ()



reply via email to

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