[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] emacs/lisp ChangeLog emacs-lisp/bytecomp.el
From: |
Stefan Monnier |
Subject: |
[Emacs-diffs] emacs/lisp ChangeLog emacs-lisp/bytecomp.el |
Date: |
Tue, 15 Sep 2009 04:03:39 +0000 |
CVSROOT: /sources/emacs
Module name: emacs
Changes by: Stefan Monnier <monnier> 09/09/15 04:03:39
Modified files:
lisp : ChangeLog
lisp/emacs-lisp: bytecomp.el
Log message:
(byte-compile-refresh-preloaded): New function.
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/emacs/lisp/ChangeLog?cvsroot=emacs&r1=1.16173&r2=1.16174
http://cvs.savannah.gnu.org/viewcvs/emacs/lisp/emacs-lisp/bytecomp.el?cvsroot=emacs&r1=2.259&r2=2.260
Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/emacs/emacs/lisp/ChangeLog,v
retrieving revision 1.16173
retrieving revision 1.16174
diff -u -b -r1.16173 -r1.16174
--- ChangeLog 15 Sep 2009 03:46:05 -0000 1.16173
+++ ChangeLog 15 Sep 2009 04:03:35 -0000 1.16174
@@ -1,5 +1,7 @@
2009-09-15 Stefan Monnier <address@hidden>
+ * emacs-lisp/bytecomp.el (byte-compile-refresh-preloaded): New function.
+
* loadup.el: Use after-load-functions to GC after loading each file.
Remove the explicit GC calls that used to be sprinkled around.
Index: emacs-lisp/bytecomp.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/emacs-lisp/bytecomp.el,v
retrieving revision 2.259
retrieving revision 2.260
diff -u -b -r2.259 -r2.260
--- emacs-lisp/bytecomp.el 15 Sep 2009 02:34:32 -0000 2.259
+++ emacs-lisp/bytecomp.el 15 Sep 2009 04:03:38 -0000 2.260
@@ -4103,7 +4103,8 @@
(byte-compile-form (cons 'progn (cdr form)))))
;; Warn about misuses of make-variable-buffer-local.
-(byte-defop-compiler-1 make-variable-buffer-local
byte-compile-make-variable-buffer-local)
+(byte-defop-compiler-1 make-variable-buffer-local
+ byte-compile-make-variable-buffer-local)
(defun byte-compile-make-variable-buffer-local (form)
(if (and (eq (car-safe (car-safe (cdr-safe form))) 'quote)
(byte-compile-warning-enabled-p 'make-local))
@@ -4394,6 +4395,26 @@
nil))))
;;;###autoload
+(defun byte-compile-refresh-preloaded ()
+ "Reload any Lisp file that was changed since Emacs was dumped.
+Use with caution."
+ (let* ((argv0 (car command-line-args))
+ (emacs-file (executable-find argv0)))
+ (if (not (and emacs-file (file-executable-p emacs-file)))
+ (message "Can't find %s to refresh preloaded Lisp files" argv0)
+ (dolist (f (reverse load-history))
+ (setq f (car f))
+ (if (string-match "elc\\'" f) (setq f (substring f 0 -1)))
+ (when (and (file-readable-p f)
+ (file-newer-than-file-p f emacs-file))
+ (message "Reloading stale %s" (file-name-nondirectory f))
+ (condition-case nil
+ (load f 'noerror nil 'nosuffix)
+ ;; Probably shouldn't happen, but in case of an error, it seems
+ ;; at least as useful to ignore it as it is to stop compilation.
+ (error nil)))))))
+
+;;;###autoload
(defun batch-byte-recompile-directory (&optional arg)
"Run `byte-recompile-directory' on the dirs remaining on the command line.
Must be used only with `-batch', and kills Emacs on completion.