Skip to content

Instantly share code, notes, and snippets.

@jorgenschaefer
Created October 25, 2013 10:00
Show Gist options
  • Save jorgenschaefer/7152351 to your computer and use it in GitHub Desktop.
Save jorgenschaefer/7152351 to your computer and use it in GitHub Desktop.
(defun elisp-check ()
"Check the current buffer for possible elisp problems.
This actually byte compiles the buffer, but throws away the
result and keeps only the warnings."
(interactive)
(let ((lisp (buffer-substring-no-properties (point-min)
(point-max))))
(with-temp-buffer
(setq buffer-file-coding-system nil)
(set-buffer-multibyte t)
(insert lisp)
(let ((byte-compile-log-buffer (format "*Check for %s*"
(buffer-name)))
(byte-compile-verbose nil))
(byte-compile-from-buffer (current-buffer))))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment