GNU bug report logs - #40357
26.3; delete-selection-mode stops working in some C-g cancellation cases

Previous Next

Package: emacs;

Reported by: Raoul Gough <RaoulGough <at> yahoo.co.uk>

Date: Tue, 31 Mar 2020 20:40:01 UTC

Severity: normal

Tags: fixed

Found in version 26.3

Fixed in version 28.1

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

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 40357 in the body.
You can then email your comments to 40357 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#40357; Package emacs. (Tue, 31 Mar 2020 20:40:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Raoul Gough <RaoulGough <at> yahoo.co.uk>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Tue, 31 Mar 2020 20:40:02 GMT) Full text and rfc822 format available.

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

From: Raoul Gough <RaoulGough <at> yahoo.co.uk>
To: bug-gnu-emacs <at> gnu.org
Cc: RaoulGough <at> yahoo.co.uk
Subject: 26.3; delete-selection-mode stops working in some C-g cancellation
 cases
Date: Tue, 31 Mar 2020 21:38:46 +0100
While in pending-delete-mode, user cancellation via C-g in some
circumstances can cause Emacs to remove the delete-selection-pre-hook
from pre-command-hook, meaning that pending-delete-mode is still enabled
but stops working. Example situation:

The current buffer is changed on disk
The selection is active
User types or yanks something, triggering deletion of the selection
This pops up a message <file> changed on disk; really edit the buffer?
Hitting C-g at this point causes the problem

Example to reproduce from a freshly started Emacs:

M-x delete-selection-mode
Create a new file, e.g. /tmp/foo
Add some text to the file and save it
Update the file externally, e.g. via C-M-! echo bar >>/tmp/foo RET
Select text in the buffer and type a letter (triggering delete selection)
When prompted with "really edit the buffer?" hit C-g twice

After the repro above, delete-selection-mode is active but does
nothing. Examination of pre-command-hook shows that the
delete-selection-pre-hook hook was removed.

There are some comments in delete-selection-helper which suggests this
is kind-of a known problem but the workaround there only works for
read-only text, not for modified-on-disk files.



In GNU Emacs 26.3 (build 1, x86_64-apple-darwin14.5.0, NS appkit-1348.17 
Version 10.10.5 (Build 14F2511))
 of 2019-09-02 built on builder10-10.porkrind.org
Windowing system distributor 'Apple', version 10.3.1504
Recent messages:
For information about GNU Emacs and the GNU system, type C-h C-a.
Delete-Selection mode enabled
Saving file /tmp/foo...
Wrote /tmp/foo
(Shell command succeeded with no output)
Mark set
Error in pre-command-hook (delete-selection-pre-hook): (quit)
Quit

Configured using:
 'configure --with-ns '--enable-locallisppath=/Library/Application
 Support/Emacs/${version}/site-lisp:/Library/Application
 Support/Emacs/site-lisp' --with-modules'

Configured features:
NOTIFY ACL GNUTLS LIBXML2 ZLIB TOOLKIT_SCROLL_BARS NS MODULES THREADS

Important settings:
  value of $LANG: en_GB.UTF-8
  locale-coding-system: utf-8-unix

Major mode: Lisp Interaction

Minor modes in effect:
  shell-dirtrack-mode: t
  delete-selection-mode: t
  tooltip-mode: t
  global-eldoc-mode: t
  eldoc-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  tool-bar-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  line-number-mode: t
  transient-mark-mode: t

Load-path shadows:
None found.

Features:
(shadow sort mail-extr emacsbug message rmc puny seq byte-opt gv
bytecomp byte-compile cconv cl-loaddefs cl-lib dired dired-loaddefs
format-spec rfc822 mml easymenu mml-sec password-cache epa derived epg
epg-config gnus-util rmail rmail-loaddefs mm-decode mm-bodies mm-encode
mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail rfc2047
rfc2045 ietf-drums mm-util mail-prsvr mail-utils shell pcomplete comint
ansi-color ring cus-start cus-load delsel elec-pair time-date tooltip
eldoc electric uniquify ediff-hook vc-hooks lisp-float-type mwheel
term/ns-win ns-win ucs-normalize mule-util term/common-win tool-bar dnd
fontset image regexp-opt fringe tabulated-list replace newcomment
text-mode elisp-mode lisp-mode prog-mode register page menu-bar
rfn-eshadow isearch timer select scroll-bar mouse jit-lock font-lock
syntax facemenu font-core term/tty-colors frame cl-generic cham georgian
utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean
japanese eucjp-ms cp51932 hebrew greek romanian slovak czech european
ethiopic indian cyrillic chinese composite charscript charprop
case-table epa-hook jka-cmpr-hook help simple abbrev obarray minibuffer
cl-preloaded nadvice loaddefs button faces cus-face macroexp files
text-properties overlay sha1 md5 base64 format env code-pages mule
custom widget hashtable-print-readable backquote threads kqueue cocoa ns
multi-tty make-network-process emacs)

Memory information:
((conses 16 215383 9376)
 (symbols 48 21447 2)
 (miscs 40 58 217)
 (strings 32 31757 2312)
 (string-bytes 1 839659)
 (vectors 16 35726)
 (vector-slots 8 729632 10140)
 (floats 8 49 86)
 (intervals 56 220 0)
 (buffers 992 13))





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#40357; Package emacs. (Mon, 26 Oct 2020 14:16:01 GMT) Full text and rfc822 format available.

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

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Raoul Gough <RaoulGough <at> yahoo.co.uk>
Cc: 40357 <at> debbugs.gnu.org
Subject: Re: bug#40357: 26.3; delete-selection-mode stops working in some
 C-g cancellation cases
Date: Mon, 26 Oct 2020 15:15:37 +0100
Raoul Gough <RaoulGough <at> yahoo.co.uk> writes:

> After the repro above, delete-selection-mode is active but does
> nothing. Examination of pre-command-hook shows that the
> delete-selection-pre-hook hook was removed.

Yup.  It should catch the `quit', I think.  I've now done this in Emacs
28.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Added tag(s) fixed. Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Mon, 26 Oct 2020 14:16:02 GMT) Full text and rfc822 format available.

bug marked as fixed in version 28.1, send any further explanations to 40357 <at> debbugs.gnu.org and Raoul Gough <RaoulGough <at> yahoo.co.uk> Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Mon, 26 Oct 2020 14:16:02 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Tue, 24 Nov 2020 12:24:11 GMT) Full text and rfc822 format available.

This bug report was last modified 3 years and 125 days ago.

Previous Next


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