From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Bob Proulx Newsgroups: gmane.emacs.help Subject: Re: Updating Elisp files while Emacs is running Date: Mon, 14 Mar 2016 13:58:43 -0600 Message-ID: <20160314132631168832779@bob.proulx.com> References: <87k2l5w1xq.fsf@russet.org.uk> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1457985547 17903 80.91.229.3 (14 Mar 2016 19:59:07 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 14 Mar 2016 19:59:07 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon Mar 14 20:59:06 2016 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1afYdt-0002CH-7v for geh-help-gnu-emacs@m.gmane.org; Mon, 14 Mar 2016 20:59:05 +0100 Original-Received: from localhost ([::1]:43744 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1afYds-0005ox-R9 for geh-help-gnu-emacs@m.gmane.org; Mon, 14 Mar 2016 15:59:04 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:40491) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1afYdh-0005oN-8Z for help-gnu-emacs@gnu.org; Mon, 14 Mar 2016 15:58:54 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1afYdc-0005lY-7y for help-gnu-emacs@gnu.org; Mon, 14 Mar 2016 15:58:53 -0400 Original-Received: from havoc.proulx.com ([96.88.95.61]:39220) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1afYdc-0005kU-0I for help-gnu-emacs@gnu.org; Mon, 14 Mar 2016 15:58:48 -0400 Original-Received: from joseki.proulx.com (localhost [127.0.0.1]) by havoc.proulx.com (Postfix) with ESMTP id DF3D9CA for ; Mon, 14 Mar 2016 13:58:44 -0600 (MDT) Original-Received: from hysteria.proulx.com (hysteria.proulx.com [192.168.230.119]) by joseki.proulx.com (Postfix) with ESMTP id E03622184F for ; Mon, 14 Mar 2016 13:58:43 -0600 (MDT) Original-Received: by hysteria.proulx.com (Postfix, from userid 1000) id BEE7B2DC65; Mon, 14 Mar 2016 13:58:43 -0600 (MDT) Mail-Followup-To: help-gnu-emacs@gnu.org Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 96.88.95.61 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:109579 Archived-At: 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.