From unknown Sat Jun 21 10:15:52 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#2760 <2760@debbugs.gnu.org> To: bug#2760 <2760@debbugs.gnu.org> Subject: Status: CUA-like stuff spuriously enables transient-mark-mode. Reply-To: bug#2760 <2760@debbugs.gnu.org> Date: Sat, 21 Jun 2025 17:15:52 +0000 retitle 2760 CUA-like stuff spuriously enables transient-mark-mode. reassign 2760 emacs submitter 2760 Alan Mackenzie severity 2760 normal thanks From acm@muc.de Mon Mar 23 15:37:57 2009 Received: (at submit) by emacsbugs.donarmstrong.com; 23 Mar 2009 22:37:57 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02 (2008-06-10) on rzlab.ucr.edu X-Spam-Level: X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. X-Spam-Status: No, score=0.0 required=4.0 tests=none autolearn=ham version=3.2.5-bugs.debian.org_2005_01_02 Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id n2NMbrOv008275 for ; Mon, 23 Mar 2009 15:37:55 -0700 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LlsmH-0005dS-KR for bug-gnu-emacs@gnu.org; Mon, 23 Mar 2009 18:37:53 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LlsmC-0005bY-BZ for bug-gnu-emacs@gnu.org; Mon, 23 Mar 2009 18:37:52 -0400 Received: from [199.232.76.173] (port=33390 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LlsmC-0005bV-7J for bug-gnu-emacs@gnu.org; Mon, 23 Mar 2009 18:37:48 -0400 Received: from colin.muc.de ([193.149.48.1]:3674 helo=mail.muc.de) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1LlsmB-0002ZR-NG for bug-gnu-emacs@gnu.org; Mon, 23 Mar 2009 18:37:48 -0400 Received: (qmail 41780 invoked by uid 3782); 23 Mar 2009 22:37:45 -0000 Received: from acm.muc.de (pD9E52741.dip.t-dialin.net [217.229.39.65]) by colin2.muc.de (tmda-ofmipd) with ESMTP; Mon, 23 Mar 2009 23:37:43 +0100 Received: (qmail 5953 invoked by uid 1000); 23 Mar 2009 22:37:03 -0000 Date: Mon, 23 Mar 2009 22:37:03 +0000 To: bug-gnu-emacs@gnu.org Subject: CUA-like stuff spuriously enables transient-mark-mode. Message-ID: <20090323223703.GA5650@muc.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.9i X-Delivery-Agent: TMDA/1.1.5 (Fettercairn) From: Alan Mackenzie X-Primary-Address: acm@muc.de X-detected-operating-system: by monty-python.gnu.org: FreeBSD 4.6-4.9 Hi, Richard, Eli and Emacs! Start the CVS head "emacs -Q", and evaluate this: (global-set-key [ &\C-\M-\S-m ] 'forward-char) (transient-mark-mode -1) In some buffer, invoke 'forward-char by the above binding. This enables transient-mark-mode as a side effect. This shouldn't happen. It happens both in a Linux Virtual terminal (with the requisite enhancements to the keyboard handling) and in X-Windows. ANALYSIS: --------- The "^" in the interactive string causes `handle-shift-selection' to be invoked by the command loop. The function and friends abuse the user option variable `transient-mark-mode' by additionally storing some sort of state in it. h-s-s writes the value '(only) into the variable transient-mark-mode, thus enabling the mode. A sensible fix would surely involve leaving `transient-mark-mode' severely alone (only the user should set this) and creating another variable (or several) to hold the state currently mashed into t-m-m. COMMENT: -------- It is now no longer true that "But Emacs does not assign meanings to keys directly" (Emacs manual, page "Commands") - Emacs directly assigns a meaning to the shift key. This is surely a Bad Thing. Why, why, why is this thing implemented by hard-coding in the command loop, where it interferes with users' ability to chose key bindings? Surely this feature with the shift key should have been implemented by defining defuns such as `forward-char-with-marking', and putting these commands in some suitable keymap? OK, it's more work, but not _that_ much more. It's practically 100% certain that somebody, somewhere, will want to use the hyper- or alt- keys instead of to get this visible region feature, or possibly might want to use separate bindings entirely. It's near 100% certain that somebody, somewhere, perhaps with a name like Xah Lee, will want to use C-f as "find" (i.e. bind it to `isearch-forward') and use C-S-f for `forward-char'. -- Alan Mackenzie (Nuremberg, Germany). From monnier@iro.umontreal.ca Mon Mar 23 17:46:33 2009 Received: (at submit) by emacsbugs.donarmstrong.com; 24 Mar 2009 00:46:33 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02 (2008-06-10) on rzlab.ucr.edu X-Spam-Level: X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. X-Spam-Status: No, score=-0.5 required=4.0 tests=HAS_BUG_NUMBER,XIRONPORT autolearn=unavailable version=3.2.5-bugs.debian.org_2005_01_02 Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id n2O0kU80009763 for ; Mon, 23 Mar 2009 17:46:31 -0700 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Llumk-0006w0-Gd for bug-gnu-emacs@gnu.org; Mon, 23 Mar 2009 20:46:30 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Llumf-0006vo-5d for bug-gnu-emacs@gnu.org; Mon, 23 Mar 2009 20:46:29 -0400 Received: from [199.232.76.173] (port=51650 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Llume-0006vl-VF for bug-gnu-emacs@gnu.org; Mon, 23 Mar 2009 20:46:25 -0400 Received: from ironport2-out.pppoe.ca ([206.248.154.182]:23112 helo=ironport2-out.teksavvy.com) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Llume-0001PM-Ky for bug-gnu-emacs@gnu.org; Mon, 23 Mar 2009 20:46:24 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApsEAMbJx0lFxIZP/2dsb2JhbACBUNBMg34GhGc X-IronPort-AV: E=Sophos;i="4.38,410,1233550800"; d="scan'208";a="35558732" Received: from 69-196-134-79.dsl.teksavvy.com (HELO ceviche.home) ([69.196.134.79]) by ironport2-out.teksavvy.com with ESMTP; 23 Mar 2009 20:46:22 -0400 Received: by ceviche.home (Postfix, from userid 20848) id 2EB50B44A5; Mon, 23 Mar 2009 20:46:22 -0400 (EDT) From: Stefan Monnier To: Alan Mackenzie Cc: 2760@debbugs.gnu.org, bug-gnu-emacs@gnu.org Subject: Re: bug#2760: CUA-like stuff spuriously enables transient-mark-mode. Message-ID: References: <20090323223703.GA5650@muc.de> Date: Mon, 23 Mar 2009 20:46:22 -0400 In-Reply-To: <20090323223703.GA5650@muc.de> (Alan Mackenzie's message of "Mon, 23 Mar 2009 22:37:03 +0000") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.91 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-detected-operating-system: by monty-python.gnu.org: Genre and OS details not recognized. > Start the CVS head "emacs -Q", and evaluate this: > (global-set-key [ &\C-\M-\S-m ] 'forward-char) > (transient-mark-mode -1) > In some buffer, invoke 'forward-char by the above binding. This enables > transient-mark-mode as a side effect. This shouldn't happen. Can't reproduce it here (I tried the above, after replacing & with ? and I don't see any indication that transient-mark-mode is being set). > Why, why, why is this thing implemented by hard-coding in the command > loop, where it interferes with users' ability to chose key bindings? Where do you see it hardcoded in the command loop? > It's practically 100% certain that somebody, somewhere, will want to use > the hyper- or alt- keys instead of to get this visible region We'll cross this bridge when we get there. > It's near 100% certain that somebody, somewhere, perhaps with a name like > Xah Lee, will want to use C-f as "find" (i.e. bind it to > `isearch-forward') and use C-S-f for `forward-char'. And that works just fine, AFAICT. Stefan From acm@muc.de Tue Mar 24 06:53:13 2009 Received: (at submit) by emacsbugs.donarmstrong.com; 24 Mar 2009 13:53:13 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02 (2008-06-10) on rzlab.ucr.edu X-Spam-Level: X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. X-Spam-Status: No, score=-2.9 required=4.0 tests=FOURLA,HAS_BUG_NUMBER autolearn=unavailable version=3.2.5-bugs.debian.org_2005_01_02 Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id n2ODr5TF025330 for ; Tue, 24 Mar 2009 06:53:06 -0700 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Lm73x-000324-0b for bug-gnu-emacs@gnu.org; Tue, 24 Mar 2009 09:53:05 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Lm73s-0002uw-Cd for bug-gnu-emacs@gnu.org; Tue, 24 Mar 2009 09:53:04 -0400 Received: from [199.232.76.173] (port=51554 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Lm73s-0002ur-9i for bug-gnu-emacs@gnu.org; Tue, 24 Mar 2009 09:53:00 -0400 Received: from colin.muc.de ([193.149.48.1]:3010 helo=mail.muc.de) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1Lm73r-00036b-JJ for bug-gnu-emacs@gnu.org; Tue, 24 Mar 2009 09:53:00 -0400 Received: (qmail 3282 invoked by uid 3782); 24 Mar 2009 13:52:56 -0000 Received: from acm.muc.de (pD9E5285F.dip.t-dialin.net [217.229.40.95]) by colin2.muc.de (tmda-ofmipd) with ESMTP; Tue, 24 Mar 2009 14:52:49 +0100 Received: (qmail 6339 invoked by uid 1000); 24 Mar 2009 13:52:10 -0000 Date: Tue, 24 Mar 2009 13:52:10 +0000 To: Stefan Monnier Cc: 2760@debbugs.gnu.org, bug-gnu-emacs@gnu.org Subject: Re: bug#2760: CUA-like stuff spuriously enables transient-mark-mode. Message-ID: <20090324135210.GA4657@muc.de> References: <20090323223703.GA5650@muc.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.9i X-Delivery-Agent: TMDA/1.1.5 (Fettercairn) From: Alan Mackenzie X-Primary-Address: acm@muc.de X-detected-operating-system: by monty-python.gnu.org: FreeBSD 4.6-4.9 X-CrossAssassin-Score: 2 Hi, Stefan! On Mon, Mar 23, 2009 at 08:46:22PM -0400, Stefan Monnier wrote: > > Start the CVS head "emacs -Q", and evaluate this: > > (global-set-key [ &\C-\M-\S-m ] 'forward-char) > > (transient-mark-mode -1) > > In some buffer, invoke 'forward-char by the above binding. This enables > > transient-mark-mode as a side effect. This shouldn't happen. > Can't reproduce it here (I tried the above, after replacing & with ? > and I don't see any indication that transient-mark-mode is being set). Sorry, my mistake. Yes I did mean "?" in the binding, but as depicted above, the bug doesn't happen. Instead, (global-set-key [ ?\C-\M-m ] 'forward-char) Now invoke forward-char with this binding + the shift key. This enables transient-mark-mode as a side effect. This shouldn't happen.^H^H^H^H.... Correction: this can be disabled by nullifying the option shift-select-mode - which isn't yet documented in the Emacs manual. So I withdraw my complaint, with apologies. > > Why, why, why is this thing implemented by hard-coding in the command > > loop, where it interferes with users' ability to chose key bindings? > Where do you see it hardcoded in the command loop? In Fcall_interactively, Lines 207 and 231, where it is interpreting the interactive string: else if (*string == '^') { if (! NILP (Vshift_select_mode)) call1 (Qhandle_shift_selection, Qnil); <================ /* Even if shift-select-mode is off, temporarily active regions could be set using the mouse, and should be deactivated. */ else if (CONSP (Vtransient_mark_mode) && EQ (XCAR (Vtransient_mark_mode), Qonly)) call1 (Qhandle_shift_selection, Qt); <================ string++; } . > > It's practically 100% certain that somebody, somewhere, will want to use > > the hyper- or alt- keys instead of to get this visible region > We'll cross this bridge when we get there. > Stefan -- Alan Mackenzie (Nuremberg, Germany). From acm@muc.de Tue Mar 24 08:50:21 2009 Received: (at 2760-done) by emacsbugs.donarmstrong.com; 24 Mar 2009 15:50:22 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02 (2008-06-10) on rzlab.ucr.edu X-Spam-Level: X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. X-Spam-Status: No, score=-3.0 required=4.0 tests=HAS_BUG_NUMBER autolearn=ham version=3.2.5-bugs.debian.org_2005_01_02 Received: from mail.muc.de (qmailr@colin.muc.de [193.149.48.1]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id n2OFoIK6025731 for <2760-done@emacsbugs.donarmstrong.com>; Tue, 24 Mar 2009 08:50:19 -0700 Received: (qmail 28024 invoked by uid 3782); 24 Mar 2009 15:50:17 -0000 Received: from acm.muc.de (pD9E5285F.dip.t-dialin.net [217.229.40.95]) by colin2.muc.de (tmda-ofmipd) with ESMTP; Tue, 24 Mar 2009 16:50:15 +0100 Received: (qmail 7859 invoked by uid 1000); 24 Mar 2009 15:49:37 -0000 Date: Tue, 24 Mar 2009 15:49:37 +0000 To: 2760-done@debbugs.gnu.org Subject: Re: bug#2760: Acknowledgement (CUA-like stuff spuriously enables transient-mark-mode.) Message-ID: <20090324154937.GB4657@muc.de> References: <20090323223703.GA5650@muc.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.9i X-Delivery-Agent: TMDA/1.1.5 (Fettercairn) From: Alan Mackenzie X-Primary-Address: acm@muc.de This wasn't a bug. On Mon, Mar 23, 2009 at 10:45:04PM +0000, Emacs bug Tracking System wrote: > Thank you for filing a new bug report with Emacs. > -- > 2760: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=2760 > Emacs Bug Tracking System > Contact help-debbugs@gnu.org with problems -- Alan Mackenzie (Nuremberg, Germany). From monnier@iro.umontreal.ca Tue Mar 24 18:38:39 2009 Received: (at submit) by emacsbugs.donarmstrong.com; 25 Mar 2009 01:38:39 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02 (2008-06-10) on rzlab.ucr.edu X-Spam-Level: X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. X-Spam-Status: No, score=-0.4 required=4.0 tests=FOURLA,HAS_BUG_NUMBER, XIRONPORT autolearn=ham version=3.2.5-bugs.debian.org_2005_01_02 Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id n2P1caNt022055 for ; Tue, 24 Mar 2009 18:38:37 -0700 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LmI4i-0002aU-8e for bug-gnu-emacs@gnu.org; Tue, 24 Mar 2009 21:38:36 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LmI4c-0002Yd-QY for bug-gnu-emacs@gnu.org; Tue, 24 Mar 2009 21:38:34 -0400 Received: from [199.232.76.173] (port=50693 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LmI4c-0002YV-IK for bug-gnu-emacs@gnu.org; Tue, 24 Mar 2009 21:38:30 -0400 Received: from ironport2-out.teksavvy.com ([206.248.154.182]:64663) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1LmI4c-0005e6-6w for bug-gnu-emacs@gnu.org; Tue, 24 Mar 2009 21:38:30 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AgcFACMoyUlFxIZP/2dsb2JhbACBUMBVkCWDdgaEZw X-IronPort-AV: E=Sophos;i="4.38,416,1233550800"; d="scan'208";a="35609337" Received: from 69-196-134-79.dsl.teksavvy.com (HELO pastel.home) ([69.196.134.79]) by ironport2-out.teksavvy.com with ESMTP; 24 Mar 2009 21:38:29 -0400 Received: by pastel.home (Postfix, from userid 20848) id 6E5EA7F74; Tue, 24 Mar 2009 21:38:29 -0400 (EDT) From: Stefan Monnier To: Alan Mackenzie Cc: 2760@debbugs.gnu.org, bug-gnu-emacs@gnu.org Subject: Re: bug#2760: CUA-like stuff spuriously enables transient-mark-mode. Message-ID: References: <20090323223703.GA5650@muc.de> <20090324135210.GA4657@muc.de> Date: Tue, 24 Mar 2009 21:38:29 -0400 In-Reply-To: <20090324135210.GA4657@muc.de> (Alan Mackenzie's message of "Tue, 24 Mar 2009 13:52:10 +0000") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.91 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-detected-operating-system: by monty-python.gnu.org: Genre and OS details not recognized. >> Where do you see it hardcoded in the command loop? > In Fcall_interactively, Lines 207 and 231, where it is interpreting the > interactive string: > else if (*string == '^') > { > if (! NILP (Vshift_select_mode)) > call1 (Qhandle_shift_selection, Qnil); <================ > /* Even if shift-select-mode is off, temporarily active > regions could be set using the mouse, and should be > deactivated. */ > else if (CONSP (Vtransient_mark_mode) > && EQ (XCAR (Vtransient_mark_mode), Qonly)) > call1 (Qhandle_shift_selection, Qt); <================ > string++; > } > . I see. I guess we just disagree on what is meant by "hardcoded in the command loop": this code is explicitly requested by the "^" code in the `interactive' string of a command, so it seems (to me) pretty far from "hardcoded in the command loop". Stefan From unknown Sat Jun 21 10:15:52 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: $requester Subject: Internal Control Message-Id: bug archived. Date: Wed, 22 Apr 2009 14:24:06 +0000 User-Agent: Fakemail v42.6.9 # A New Hope # A log time ago, in a galaxy far, far away # something happened. # # Magically this resulted in the following # action being taken, but this fake control # message doesn't tell you why it happened # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator