help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: byte-compiling .emacs


From: Kevin Rodgers
Subject: Re: byte-compiling .emacs
Date: Tue, 12 Apr 2005 15:45:29 -0600
User-agent: Mozilla Thunderbird 0.9 (X11/20041105)

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





reply via email to

[Prev in Thread] Current Thread [Next in Thread]