This prevents emacs-lisp-mode-hook from being run everytime an
autoload file is generated, which can account for a fraction of
package installation time depending on the hooks the user has
configured.
* lisp/emacs-lisp/bytecomp.el (byte-compile-file): Use delay-mode-hooks.
* lisp/emacs-lisp/autoload.el (autoload-find-file)
(autoload-find-generated-file): Use delay-mode-hooks.
(enable-local-eval nil))
;; We used to use `raw-text' to read this file, but this causes
;; problems when the file contains non-ASCII characters.
- (find-file-noselect
- (autoload-ensure-default-file (autoload-generated-file)))))
+ (let ((delay-mode-hooks t))
+ (find-file-noselect
+ (autoload-ensure-default-file (autoload-generated-file))))))
(defun autoload-generated-file ()
(expand-file-name generated-autoload-file
(erase-buffer)
(setq buffer-undo-list t
buffer-read-only nil)
- (emacs-lisp-mode)
+ (delay-mode-hooks (emacs-lisp-mode))
(setq default-directory (file-name-directory file))
(insert-file-contents file nil)
(let ((enable-local-variables :safe)
(progn
(setq-default major-mode 'emacs-lisp-mode)
;; Arg of t means don't alter enable-local-variables.
- (normal-mode t))
+ (delay-mode-hooks (normal-mode t)))
(setq-default major-mode dmm))
;; There may be a file local variable setting (bug#10419).
(setq buffer-read-only nil