GNU bug report logs - #52896
29.0.50; transient-mark-mode is set to a lot of 'only syms

Previous Next

Package: emacs;

Reported by: Andrey Listopadov <andreyorst <at> gmail.com>

Date: Thu, 30 Dec 2021 09:54:01 UTC

Severity: normal

Tags: moreinfo

Found in version 29.0.50

Fixed in version 28.1

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

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Eli Zaretskii <eliz <at> gnu.org>
To: Andrey Listopadov <andreyorst <at> gmail.com>
Cc: 52896 <at> debbugs.gnu.org
Subject: bug#52896: 29.0.50; transient-mark-mode is set to a lot of 'only syms
Date: Thu, 30 Dec 2021 21:20:16 +0200
> From: Andrey Listopadov <andreyorst <at> gmail.com>
> Date: Thu, 30 Dec 2021 22:07:26 +0300
> Cc: 52896 <at> debbugs.gnu.org
> 
> > 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).
> 
> The expand-region package sets transient mark mode to `only' when tmm
> is disabled:
> 
> https://github.com/magnars/expand-region.el/blob/4b8322774d9c1d8b64a0049d1dbbc1e7ce80c1a0/expand-region-core.el#L57
> https://github.com/magnars/expand-region.el/blob/4b8322774d9c1d8b64a0049d1dbbc1e7ce80c1a0/expand-region-core.el#L163
> 
> > 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.
> 
> Yes, I know, but in the case when transient mark mode is disabled, its
> value is not `(only . t)', but `(only . nil)' which is just `(only)'.

That's true, but in "emacs -Q", once I use a non-shifted command, the
value becomes just nil, as intended.

> > Bottom line: you should look in expand-region.el for the reasons of
> > this misbehavior, and perhaps report a bug to its developers.
> 
> Unfortunately, Magnar Sveen disabled the issue-reporting feature of
> github for this particular project.
> However, looking at the docstring, I guess what expand-region does is
> correct, and the `exchange-point-and-mark' function does kind of a
> weird check - e.g. it checks if the car of `transient-mark-mode' is
> `only' and then conses another only to that.
> But again, I'm not sure what's the intention here, maybe it is expected.

It sounds like expand-region.el assumes something about an internal
implementation detail of this variable.




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

Previous Next


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