From unknown Sun Jun 22 03:51:03 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#40357 <40357@debbugs.gnu.org> To: bug#40357 <40357@debbugs.gnu.org> Subject: Status: 26.3; delete-selection-mode stops working in some C-g cancellation cases Reply-To: bug#40357 <40357@debbugs.gnu.org> Date: Sun, 22 Jun 2025 10:51:03 +0000 retitle 40357 26.3; delete-selection-mode stops working in some C-g cancell= ation cases reassign 40357 emacs submitter 40357 Raoul Gough severity 40357 normal tag 40357 fixed thanks From debbugs-submit-bounces@debbugs.gnu.org Tue Mar 31 16:39:08 2020 Received: (at submit) by debbugs.gnu.org; 31 Mar 2020 20:39:08 +0000 Received: from localhost ([127.0.0.1]:37093 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jJNf9-000335-Gh for submit@debbugs.gnu.org; Tue, 31 Mar 2020 16:39:08 -0400 Received: from lists.gnu.org ([209.51.188.17]:36259) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jJNf8-00032v-99 for submit@debbugs.gnu.org; Tue, 31 Mar 2020 16:39:06 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:39798) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jJNf6-0002Eu-Ep for bug-gnu-emacs@gnu.org; Tue, 31 Mar 2020 16:39:06 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,URIBL_BLOCKED autolearn=disabled version=3.3.2 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jJNf4-0000RO-TS for bug-gnu-emacs@gnu.org; Tue, 31 Mar 2020 16:39:04 -0400 Received: from sonic306-20.consmr.mail.ir2.yahoo.com ([77.238.176.206]:45492) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jJNf4-0000KP-05 for bug-gnu-emacs@gnu.org; Tue, 31 Mar 2020 16:39:02 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.co.uk; s=s2048; t=1585687139; bh=hRApfSJd3v4oQd2JqNX8e6v+rTSdWPsoc/CRtb8GwY4=; h=To:Cc:From:Subject:Date:References:From:Subject; b=SpdXG2bcxVCN1Aw4P5A0Z4cqGvNZ5D1gP6kdM7NZ8+9cYIJ2eEuXiQcwVyQwrfcch0Y8KWw9yOXvA4GBeGx1T8Cgd7sOsmafeCxFbqeuqiUdvB1hfBtHUKIwb27TYy6R9kbF5nCGsv/8FOjhF4Zr2xQEDWCRtJaIcoFMqdWCL+wdC05CenNB96gZyXskhNldxKs27Hl6i8ubmCZMe/cI+DJ/9Qz1oDgetx/eypVluS6zr7fUV548JLvb+Dij2EUcB1k4dJDTLglhAd6Ghqk2mvcNUBh5/CrloQ5J9f16JCb+gfRmMy3TR27fQYgTnaFemzmLUFLts+22MkOjSXLYzg== X-YMail-OSG: 6Udad6oVM1lQNwaPgOInUT.WRUwqGda9xax1.SOaMBj14QoKmw0WbwnG.HTwT2v 3ktsEQYimCJLBAQhIGOEU9EaVGi6Ztp792OmO7kgT.u1HBWhJax8_FICRAHAY1KE2_u6LV3HkpuK ZF18schtvzPo8woGLf5tOMI6Zn05MU8knSaCqUe6t21mZv8rpk_10hB0qfdOWSaiz8.T5k2fkGtq weE6vfLQWHAVzfwsMgskkGJ7S6TWb5nmWIZTIDtedzUH5Fw3.AQ4MLHts5SMYezi2iTipjr1vn4b YFHrqPkpiBk8WK6l3haZW2DtwHknH9Ms8FFjqqGxdwXggOW7B9bageoplN9c4UALAbXIx4.HrOD7 tMqvHZux3NlF7WAoVJVL6aX9LlLTEO_T084OZoasEY2eb79i7MAO_ianbAr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TP; Tue, 31 Mar 2020 20:38:59 +0000 Received: by smtp407.mail.ir2.yahoo.com (Oath Hermes SMTP Server) with ESMTPA ID b92081f01559a370bd2d64487ec000c3; Tue, 31 Mar 2020 20:38:54 +0000 (UTC) To: bug-gnu-emacs@gnu.org From: Raoul Gough Subject: 26.3; delete-selection-mode stops working in some C-g cancellation cases Message-ID: <060234f7-7dd8-edbb-cd6d-7e9afb2ad722@yahoo.co.uk> Date: Tue, 31 Mar 2020 21:38:46 +0100 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:60.0) Gecko/20100101 Thunderbird/60.9.1 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-GB References: <060234f7-7dd8-edbb-cd6d-7e9afb2ad722.ref@yahoo.co.uk> X-Mailer: WebService/1.1.15555 hermes Apache-HttpAsyncClient/4.1.4 (Java/1.8.0_242) Content-Length: 4284 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 77.238.176.206 X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: submit Cc: RaoulGough@yahoo.co.uk X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) 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 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)) From debbugs-submit-bounces@debbugs.gnu.org Mon Oct 26 10:15:49 2020 Received: (at 40357) by debbugs.gnu.org; 26 Oct 2020 14:15:49 +0000 Received: from localhost ([127.0.0.1]:40670 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kX3Hp-0003pX-1g for submit@debbugs.gnu.org; Mon, 26 Oct 2020 10:15:49 -0400 Received: from quimby.gnus.org ([95.216.78.240]:43176) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kX3Hn-0003pE-HK for 40357@debbugs.gnu.org; Mon, 26 Oct 2020 10:15:48 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date: References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=WvpoyBg5v1RnnvWxDua0IAxTPYsq3gCn7b41kRnQpn8=; b=XigeGxhPQ2EOW5Sz2R3kVlvMhi h9ctWIoyEdvKcZhw3iv/q3GpGp+yZVgnd0kbgGizQhcFQ0eqWJX3iPinTXzsEsD7B4IR+fyoDgduA XOgaRVSKnl48zmUCFZRWZLOyUEZ3ef8V9i+JRw6rkvnXVPmffbR+tqt1kqX23oXHRmRk=; Received: from cm-84.212.202.86.getinternet.no ([84.212.202.86] helo=xo) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kX3He-0001gj-Q4; Mon, 26 Oct 2020 15:15:41 +0100 From: Lars Ingebrigtsen To: Raoul Gough Subject: Re: bug#40357: 26.3; delete-selection-mode stops working in some C-g cancellation cases References: <060234f7-7dd8-edbb-cd6d-7e9afb2ad722.ref@yahoo.co.uk> <060234f7-7dd8-edbb-cd6d-7e9afb2ad722@yahoo.co.uk> X-Now-Playing: Contriva's _If you had stayed..._: "instead" Date: Mon, 26 Oct 2020 15:15:37 +0100 In-Reply-To: <060234f7-7dd8-edbb-cd6d-7e9afb2ad722@yahoo.co.uk> (Raoul Gough's message of "Tue, 31 Mar 2020 21:38:46 +0100") Message-ID: <87lfft13au.fsf@gnus.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: Raoul Gough 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. Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 40357 Cc: 40357@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Raoul Gough 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 From debbugs-submit-bounces@debbugs.gnu.org Mon Oct 26 10:15:55 2020 Received: (at control) by debbugs.gnu.org; 26 Oct 2020 14:15:55 +0000 Received: from localhost ([127.0.0.1]:40675 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kX3Hv-0003pr-B2 for submit@debbugs.gnu.org; Mon, 26 Oct 2020 10:15:55 -0400 Received: from quimby.gnus.org ([95.216.78.240]:43190) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kX3Ht-0003pQ-4T for control@debbugs.gnu.org; Mon, 26 Oct 2020 10:15:53 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Subject:From:To:Message-Id:Date:Sender:Reply-To:Cc: MIME-Version:Content-Type:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=U1wuWKnoZ2kXDWH5tpnpk4TUYcPJNCvOH9+aoQUGVZo=; b=XOFmJvU3Vw5FXRGl60Wbt0Vek1 tzl8qUAOf+JB9/8UkQHsQpDyM0lIcEni0/vGFONztU69s7VFBtmZE1Urdauwqwb6kVReuo3NrB/0j 02jrqEe/jRtRGllEoLo1ONx86DYMRFmmm9z+19+KcqlZA9vNv0d0bqr8Kaar+bQM8y2I=; Received: from cm-84.212.202.86.getinternet.no ([84.212.202.86] helo=xo) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kX3Hl-0001gr-IG for control@debbugs.gnu.org; Mon, 26 Oct 2020 15:15:47 +0100 Date: Mon, 26 Oct 2020 15:15:44 +0100 Message-Id: <87k0vd13an.fsf@gnus.org> To: control@debbugs.gnu.org From: Lars Ingebrigtsen Subject: control message for bug #40357 X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: tags 40357 fixed close 40357 28.1 quit Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) tags 40357 fixed close 40357 28.1 quit From unknown Sun Jun 22 03:51:03 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Tue, 24 Nov 2020 12:24:11 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator