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

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

Re: Updating Elisp files while Emacs is running


From: Bob Proulx
Subject: Re: Updating Elisp files while Emacs is running
Date: Mon, 14 Mar 2016 13:58:43 -0600
User-agent: Mutt/1.5.24 (2015-08-30)

Philipp Stephani wrote:
> Phillip Lord schrieb:
> > I am not sure I see the issue. When updates to the core occur, then the
> > version number changes, so new files will not overwrite existing ones,
> > nor will the load-path be changed.
> 
> That is exactly the problem. Either the version number shouldn't change, or
> the load-path needs to be updated. The old files are gone, they can't be
> accessed any more after the upgrade.

A little more detail here would help.  I am guessing that it wasn't a
packaged emacs upgrade that has caused you problems but instead you
removed a version of emacs while that version of emacs was still
running and that removal caused your problem.

Multiple versions may be installed side by side without issues.
Upgrades can install newer versions but will not remove older
versions.  That way programs that are still running will continue to
access the associated files for that specific version.

> > If you want an existing Emacs to move to the new packages, that would be
> > hard to get right; only a restart is going to make sense here.
> >
> > Why is that a problem?
> 
> Because Emacs expects the old files to be there, but they have been
> removed. Sorry for being unclear: the old files get removed during the
> upgrade.

An package upgrade will not remove previous versions.  However if you
also told it to remove as well then that removal might be explicitly done.

  $ apt-cache show emacs | grep Depends:
  Depends: emacs24 | emacs24-lucid | emacs24-nox

Previously:

  Depends: emacs23 | emacs23-lucid | emacs23-nox

In Debian an 'upgrade' of the system will not be able to upgrade from
one packaged version of emacs to the next because doing so requires
adding the new package version and 'upgrade' does not allow any
changes to the installed package list, just upgrades of what is
already installed.  I always perform an 'upgrade' before running
'dist-upgrade'.  A 'dist-upgrade' is required to allow the
installation or removal of different packages.  On a dist-upgrade the
emacs package is upgraded with the new Depends: which pulls in the new
version of emacs$VERSION.  The previous emacs$OLDVERSION is left
behind on the system.  Running emacs processes will continue to use
the old files.  Any new invocations will launch the new version.

Now here is what I think may have happened.  If subsequently an
'apt-get autoremove' (I always use 'apt-get autoremove --purge' along
with version control of /etc using the 'etckeeper' package) then if
nothing else Depends: upon 'emacs$OLDVERSION' and it was marked as
automatically installed as a dependency then it will be removed
because nothing else installed depends upon it.  (If you manually
'apt-get install emacs23' then that package will be marked as manually
installed and will never be a candidate for autoremoval.)  Using
autoremove after a dist-upgrade is a good way to clean lint from your
system.  Otherwise old versions of packages pile up and you find you
have emacs versions 23, 22, 21, and so forth still hanging around on
your system.  I used to be there before I started routinely using
autoremove.

As a shortcut on newer apt-get versions you can use the option
'apt-get install --auto-remove' to combine these operations all at one
time.  If this is done then the old package will be removed at the
same time.  The old package will be listed in the review list asking
for confirmation before performing the action.  The expectation is
that when reviewing the list of packages for removal you will see that
it is removing something that you are still using and choose not to
remove it.  If something is listed as a candidate for autoremoval
simply mark it as manually installed.  'apt-get install emacs23' is
sufficient.  There is also the 'apt-mark' command to list and
explicitly manage this.  Then repeate the autoremove again, see that
the packages you don't want removed are no longer listed as
candidates, and confirm the removal of the now shorter list.

Did I get close? :-)

Bob

P.S. I know the current upstream emacs version is 25.  But I am
showing things as they are packaged today.  Which is why I tried to
make it somewhat generic with emacs$VERSION and emacs$OLDVERSION.



reply via email to

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