[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] /srv/bzr/emacs/trunk r107581: Load a package's generated a
From: |
Chong Yidong |
Subject: |
[Emacs-diffs] /srv/bzr/emacs/trunk r107581: Load a package's generated autoloads file before byte compiling it. |
Date: |
Mon, 12 Mar 2012 11:03:16 +0800 |
User-agent: |
Bazaar (2.3.1) |
------------------------------------------------------------
revno: 107581
fixes bug(s): http://debbugs.gnu.org/10970
committer: Chong Yidong <address@hidden>
branch nick: trunk
timestamp: Mon 2012-03-12 11:03:16 +0800
message:
Load a package's generated autoloads file before byte compiling it.
* lisp/emacs-lisp/package.el (package-unpack, package-unpack-single):
Load generated autoloads file before byte compiling.
(package--make-autoloads-and-compile): New helper fun.
modified:
lisp/ChangeLog
lisp/emacs-lisp/package.el
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog 2012-03-12 02:41:22 +0000
+++ b/lisp/ChangeLog 2012-03-12 03:03:16 +0000
@@ -1,3 +1,9 @@
+2012-03-12 Chong Yidong <address@hidden>
+
+ * emacs-lisp/package.el (package-unpack, package-unpack-single):
+ Load generated autoloads file before byte compiling (Bug#10970).
+ (package--make-autoloads-and-compile): New helper fun.
+
2012-03-12 Christopher Schmidt <address@hidden>
* ibuffer.el (ibuffer-redisplay): Remove another gratuitous error.
=== modified file 'lisp/emacs-lisp/package.el'
--- a/lisp/emacs-lisp/package.el 2012-03-04 09:45:01 +0000
+++ b/lisp/emacs-lisp/package.el 2012-03-12 03:03:16 +0000
@@ -607,16 +607,25 @@
(error "Package does not untar cleanly into directory %s/" dir))))
(tar-untar-buffer))
-(defun package-unpack (name version)
- (let* ((dirname (concat (symbol-name name) "-" version))
+(defun package-unpack (package version)
+ (let* ((name (symbol-name package))
+ (dirname (concat name "-" version))
(pkg-dir (expand-file-name dirname package-user-dir)))
(make-directory package-user-dir t)
;; FIXME: should we delete PKG-DIR if it exists?
(let* ((default-directory (file-name-as-directory package-user-dir)))
(package-untar-buffer dirname)
- (package-generate-autoloads (symbol-name name) pkg-dir)
- (let ((load-path (cons pkg-dir load-path)))
- (byte-recompile-directory pkg-dir 0 t)))))
+ (package--make-autoloads-and-compile name pkg-dir))))
+
+(defun package--make-autoloads-and-compile (name pkg-dir)
+ "Generate autoloads and do byte-compilation for package named NAME.
+PKG-DIR is the name of the package directory."
+ (package-generate-autoloads name pkg-dir)
+ (let ((load-path (cons pkg-dir load-path)))
+ ;; We must load the autoloads file before byte compiling, in
+ ;; case there are magic cookies to set up non-trivial paths.
+ (load (expand-file-name (concat name "-autoloads") pkg-dir) nil t)
+ (byte-recompile-directory pkg-dir 0 t)))
(defun package--write-file-no-coding (file-name)
(let ((buffer-file-coding-system 'no-conversion))
@@ -656,9 +665,7 @@
nil
pkg-file
nil nil nil 'excl))
- (package-generate-autoloads file-name pkg-dir)
- (let ((load-path (cons pkg-dir load-path)))
- (byte-recompile-directory pkg-dir 0 t)))))
+ (package--make-autoloads-and-compile file-name pkg-dir))))
(defmacro package--with-work-buffer (location file &rest body)
"Run BODY in a buffer containing the contents of FILE at LOCATION.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] /srv/bzr/emacs/trunk r107581: Load a package's generated autoloads file before byte compiling it.,
Chong Yidong <=