diff options
| author | Stephen Leake | 2015-08-15 12:14:27 -0500 |
|---|---|---|
| committer | Stephen Leake | 2015-08-15 12:18:46 -0500 |
| commit | b6d4bafa1de2aa3ae2bb8cba5825d4a6f248ed0a (patch) | |
| tree | c0d3e141036ce1a257917d66adbc6e70b8bbe298 | |
| parent | 692cf1013b8354f9f7a17ebb5e6e39b76ddce414 (diff) | |
| download | emacs-b6d4bafa1de2aa3ae2bb8cba5825d4a6f248ed0a.tar.gz emacs-b6d4bafa1de2aa3ae2bb8cba5825d4a6f248ed0a.zip | |
Handle pulse-background being nil
* lisp/cedet/pulse.el (pulse-lighten-highlight): Inherit
pulse-background, handle it being nil.
| -rw-r--r-- | lisp/cedet/pulse.el | 41 |
1 files changed, 22 insertions, 19 deletions
diff --git a/lisp/cedet/pulse.el b/lisp/cedet/pulse.el index 39ba13c33df..dea73a06e2a 100644 --- a/lisp/cedet/pulse.el +++ b/lisp/cedet/pulse.el | |||
| @@ -131,25 +131,28 @@ Return t if there is more drift to do, nil if completed." | |||
| 131 | (if (>= (get 'pulse-highlight-face :iteration) pulse-iterations) | 131 | (if (>= (get 'pulse-highlight-face :iteration) pulse-iterations) |
| 132 | nil | 132 | nil |
| 133 | (let* ((frame (color-values (face-background 'default))) | 133 | (let* ((frame (color-values (face-background 'default))) |
| 134 | (start (color-values (face-background | 134 | (pulse-background (face-background |
| 135 | (get 'pulse-highlight-face | 135 | (get 'pulse-highlight-face |
| 136 | :startface) | 136 | :startface) |
| 137 | nil t))) | 137 | nil t)));; can be nil |
| 138 | (frac (list (/ (- (nth 0 frame) (nth 0 start)) pulse-iterations) | 138 | (when pulse-background |
| 139 | (/ (- (nth 1 frame) (nth 1 start)) pulse-iterations) | 139 | (let* ((start (color-values pulse-background)) |
| 140 | (/ (- (nth 2 frame) (nth 2 start)) pulse-iterations))) | 140 | (frac (list (/ (- (nth 0 frame) (nth 0 start)) pulse-iterations) |
| 141 | (it (get 'pulse-highlight-face :iteration)) | 141 | (/ (- (nth 1 frame) (nth 1 start)) pulse-iterations) |
| 142 | ) | 142 | (/ (- (nth 2 frame) (nth 2 start)) pulse-iterations))) |
| 143 | (set-face-background 'pulse-highlight-face | 143 | (it (get 'pulse-highlight-face :iteration)) |
| 144 | (pulse-color-values-to-hex | 144 | ) |
| 145 | (list | 145 | (set-face-background 'pulse-highlight-face |
| 146 | (+ (nth 0 start) (* (nth 0 frac) it)) | 146 | (pulse-color-values-to-hex |
| 147 | (+ (nth 1 start) (* (nth 1 frac) it)) | 147 | (list |
| 148 | (+ (nth 2 start) (* (nth 2 frac) it))))) | 148 | (+ (nth 0 start) (* (nth 0 frac) it)) |
| 149 | (put 'pulse-highlight-face :iteration (1+ it)) | 149 | (+ (nth 1 start) (* (nth 1 frac) it)) |
| 150 | (if (>= (1+ it) pulse-iterations) | 150 | (+ (nth 2 start) (* (nth 2 frac) it))))) |
| 151 | nil | 151 | (put 'pulse-highlight-face :iteration (1+ it)) |
| 152 | t)))) | 152 | (if (>= (1+ it) pulse-iterations) |
| 153 | nil | ||
| 154 | t))) | ||
| 155 | ))) | ||
| 153 | 156 | ||
| 154 | (defun pulse-reset-face (&optional face) | 157 | (defun pulse-reset-face (&optional face) |
| 155 | "Reset the pulse highlighting FACE." | 158 | "Reset the pulse highlighting FACE." |