all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Paul Nelson <ultrono@gmail.com>
To: 70384@debbugs.gnu.org
Subject: bug#70384: [PATCH] 30.0.50; save-mark-and-excursion breaks with tmm disabled
Date: Sun, 14 Apr 2024 17:52:42 +0200	[thread overview]
Message-ID: <CAOA-32O0-66MUVdy_V94Cn32o03_Jui8-dbdoMAGoCzAd5ze5Q@mail.gmail.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 278 bytes --]

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

[-- Attachment #2: 0001-Fix-save-mark-and-excursion-with-tmm-disabled.patch --]
[-- Type: application/octet-stream, Size: 830 bytes --]

From 06b6f0a70eb7f59fe9a2a0d82697f509290993f0 Mon Sep 17 00:00:00 2001
From: Paul Nelson <ultrono@gmail.com>
Date: Sun, 14 Apr 2024 17:49:45 +0200
Subject: [PATCH] Fix save-mark-and-excursion with tmm disabled

* lisp/simple.el (save-mark-and-excursion--save):
Use (region-active-p) instead of mark-active.
---
 lisp/simple.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lisp/simple.el b/lisp/simple.el
index 0645f18cc78..249fadae6a9 100644
--- a/lisp/simple.el
+++ b/lisp/simple.el
@@ -6981,7 +6981,7 @@ save-mark-and-excursion--save
   (cons
    (let ((mark (mark-marker)))
      (and (marker-position mark) (copy-marker mark)))
-   mark-active))
+   (region-active-p)))
 
 (defun save-mark-and-excursion--restore (saved-mark-info)
   (let ((saved-mark (car saved-mark-info))
-- 
2.39.3 (Apple Git-145)


             reply	other threads:[~2024-04-14 15:52 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-14 15:52 Paul Nelson [this message]
2024-04-18 11:04 ` bug#70384: [PATCH] 30.0.50; save-mark-and-excursion breaks with tmm disabled Eli Zaretskii
2024-04-18 13:26   ` Paul Nelson
2024-04-18 13:55   ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-04-18 14:20     ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAOA-32O0-66MUVdy_V94Cn32o03_Jui8-dbdoMAGoCzAd5ze5Q@mail.gmail.com \
    --to=ultrono@gmail.com \
    --cc=70384@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.