bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#25819: 25.1; Added by Package.el. Added by Package.el. Added by Pack


From: frederik
Subject: bug#25819: 25.1; Added by Package.el. Added by Package.el. Added by Package.el. Added by Package.el.
Date: Tue, 21 Feb 2017 15:04:22 -0800
User-agent: Mutt/1.7.2 (2016-11-26)

On Tue, Feb 21, 2017 at 05:19:14PM -0500, Glenn Morris wrote:
> frederik@ofb.net wrote:
> 
> > In my ~/.emacs file, I get repeating lines like this:
> [...]
> > (package-initialize)
> >
> > (package-initialize)
> >
> > (package-initialize)
> 
> The function package--ensure-init-file adds this line, but it takes care
> to only do so if it's not already there. So it's hard to see how you can
> end up with multiple copies. Can you find a reproducible sequence that
> causes an extra copy to be added; or can you edebug
> package--ensure-init-file to see why it adds multiple copies?
> 

Thanks for the reply. Well, you prompted me to find a reproducible
sequence. It turns out that the problem comes from when I start emacs
as "root". (This happens automatically in ~/.xinitrc, for better or
worse, where I create a screen session with an emacs running as root,
which starts a server so that I can edit files using emacsclient as
root) My /root/.emacs looks something like this:

    (setenv "HOME" "/home/frederik/")
    (setq savehist-file "/root/.emacs-history")
    (load "~/.emacs")
    (setenv "HOME" "/root/")

Obviously this does not contain a "(package-initialize)" line, so the
following test in package--ensure-init-file fails:

              ;; Don't visit the file if we don't have to.
              (with-temp-buffer
                (insert-file-contents user-init-file)
                (goto-char (point-min))
                (re-search-forward "(package-initialize\\_>" nil 'noerror))

(by the way what's with the unnecessary optimization in the lines
previous to these? ugh)

I wasn't able to figure out why the "(package-initialize)" lines then
get inserted in ~/.emacs rather than /root/.emacs, but I hope the
above clues provide a good enough place for someone else to start
debugging this.

Thank you!





reply via email to

[Prev in Thread] Current Thread [Next in Thread]