Subtle mode-line blink for ring-bell-function

This commit is contained in:
Henrik Lissner 2016-10-24 02:46:12 +02:00
parent c05bffa826
commit 3e4ec3e6d8
2 changed files with 9 additions and 1 deletions

View file

@ -58,6 +58,15 @@
(y-or-n-p " Quit?")
t)))
;; A subtle bell: flash the mode-line
;; TODO More flexible colors (only suits dark themes)
(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))))))
;; y/n instead of yes/no
(fset 'yes-or-no-p 'y-or-n-p)