From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#52896: 29.0.50; transient-mark-mode is set to a lot of 'only syms Date: Thu, 30 Dec 2021 20:49:45 +0200 Message-ID: <831r1uhqra.fsf@gnu.org> References: Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="30912"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 52896@debbugs.gnu.org To: Andrey Listopadov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Dec 30 19:50:33 2021 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1n30VU-0007qn-Nk for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 30 Dec 2021 19:50:32 +0100 Original-Received: from localhost ([::1]:51764 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n30VT-0008C7-3Y for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 30 Dec 2021 13:50:31 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:50894) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n30V1-0008BD-Ka for bug-gnu-emacs@gnu.org; Thu, 30 Dec 2021 13:50:03 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:42922) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1n30V0-0003cz-Ab for bug-gnu-emacs@gnu.org; Thu, 30 Dec 2021 13:50:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1n30V0-0006oe-8u for bug-gnu-emacs@gnu.org; Thu, 30 Dec 2021 13:50:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 30 Dec 2021 18:50:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 52896 X-GNU-PR-Package: emacs Original-Received: via spool by 52896-submit@debbugs.gnu.org id=B52896.164089018726165 (code B ref 52896); Thu, 30 Dec 2021 18:50:02 +0000 Original-Received: (at 52896) by debbugs.gnu.org; 30 Dec 2021 18:49:47 +0000 Original-Received: from localhost ([127.0.0.1]:54468 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n30Uk-0006nx-VC for submit@debbugs.gnu.org; Thu, 30 Dec 2021 13:49:47 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:50038) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n30Uj-0006nk-GL for 52896@debbugs.gnu.org; Thu, 30 Dec 2021 13:49:45 -0500 Original-Received: from [2001:470:142:3::e] (port=51126 helo=fencepost.gnu.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n30Ue-0003aA-0U; Thu, 30 Dec 2021 13:49:40 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=h/AYc4q79OV5U8JTi5BXbC3YimbTy+bGDAddqyL4fl4=; b=c9nDgAZFgX6C K2Ywu3NeQJA4DfyuxOvCV41Li8NE08hQm9PyLXT61YHAjA3w6Meiosa4bssqCtnNeTJuD71AzIlLA sU1cleP50R4WZhP48sOAGZHvuhTLAZ0ITK1Snw59BsGPLStIzizDsDhQoWU6KcQoJpWSz60joAauW DmTL7GJQvEOhaaG6WX/Ouq02uZ4g4MoZ4KjWF8t0uhkEIRP7Pj4HB7nfPfa4UrowMS5eULiAlzan+ /eh2YF8ltswpsngcYpKwiJVTObZ3+aMx9tDIz+lA7QpZYvJWsihIzS1VxGAAmZ1jcQ+9fFXW5+7HD TIRij1L1z8ldL+4hs5CFkQ==; Original-Received: from [87.69.77.57] (port=1957 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n30Ud-00084y-SJ; Thu, 30 Dec 2021 13:49:40 -0500 In-Reply-To: (message from Andrey Listopadov on Thu, 30 Dec 2021 12:53:08 +0300) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:223441 Archived-At: > From: Andrey Listopadov > Date: Thu, 30 Dec 2021 12:53:08 +0300 > > I've installed the expand-region.el package and noticed that transient > mark mode started misbehaving. I'm using Emacs with > `transient-mark-mode' disabled, and enable it occasionally via `C-SPC > C-SPC' when needed. After using `er/expand-region' function I've > noticed that `C-SPC C-SPC' doesn't highlight the region. Upon further > inspection I've noticed that the `transient-mark-mode' variable is set > to `(only only only only only ... only) with a total of 26 `only' > symbols. Symbols disappear one by one when I move the point or invoke > other commands, so eventually `C-SPC C-SPC' starts working again. > > I've added a watcher to the `transient-mark-mode' variable and upon > first activation of expand region I see this: > > transient-mark-mode (only) set # > transient-mark-mode (only only) set # > transient-mark-mode (only only only) set # > transient-mark-mode (only only only only) set # > Type = to expand again, - to contract, 0 to reset > > Upon further investigation I've found that this happens inside the > `exchange-point-and-mark' function. I've added a message right before > `cons' call to confirm that: > > transient-mark-mode (only) set # > exchange-point-and-mark > transient-mark-mode (only only) set # > exchange-point-and-mark > transient-mark-mode (only only only) set # > exchange-point-and-mark > transient-mark-mode (only only only only) set # > Type = to expand again, - to contract, 0 to reset > > The function explicitly checks if ``(eq (car-safe transient-mark-mode) > 'only)'' is true and then conses `only' to the `transient-mark-mode', > causing it to grow. I'm not sure what is the intention here, but this > makes it harder using `C-SPC C-SPC` to temporarily activate the > transient mark mode. How come transient-mark-mode became set to 'only' in the first place? That is supposed to happen only when shift-translated commands are used, and should be reset to the old value whenever the first non-shift-translated command is used. See the doc string of transient-mark-mode (the variable). You can see how it works if, in "emacs -Q", you press and hold Shift and use arrow keys to move point, then evaluate M-: transient-mark-mode RET You should then see the value '(only . t)' of the variable. Once you type some unshifted command, like C-f, the value becomes t again. So I suspect that the expand-region.el package you installed does something to cause this, and in particular doesn't take care to reset the value when it should. Bottom line: you should look in expand-region.el for the reasons of this misbehavior, and perhaps report a bug to its developers.