aboutsummaryrefslogtreecommitdiffstats
path: root/lisp
diff options
context:
space:
mode:
authorStefan Monnier2009-09-15 04:03:35 +0000
committerStefan Monnier2009-09-15 04:03:35 +0000
commit49fec531419726f3fd297f35ec1039bd1f7f0eda (patch)
tree2249bee0223c7317879c81aec4cf5066e18cf119 /lisp
parent0e328d3779d1b51ed3b7316f56735640d726980d (diff)
downloademacs-49fec531419726f3fd297f35ec1039bd1f7f0eda.tar.gz
emacs-49fec531419726f3fd297f35ec1039bd1f7f0eda.zip
(byte-compile-refresh-preloaded): New function.
Diffstat (limited to 'lisp')
-rw-r--r--lisp/ChangeLog2
-rw-r--r--lisp/emacs-lisp/bytecomp.el23
2 files changed, 24 insertions, 1 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index df7f76399fd..595f88462bf 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,5 +1,7 @@
12009-09-15 Stefan Monnier <monnier@iro.umontreal.ca> 12009-09-15 Stefan Monnier <monnier@iro.umontreal.ca>
2 2
3 * emacs-lisp/bytecomp.el (byte-compile-refresh-preloaded): New function.
4
3 * loadup.el: Use after-load-functions to GC after loading each file. 5 * loadup.el: Use after-load-functions to GC after loading each file.
4 Remove the explicit GC calls that used to be sprinkled around. 6 Remove the explicit GC calls that used to be sprinkled around.
5 7
diff --git a/lisp/emacs-lisp/bytecomp.el b/lisp/emacs-lisp/bytecomp.el
index 60341974c5d..12052f7b4c6 100644
--- a/lisp/emacs-lisp/bytecomp.el
+++ b/lisp/emacs-lisp/bytecomp.el
@@ -4103,7 +4103,8 @@ that suppresses all warnings during execution of BODY."
4103 (byte-compile-form (cons 'progn (cdr form))))) 4103 (byte-compile-form (cons 'progn (cdr form)))))
4104 4104
4105;; Warn about misuses of make-variable-buffer-local. 4105;; Warn about misuses of make-variable-buffer-local.
4106(byte-defop-compiler-1 make-variable-buffer-local byte-compile-make-variable-buffer-local) 4106(byte-defop-compiler-1 make-variable-buffer-local
4107 byte-compile-make-variable-buffer-local)
4107(defun byte-compile-make-variable-buffer-local (form) 4108(defun byte-compile-make-variable-buffer-local (form)
4108 (if (and (eq (car-safe (car-safe (cdr-safe form))) 'quote) 4109 (if (and (eq (car-safe (car-safe (cdr-safe form))) 'quote)
4109 (byte-compile-warning-enabled-p 'make-local)) 4110 (byte-compile-warning-enabled-p 'make-local))
@@ -4394,6 +4395,26 @@ already up-to-date."
4394 nil)))) 4395 nil))))
4395 4396
4396;;;###autoload 4397;;;###autoload
4398(defun byte-compile-refresh-preloaded ()
4399 "Reload any Lisp file that was changed since Emacs was dumped.
4400Use with caution."
4401 (let* ((argv0 (car command-line-args))
4402 (emacs-file (executable-find argv0)))
4403 (if (not (and emacs-file (file-executable-p emacs-file)))
4404 (message "Can't find %s to refresh preloaded Lisp files" argv0)
4405 (dolist (f (reverse load-history))
4406 (setq f (car f))
4407 (if (string-match "elc\\'" f) (setq f (substring f 0 -1)))
4408 (when (and (file-readable-p f)
4409 (file-newer-than-file-p f emacs-file))
4410 (message "Reloading stale %s" (file-name-nondirectory f))
4411 (condition-case nil
4412 (load f 'noerror nil 'nosuffix)
4413 ;; Probably shouldn't happen, but in case of an error, it seems
4414 ;; at least as useful to ignore it as it is to stop compilation.
4415 (error nil)))))))
4416
4417;;;###autoload
4397(defun batch-byte-recompile-directory (&optional arg) 4418(defun batch-byte-recompile-directory (&optional arg)
4398 "Run `byte-recompile-directory' on the dirs remaining on the command line. 4419 "Run `byte-recompile-directory' on the dirs remaining on the command line.
4399Must be used only with `-batch', and kills Emacs on completion. 4420Must be used only with `-batch', and kills Emacs on completion.