GNU bug report logs - #12161
24.1.50; delete-selection mode vs ask-user-about-supersession-threat

Previous Next

Package: emacs;

Reported by: Matthew Woodcraft <matthew <at> woodcraft.me.uk>

Date: Wed, 8 Aug 2012 22:58:02 UTC

Severity: normal

Found in version 24.1.50

Done: Stefan Monnier <monnier <at> iro.umontreal.ca>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 12161 in the body.
You can then email your comments to 12161 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#12161; Package emacs. (Wed, 08 Aug 2012 22:58:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Matthew Woodcraft <matthew <at> woodcraft.me.uk>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Wed, 08 Aug 2012 22:58:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Matthew Woodcraft <matthew <at> woodcraft.me.uk>
To: bug-gnu-emacs <at> gnu.org
Subject: 24.1.50; delete-selection mode vs ask-user-about-supersession-threat
Date: Wed, 08 Aug 2012 23:49:16 +0100
The following code in delsel.el doesn't seem to be working any more:

	(file-supersession
	 ;; If ask-user-about-supersession-threat signals an error,
	 ;; stop safe_run_hooks from clearing out pre-command-hook.
	 (and (eq inhibit-quit 'pre-command-hook)
	      (setq inhibit-quit 'delete-selection-dummy))

I think it hasn't been adjusted for the changes in Emacs 24 which make
safe_run_hooks remove a single function from the hook, rather than
clearing out the hook altogether.

If I change the (eq inhibit-quit 'pre-command-hook) to
(equal inhibit-quit '(pre-command-hook . delete-selection-pre-hook))
then it works again for me.


Full recipe to reproduce:

echo 12345 > /tmp/testfile
emacs -Q /tmp/testfile
M-x delete-selection-mode
  (in another console: touch /tmp/testfile)
C-M-h
DEL
At the prompt 'testfile changed on disk; really edit the buffer?', enter 'n'
The prompt appears a second time; enter 'n' (or 'y')

Now Emacs thinks it is in delete-selection-mode, but the pre-command-hook has
mysteriously evaporated.

-----

In GNU Emacs 24.1.50.2 (i486-pc-linux-gnu, GTK+ Version 3.4.2)
 of 2012-08-08 on golux, modified by Debian
 (emacs-snapshot package, version 2:20120807-1mjw1)




Reply sent to Stefan Monnier <monnier <at> iro.umontreal.ca>:
You have taken responsibility. (Thu, 09 Aug 2012 02:28:02 GMT) Full text and rfc822 format available.

Notification sent to Matthew Woodcraft <matthew <at> woodcraft.me.uk>:
bug acknowledged by developer. (Thu, 09 Aug 2012 02:28:02 GMT) Full text and rfc822 format available.

Message #10 received at 12161-done <at> debbugs.gnu.org (full text, mbox):

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Matthew Woodcraft <matthew <at> woodcraft.me.uk>
Cc: 12161-done <at> debbugs.gnu.org
Subject: Re: bug#12161: 24.1.50;
	delete-selection mode vs ask-user-about-supersession-threat
Date: Wed, 08 Aug 2012 22:19:33 -0400
> The following code in delsel.el doesn't seem to be working any more:

> 	(file-supersession
> 	 ;; If ask-user-about-supersession-threat signals an error,
> 	 ;; stop safe_run_hooks from clearing out pre-command-hook.
> 	 (and (eq inhibit-quit 'pre-command-hook)
> 	      (setq inhibit-quit 'delete-selection-dummy))

Indeed, thanks.
I've simplified it so it doesn't need to know about how
safe_run_hook works.


        Stefan




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Thu, 06 Sep 2012 11:24:03 GMT) Full text and rfc822 format available.

This bug report was last modified 12 years and 289 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.