GNU bug report logs - #10125
24.0.91; package.el (org): Macros in tar packages & order of byte compilation

Previous Next

Package: emacs;

Reported by: Jambunathan K <kjambunathan <at> gmail.com>

Date: Thu, 24 Nov 2011 12:15:02 UTC

Severity: normal

Merged with 18443, 18448, 21267

Found in versions 24.0.91, 24.3.93, 25.0.50

Full log


Message #17 received at 10125 <at> debbugs.gnu.org (full text, mbox):

From: Glenn Morris <rgm <at> gnu.org>
To: Jambunathan K <kjambunathan <at> gmail.com>
Cc: stelian.iancu <at> gmail.com, 10125 <at> debbugs.gnu.org
Subject: Re: bug#10125: 24.0.91;
	package.el (org): Macros in tar packages & order of byte compilation
Date: Thu, 24 Nov 2011 14:53:04 -0500
Glenn Morris wrote:

> fresh Emacs instance. There's no reason the "package manager" could not
> spawn a separate Emacs in batch-mode as a sub-job to do the compilation.

Very lightly tested version:

*** lisp/emacs-lisp/package.el	2011-11-20 03:48:53 +0000
--- lisp/emacs-lisp/package.el	2011-11-24 19:48:49 +0000
***************
*** 595,600 ****
--- 595,612 ----
  	(error "Package does not untar cleanly into directory %s/" dir))))
    (tar-untar-buffer))
  
+ (defun package-compile (directory)
+   "Compile the Lisp files in DIRECTORY."
+   (with-current-buffer (get-buffer-create "*package-compile*")
+     (goto-char (point-max))
+     (pop-to-buffer (current-buffer))
+     (or (zerop (call-process "emacs" nil t t "--batch" "--eval"
+ 			     (format
+ 			      "(progn (setq load-path (cons \"%s\" load-path))
+                                 (batch-byte-recompile-directory 0))" directory)
+ 			     directory))
+ 	(error "Compiling the package gave an error"))))
+ 
  (defun package-unpack (name version)
    (let* ((dirname (concat (symbol-name name) "-" version))
  	 (pkg-dir (expand-file-name dirname package-user-dir)))
***************
*** 603,610 ****
      (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)))))
  
  (defun package--write-file-no-coding (file-name)
    (let ((buffer-file-coding-system 'no-conversion))
--- 615,621 ----
      (let* ((default-directory (file-name-as-directory package-user-dir)))
        (package-untar-buffer dirname)
        (package-generate-autoloads (symbol-name name) pkg-dir)
!       (package-compile pkg-dir))))
  
  (defun package--write-file-no-coding (file-name)
    (let ((buffer-file-coding-system 'no-conversion))
***************
*** 645,652 ****
  	 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)))))
  
  (defmacro package--with-work-buffer (location file &rest body)
    "Run BODY in a buffer containing the contents of FILE at LOCATION.
--- 656,662 ----
  	 pkg-file
  	 nil nil nil 'excl))
        (package-generate-autoloads file-name pkg-dir)
!       (package-compile pkg-dir))))
  
  (defmacro package--with-work-buffer (location file &rest body)
    "Run BODY in a buffer containing the contents of FILE at LOCATION.





This bug report was last modified 10 years and 38 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.