all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#12161: 24.1.50; delete-selection mode vs ask-user-about-supersession-threat
@ 2012-08-08 22:49 Matthew Woodcraft
  2012-08-09  2:19 ` Stefan Monnier
  0 siblings, 1 reply; 2+ messages in thread
From: Matthew Woodcraft @ 2012-08-08 22:49 UTC (permalink / raw)
  To: 12161


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)





^ permalink raw reply	[flat|nested] 2+ messages in thread

* bug#12161: 24.1.50; delete-selection mode vs ask-user-about-supersession-threat
  2012-08-08 22:49 bug#12161: 24.1.50; delete-selection mode vs ask-user-about-supersession-threat Matthew Woodcraft
@ 2012-08-09  2:19 ` Stefan Monnier
  0 siblings, 0 replies; 2+ messages in thread
From: Stefan Monnier @ 2012-08-09  2:19 UTC (permalink / raw)
  To: Matthew Woodcraft; +Cc: 12161-done

> 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





^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2012-08-09  2:19 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-08-08 22:49 bug#12161: 24.1.50; delete-selection mode vs ask-user-about-supersession-threat Matthew Woodcraft
2012-08-09  2:19 ` Stefan Monnier

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.