From 4ce273998341d9a5cda75e16c7c6c051caa5b1a6 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Fri, 4 Nov 2016 03:30:06 +0100 Subject: [PATCH] More reliable ring-bell-function mode-line blink --- core/core-ui.el | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/core/core-ui.el b/core/core-ui.el index 115ac947b..0cd1ef8a0 100644 --- a/core/core-ui.el +++ b/core/core-ui.el @@ -60,11 +60,16 @@ ;; A subtle bell: flash the mode-line ;; TODO More flexible colors (only suits dark themes) +(defvar doom--modeline-bg nil) + (setq ring-bell-function (lambda () - (let ((bg (face-attribute 'mode-line :background))) - (set-face-attribute 'mode-line nil :background "#54252c") - (run-with-timer 0.1 nil `(lambda () (set-face-attribute 'mode-line nil :background ,bg)))))) + (unless doom--modeline-bg + (setq doom--modeline-bg (face-attribute 'mode-line :background))) + (set-face-attribute 'mode-line nil :background "#54252C") + (run-with-timer + 0.1 nil + (lambda () (set-face-attribute 'mode-line nil :background doom--modeline-bg))))) ;; y/n instead of yes/no