From mboxrd@z Thu Jan 1 00:00:00 1970 From: Achim Gratz Subject: bug#10125: RFE: require and load-path-shadowing Date: Sun, 13 Jan 2013 08:46:59 +0100 Message-ID: <87hamlbk3w.fsf@Rainer.invalid> References: <87sj68eogm.fsf@Rainer.invalid> <87wqvjd7qa.fsf@Rainer.invalid> <87bocvcx9f.fsf@Rainer.invalid> <83ip72u89o.fsf@gnu.org> <87ehhqn1md.fsf@Rainer.invalid> <8338y6txjh.fsf@gnu.org> <71vcb22qgz.fsf__38024.2966501557$1358016217$gmane$org@fencepost.gnu.org> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([208.118.235.92]:40470) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TuIIK-0006qV-5G for emacs-orgmode@gnu.org; Sun, 13 Jan 2013 02:47:56 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TuIID-0007X0-Nk for emacs-orgmode@gnu.org; Sun, 13 Jan 2013 02:47:51 -0500 In-Reply-To: <81pqgh90sp.fsf@gmail.com> Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-Message-ID: List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: 10125@debbugs.gnu.org Glenn Morris writes: > http://debbugs.gnu.org/cgi/bugreport.cgi?bug=10125#50 > > Turns out I was looking for invocation-directory and invocation-name. Indeed, thanks. So using your earlier patch as a template, this should be good for emacs-24: --8<---------------cut here---------------start------------->8--- diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el index 6059f03..df194b8 100644 --- a/lisp/emacs-lisp/package.el +++ b/lisp/emacs-lisp/package.el @@ -632,11 +632,20 @@ untar into a directory named DIR; otherwise, signal an error." "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))) + (with-current-buffer (get-buffer-create "*package-compile*") + (goto-char (point-max)) + (pop-to-buffer (current-buffer)) + (or (zerop (call-process + (concat invocation-directory invocation-name) + nil t t "--batch" "-Q" "--eval" + (format + "(let ((pkg-dir \"%s\")(name \"%s\")) + (progn (setq load-path (cons pkg-dir load-path)) + (load (expand-file-name (concat name \"-autoloads\") pkg-dir) nil t) + (batch-byte-recompile-directory 0)))" + pkg-dir name) + pkg-dir)) + (error "Compiling the package gave an error")))) (defun package--write-file-no-coding (file-name) (let ((buffer-file-coding-system 'no-conversion)) --8<---------------cut here---------------end--------------->8--- I've confirmed that Emacs 24.2 fails to install current Org from ELPA without that patch when trying to install after having opened an Org file. It installs Org correctly in that same situation with the patch that does the package compilation in an external Emacs process. Regards Achim. -- +<[Q+ Matrix-12 WAVE#46+305 Neuron microQkb Andromeda XTk Blofeld]>+ Factory and User Sound Singles for Waldorf rackAttack: http://Synth.Stromeko.net/Downloads.html#WaldorfSounds