Ryan Bowman wrote:
> Please suggest improvements.

Only add your auto-compile function to after-save-hook locally in
emacs-lisp-mode buffers, and only those buffers that are actually
visiting files.  Don't bother with message, since Emacs already
generates "Compiling /path/to/file.el...done" and "Wrote
/path/to/file.elc" messages.

(defun byte-compile-visited-file ()
  (let ((byte-compile-verbose t))
    (byte-compile-file buffer-file-name)))

(add-hook 'emacs-lisp-mode-hook
          (lambda ()
            (when buffer-file-name
              (add-hook (make-local-hook 'after-save-hook)
                        'byte-compile-visited-file
                        nil t))))

--
Kevin Rodgers



_______________________________________________
Help-gnu-emacs mailing list
Help-gnu-emacs@gnu.org
http://lists.gnu.org/mailman/listinfo/help-gnu-emacs

Reply via email to