mirror of
https://git.savannah.gnu.org/git/emacs.git
synced 2025-01-29 19:48:19 +00:00
Handle pulse-background being nil
* lisp/cedet/pulse.el (pulse-lighten-highlight): Inherit pulse-background, handle it being nil.
This commit is contained in:
parent
692cf1013b
commit
b6d4bafa1d
@ -131,25 +131,28 @@ Return t if there is more drift to do, nil if completed."
|
|||||||
(if (>= (get 'pulse-highlight-face :iteration) pulse-iterations)
|
(if (>= (get 'pulse-highlight-face :iteration) pulse-iterations)
|
||||||
nil
|
nil
|
||||||
(let* ((frame (color-values (face-background 'default)))
|
(let* ((frame (color-values (face-background 'default)))
|
||||||
(start (color-values (face-background
|
(pulse-background (face-background
|
||||||
(get 'pulse-highlight-face
|
(get 'pulse-highlight-face
|
||||||
:startface)
|
:startface)
|
||||||
nil t)))
|
nil t)));; can be nil
|
||||||
(frac (list (/ (- (nth 0 frame) (nth 0 start)) pulse-iterations)
|
(when pulse-background
|
||||||
(/ (- (nth 1 frame) (nth 1 start)) pulse-iterations)
|
(let* ((start (color-values pulse-background))
|
||||||
(/ (- (nth 2 frame) (nth 2 start)) pulse-iterations)))
|
(frac (list (/ (- (nth 0 frame) (nth 0 start)) pulse-iterations)
|
||||||
(it (get 'pulse-highlight-face :iteration))
|
(/ (- (nth 1 frame) (nth 1 start)) pulse-iterations)
|
||||||
)
|
(/ (- (nth 2 frame) (nth 2 start)) pulse-iterations)))
|
||||||
(set-face-background 'pulse-highlight-face
|
(it (get 'pulse-highlight-face :iteration))
|
||||||
(pulse-color-values-to-hex
|
)
|
||||||
(list
|
(set-face-background 'pulse-highlight-face
|
||||||
(+ (nth 0 start) (* (nth 0 frac) it))
|
(pulse-color-values-to-hex
|
||||||
(+ (nth 1 start) (* (nth 1 frac) it))
|
(list
|
||||||
(+ (nth 2 start) (* (nth 2 frac) it)))))
|
(+ (nth 0 start) (* (nth 0 frac) it))
|
||||||
(put 'pulse-highlight-face :iteration (1+ it))
|
(+ (nth 1 start) (* (nth 1 frac) it))
|
||||||
(if (>= (1+ it) pulse-iterations)
|
(+ (nth 2 start) (* (nth 2 frac) it)))))
|
||||||
nil
|
(put 'pulse-highlight-face :iteration (1+ it))
|
||||||
t))))
|
(if (>= (1+ it) pulse-iterations)
|
||||||
|
nil
|
||||||
|
t)))
|
||||||
|
)))
|
||||||
|
|
||||||
(defun pulse-reset-face (&optional face)
|
(defun pulse-reset-face (&optional face)
|
||||||
"Reset the pulse highlighting FACE."
|
"Reset the pulse highlighting FACE."
|
||||||
|
Loading…
Reference in New Issue
Block a user