Re: upgrading emacs when emacs is still running
On 2011-10-20 01:20 +0200, email@example.com wrote:
> Every time on Debian I use aptitude to
> The following packages will be upgraded:
> emacs-snapshot emacs-snapshot-bin-common (for emacs-snapshot)
> emacs-snapshot-common (for emacs-snapshot, emacs-snapshot-el)
> I have to remember to exit any running emacs sessions first, lest
> later encountering problems when old emacs reads new .elcs, etc.
> Updating Firefox never has such problems.
> OK, hard to work around, also too much fuss to put warnings into the
> Debian update script: "a running emacs session was detected, proceed?"
FWIW, there used to be one, but it was removed in the 20080613 snapshot:
$ git show 241c879e25
Author: Romain Francoise <firstname.lastname@example.org>
Date: Fri Jun 13 19:24:40 2008 +0200
Drop check for running emacsen in preinst
lsof hangs if the system has unreachable NFS mounts, which happens more
often than one may think. As this prevents installation of the package,
a rather grave bug, let's drop the check instead of trying to tune
diff --git a/emacs.preinst b/emacs.preinst
old mode 100644
new mode 100755
@@ -8,21 +8,6 @@ if [ "$1" = "upgrade" ] && \
update-alternatives --remove emacs /usr/bin/@BIN_NAME@-@X_SUPPORT@
-# If lsof is installed, look for running Emacsen. If any are found,
-# warn the user that changing Emacs's files from under it isn't safe...
-# We don't bother trying to find processes if lsof isn't installed;
-# using pgrep or something similar would turn up false positives.
-if [ -f $F ] && [ -x /usr/bin/lsof ]; then
- PIDS=`lsof -F p $F 2>/dev/null | wc -l || true`
- if [ $PIDS -ne 0 ]; then
- [ $PIDS -ge 2 ] && S="es"
- printf "%d %s process%s found\n" $PIDS `basename $F` "$S"
- echo "NOTE: closing all running Emacsen before upgrading" \
- "is strongly recommended!"