GNU bug report logs - #70384
[PATCH] 30.0.50; save-mark-and-excursion breaks with tmm disabled

Previous Next

Package: emacs;

Reported by: Paul Nelson <ultrono <at> gmail.com>

Date: Sun, 14 Apr 2024 15:54:05 UTC

Severity: normal

Tags: notabug, patch, wontfix

Done: Eli Zaretskii <eliz <at> gnu.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 70384 in the body.
You can then email your comments to 70384 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#70384; Package emacs. (Sun, 14 Apr 2024 15:54:06 GMT) Full text and rfc822 format available.

Acknowledgement sent to Paul Nelson <ultrono <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Sun, 14 Apr 2024 15:54:06 GMT) Full text and rfc822 format available.

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

From: Paul Nelson <ultrono <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: [PATCH] 30.0.50; save-mark-and-excursion breaks with tmm disabled
Date: Sun, 14 Apr 2024 17:52:42 +0200
[Message part 1 (text/plain, inline)]
Hello,

Steps to reproduce:

- Disable transient-mark-mode.
- Set the mark somewhere (C-SPC), move the point somewhere else.
- M-: (save-mark-and-excursion (activate-mark))

This activates the region, but should not.

Attaching a patch with the simple fix.

Thanks, best,

Paul
[0001-Fix-save-mark-and-excursion-with-tmm-disabled.patch (application/octet-stream, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#70384; Package emacs. (Thu, 18 Apr 2024 11:06:11 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Paul Nelson <ultrono <at> gmail.com>, Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: 70384 <at> debbugs.gnu.org
Subject: Re: bug#70384: [PATCH] 30.0.50;
 save-mark-and-excursion breaks with tmm disabled
Date: Thu, 18 Apr 2024 14:04:29 +0300
> From: Paul Nelson <ultrono <at> gmail.com>
> Date: Sun, 14 Apr 2024 17:52:42 +0200
> 
> Steps to reproduce:
> 
> - Disable transient-mark-mode.
> - Set the mark somewhere (C-SPC), move the point somewhere else.
> - M-: (save-mark-and-excursion (activate-mark))
> 
> This activates the region, but should not.

I'm not sure I agree with your expectations.  activate-mark activates
the mark unconditionally when transient-mark-mode is disabled, unless
you invoke it with a non-nil argument.  And indeed

   (save-mark-and-excursion (activate-mark t))

behaves like you expect.

Stefan, am I missing something?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#70384; Package emacs. (Thu, 18 Apr 2024 13:27:12 GMT) Full text and rfc822 format available.

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

From: Paul Nelson <ultrono <at> gmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: Stefan Monnier <monnier <at> iro.umontreal.ca>, 70384 <at> debbugs.gnu.org
Subject: Re: bug#70384: [PATCH] 30.0.50; save-mark-and-excursion breaks with
 tmm disabled
Date: Thu, 18 Apr 2024 15:26:14 +0200
My mistake, I think.  Thanks for looking into this.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#70384; Package emacs. (Thu, 18 Apr 2024 13:57:02 GMT) Full text and rfc822 format available.

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

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 70384 <at> debbugs.gnu.org, Paul Nelson <ultrono <at> gmail.com>
Subject: Re: bug#70384: [PATCH] 30.0.50; save-mark-and-excursion breaks with
 tmm disabled
Date: Thu, 18 Apr 2024 09:55:56 -0400
> I'm not sure I agree with your expectations.  activate-mark activates
> the mark unconditionally when transient-mark-mode is disabled, unless
> you invoke it with a non-nil argument.  And indeed
>
>    (save-mark-and-excursion (activate-mark t))
>
> behaves like you expect.
>
> Stefan, am I missing something?

It's all very messy with dark corners where the right answer is unclear,
yes.  That's one of the reasons why I extracted that mark-handling
functionality out of `save-excursion` in the first place. 🙂

IOW my opinion is: if you use `save-mark-and-excursion`, you get what
you deserve.


        Stefan





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#70384; Package emacs. (Thu, 18 Apr 2024 14:21:04 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: 70384 <at> debbugs.gnu.org, ultrono <at> gmail.com
Subject: Re: bug#70384: [PATCH] 30.0.50; save-mark-and-excursion breaks with
 tmm disabled
Date: Thu, 18 Apr 2024 17:20:14 +0300
tags 70384 notabug wontfix
close 70384
thanks

> From: Stefan Monnier <monnier <at> iro.umontreal.ca>
> Cc: Paul Nelson <ultrono <at> gmail.com>,  70384 <at> debbugs.gnu.org
> Date: Thu, 18 Apr 2024 09:55:56 -0400
> 
> > I'm not sure I agree with your expectations.  activate-mark activates
> > the mark unconditionally when transient-mark-mode is disabled, unless
> > you invoke it with a non-nil argument.  And indeed
> >
> >    (save-mark-and-excursion (activate-mark t))
> >
> > behaves like you expect.
> >
> > Stefan, am I missing something?
> 
> It's all very messy with dark corners where the right answer is unclear,
> yes.  That's one of the reasons why I extracted that mark-handling
> functionality out of `save-excursion` in the first place. 🙂
> 
> IOW my opinion is: if you use `save-mark-and-excursion`, you get what
> you deserve.

OK, thanks.  So I'm closing this non-bug as wontfix.




Added tag(s) wontfix and notabug. Request was from Eli Zaretskii <eliz <at> gnu.org> to control <at> debbugs.gnu.org. (Thu, 18 Apr 2024 14:21:06 GMT) Full text and rfc822 format available.

bug closed, send any further explanations to 70384 <at> debbugs.gnu.org and Paul Nelson <ultrono <at> gmail.com> Request was from Eli Zaretskii <eliz <at> gnu.org> to control <at> debbugs.gnu.org. (Thu, 18 Apr 2024 14:21:06 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. (Fri, 17 May 2024 11:24:10 GMT) Full text and rfc822 format available.

This bug report was last modified 1 day ago.

Previous Next


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