legacy-dotfiles/emacs.d/00-functions.el

21 lines
750 B
EmacsLisp

(defun what-face (pos)
"Find out which face the current position uses"
(interactive "d")
(let ((face (or (get-char-property (point) 'read-face-name)
(get-char-property (point) 'face))))
(if face
(message "Face: %s" face)
(message "No face at %d" pos))))
(defun my-comp-finish-function (buf str)
"Don't show compilation window if everything went ok"
(if (string-match "exited abnormally" str)
;; there were errors
(message "compilation errors, press C-x ` to visit")
;; no errors, make the compilation window go away in 0.5 seconds
(run-at-time 0.5 nil 'delete-windows-on buf)
(message "NO COMPILATION ERRORS!")))
(defun show-whitespace ()
(interactive)
(whitespace-mode t))