all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: frederik@ofb.net
To: npostavs@users.sourceforge.net
Cc: 25819@debbugs.gnu.org
Subject: bug#25819: 25.1; Added by Package.el. Added by Package.el. Added by Package.el. Added by Package.el.
Date: Wed, 22 Feb 2017 22:23:51 -0800	[thread overview]
Message-ID: <20170223062351.GR1204@ofb.net> (raw)
In-Reply-To: <87zihdfxot.fsf@users.sourceforge.net>

Thank you!

On Wed, Feb 22, 2017 at 09:28:02PM -0500, npostavs@users.sourceforge.net wrote:
> forcemerge 25819 24643
> tags 25819 patch
> quit
> 
> frederik@ofb.net writes:
> 
> > On Wed, Feb 22, 2017 at 02:28:27PM -0500, Glenn Morris wrote:
> >> 
> >> I tested with:
> >> 
> >> /tmp/h1/.emacs:
> >>     (setenv "HOME" "/tmp/h2/")
> >>     (setq savehist-file "/tmp/h1/.emacs-history")
> >>     (load "~/.emacs")
> >>     (setenv "HOME" "/tmp/h1/")
> >> 
> >> /tmp/h2/.emacs:
> >>     (setq foo 99)
> >> 
> >> 
> >> HOME=/tmp/h1 emacs-25.1
> >> M-x package-initialize
> >
> > You don't think my problem is common!? :) Well I'm not sure how other
> > people edit files as root,
> 
> Probably with TRAMP: https://www.emacswiki.org/emacs/TrampMode#toc20
> 
> > Thank you (indeed) for taking the time to trim down my problem to a
> > minimal test case. If we make it a little less minimal:
> >
> > /tmp/h2/.emacs:
> >     (setq foo 99)
> >     (package-initialize)
> >
> > then I find it reproduces the problem:
> 
> AFAICT, this is essentially the problem described in #24643 and should be
> fixed by the suggestion there:
> 

> From aeae23ab082e948eca71ead3ea50a49a4fe73251 Mon Sep 17 00:00:00 2001
> From: Noam Postavsky <npostavs@gmail.com>
> Date: Wed, 22 Feb 2017 21:12:41 -0500
> Subject: [PATCH v1] Don't call package--ensure-init-file if initialized during
>  startup
> 
> * lisp/emacs-lisp/package.el (package-initialize): Check
> `after-init-time' rather than `load-file-name' to decide if
> `package--ensure-init-file' should be called.  Depending on
> `load-file-name' will fail if the user calls `pacakge-initialize' in
> file which is loaded from the init file (Bug#24643, Bug#25819).
> ---
>  lisp/emacs-lisp/package.el | 14 +++++++-------
>  1 file changed, 7 insertions(+), 7 deletions(-)
> 
> diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el
> index 0851c5e1fd..ee4bb750ab 100644
> --- a/lisp/emacs-lisp/package.el
> +++ b/lisp/emacs-lisp/package.el
> @@ -1445,13 +1445,13 @@ package-initialize
>  taken care of by `package-initialize'."
>    (interactive)
>    (setq package-alist nil)
> -  (if (equal user-init-file load-file-name)
> -      ;; If `package-initialize' is being called as part of loading
> -      ;; the init file, it's obvious we don't need to ensure-init.
> -      (setq package--init-file-ensured t
> -            ;; And likely we don't need to run it again after init.
> -            package-enable-at-startup nil)
> -    (package--ensure-init-file))
> +  (if after-init-time
> +      (package--ensure-init-file)
> +    ;; If `package-initialize' is before we finished loading the init
> +    ;; file, it's obvious we don't need to ensure-init.
> +    (setq package--init-file-ensured t
> +          ;; And likely we don't need to run it again after init.
> +          package-enable-at-startup nil))
>    (package-load-all-descriptors)
>    (package-read-all-archive-contents)
>    (unless no-activate
> -- 
> 2.11.1
> 






  reply	other threads:[~2017-02-23  6:23 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-20 20:14 bug#25819: 25.1; Added by Package.el. Added by Package.el. Added by Package.el. Added by Package.el frederik
2017-02-21 22:19 ` Glenn Morris
2017-02-21 23:04   ` frederik
2017-02-22 19:28     ` Glenn Morris
2017-02-22 20:48       ` frederik
2017-02-23  2:28         ` npostavs
2017-02-23  6:23           ` frederik [this message]
2017-02-26 16:18             ` npostavs
2017-02-23  2:47         ` Glenn Morris
2017-02-23  6:39           ` frederik

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170223062351.GR1204@ofb.net \
    --to=frederik@ofb.net \
    --cc=25819@debbugs.gnu.org \
    --cc=npostavs@users.sourceforge.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.