Bubble up flash-hline

master
Jacopo De Simoi 8 years ago
parent 3c7a195b46
commit 5b70f9aac3
  1. 31
      global.org

@ -401,6 +401,24 @@
(insert (format "%S" value))))
(global-set-key (kbd "C-c C-x C-e") 'replace-last-sexp)
#+END_SRC
* Specialties
** flash-hline
This function is defined to help in training with new keybindings. It
acts as a visual bell which flashes the current line. It is (arbitrarily)
bound to F15 which is supposed to be triggered by some illegal key hit
#+BEGIN_SRC emacs-lisp
(defun flash-hline ()
"Flash the current line to emph some mistake"
(interactive)
(let ((fg (face-foreground 'default))
(bg (face-background 'hl-line)))
(set-face-background 'hl-line fg)
(run-with-timer
0.1 nil (lambda ()
(set-face-background 'hl-line "#303030") ))))
(global-set-key (kbd "<f15>") 'flash-hline)
#+END_SRC
* Leftovers
#+BEGIN_SRC emacs-lisp
;; * include other files
@ -464,19 +482,6 @@
;; (eval-after-load 'tramp '(setenv "SHELL" "/bin/bash"))
(defun flash-hline ()
"Flash the current line to emph some mistake"
(interactive)
(let ((fg (face-foreground 'default))
(bg (face-background 'hl-line)))
(set-face-background 'hl-line fg)
(run-with-timer
0.1 nil (lambda ()
(set-face-background 'hl-line "#303030") ))))
(global-set-key (kbd "<f15>") 'flash-hline)
;;; Stefan Monnier <foo at acm.org>. It is the opposite of fill-paragraph
(defun unfill-paragraph (&optional region)
"Takes a multi-line paragraph and makes it into a single line of text."

Loading…
Cancel
Save