diff options
| author | Dmitry Gutov | 2015-05-04 23:16:12 +0300 |
|---|---|---|
| committer | Dmitry Gutov | 2015-05-04 23:24:36 +0300 |
| commit | 943c45f68b7b954f311ec3c1c35ed21830223333 (patch) | |
| tree | 0834c99f52bb736f519f2b11ef1dc34680490326 | |
| parent | 255a011f0ecf004b31c59945b10154b10fac3af1 (diff) | |
| download | emacs-943c45f68b7b954f311ec3c1c35ed21830223333.tar.gz emacs-943c45f68b7b954f311ec3c1c35ed21830223333.zip | |
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).
| -rw-r--r-- | lisp/cedet/pulse.el | 6 | ||||
| -rw-r--r-- | 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 59fd5188643..07882efd632 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." | |||
| 133 | (let* ((frame (color-values (face-background 'default))) | 133 | (let* ((frame (color-values (face-background 'default))) |
| 134 | (start (color-values (face-background | 134 | (start (color-values (face-background |
| 135 | (get 'pulse-highlight-face | 135 | (get 'pulse-highlight-face |
| 136 | :startface)))) | 136 | :startface) |
| 137 | nil t))) | ||
| 137 | (frac (list (/ (- (nth 0 frame) (nth 0 start)) pulse-iterations) | 138 | (frac (list (/ (- (nth 0 frame) (nth 0 start)) pulse-iterations) |
| 138 | (/ (- (nth 1 frame) (nth 1 start)) pulse-iterations) | 139 | (/ (- (nth 1 frame) (nth 1 start)) pulse-iterations) |
| 139 | (/ (- (nth 2 frame) (nth 2 start)) pulse-iterations))) | 140 | (/ (- (nth 2 frame) (nth 2 start)) pulse-iterations))) |
| @@ -154,7 +155,7 @@ Return t if there is more drift to do, nil if completed." | |||
| 154 | "Reset the pulse highlighting FACE." | 155 | "Reset the pulse highlighting FACE." |
| 155 | (set-face-background 'pulse-highlight-face | 156 | (set-face-background 'pulse-highlight-face |
| 156 | (if face | 157 | (if face |
| 157 | (face-background face) | 158 | (face-background face nil t) |
| 158 | (face-background 'pulse-highlight-start-face) | 159 | (face-background 'pulse-highlight-start-face) |
| 159 | )) | 160 | )) |
| 160 | (put 'pulse-highlight-face :startface (or face | 161 | (put 'pulse-highlight-face :startface (or face |
| @@ -238,6 +239,7 @@ Optional argument FACE specifies the face to do the highlighting." | |||
| 238 | (point)))) | 239 | (point)))) |
| 239 | (pulse-momentary-highlight-region start end face)))) | 240 | (pulse-momentary-highlight-region start end face)))) |
| 240 | 241 | ||
| 242 | ;;;###autoload | ||
| 241 | (defun pulse-momentary-highlight-region (start end &optional face) | 243 | (defun pulse-momentary-highlight-region (start end &optional face) |
| 242 | "Highlight between START and END, unhighlighting before next command. | 244 | "Highlight between START and END, unhighlighting before next command. |
| 243 | Optional argument FACE specifies the face to do the highlighting." | 245 | Optional argument FACE specifies the face to do the highlighting." |
diff --git a/lisp/progmodes/xref.el b/lisp/progmodes/xref.el index a73085f825d..ae0fbb82617 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." | |||
| 313 | 313 | ||
| 314 | (defun xref--maybe-pulse () | 314 | (defun xref--maybe-pulse () |
| 315 | (when xref-pulse-on-jump | 315 | (when xref-pulse-on-jump |
| 316 | (pulse-momentary-highlight-one-line (point)))) | 316 | (let (beg end) |
| 317 | (save-excursion | ||
| 318 | (back-to-indentation) | ||
| 319 | (if (eolp) | ||
| 320 | (setq beg (line-beginning-position) | ||
| 321 | end (1+ (point))) | ||
| 322 | (setq beg (point) | ||
| 323 | end (line-end-position)))) | ||
| 324 | (pulse-momentary-highlight-region beg end 'next-error)))) | ||
| 317 | 325 | ||
| 318 | ;; etags.el needs this | 326 | ;; etags.el needs this |
| 319 | (defun xref-clear-marker-stack () | 327 | (defun xref-clear-marker-stack () |