GNU bug report logs - #62892
proposal to extend mark-sexp to go forward and backward on command

Previous Next

Package: emacs;

Reported by: Zachary Kanfer <zkanfer <at> gmail.com>

Date: Mon, 17 Apr 2023 02:26:02 UTC

Severity: normal

Full log


View this message in rfc822 format

From: Eli Zaretskii <eliz <at> gnu.org>
To: Zachary Kanfer <zkanfer <at> gmail.com>
Cc: rms <at> gnu.org, juri <at> linkov.net, ruijie <at> netyu.xyz, 62892 <at> debbugs.gnu.org, drew.adams <at> oracle.com, monnier <at> iro.umontreal.ca
Subject: bug#62892: proposal to extend mark-sexp to go forward and backward on command
Date: Wed, 31 May 2023 15:01:39 +0300
> From: Zachary Kanfer <zkanfer <at> gmail.com>
> Date: Tue, 30 May 2023 23:23:13 -0400
> Cc: rms <at> gnu.org, ruijie <at> netyu.xyz, 62892 <at> debbugs.gnu.org, 
> 	monnier <at> iro.umontreal.ca, drew.adams <at> oracle.com, juri <at> linkov.net
> 
> This is interesting. Let me see if I'm understanding properly. In this, I'll talk only about sexps, but I
> believe this argument should apply to all the forms we've talked about (word, sexp, paragraph, defun,
> page). These commands should:
> 
> 1. Always move forward/back by ARG sexps (defaulting to 1), setting the region on all sexps it moves
> across.
> 
> I'm in agreement with #1, for sure. That is the basis for what I wanted initially.
> 
> 2. Ignore whether transient-mark-mode is enabled.
> 3. Don't change behavior if the region is active or not.
> 
> #2 and #3 I believe can be considered together. There are a few things that could do this, but I think
> what you're saying is that this function should *only* move mark.That is, point should stay the same no
> matter what is called here. Additionally, it should activate mark. Is that what you meant?

No, it should only move point, not the mark.  The mark should stay
where point was before invoking the command.

Whether it should activate the mark is open to discussion.  One
possibility is that the command will work like shift-select commands.
Another possibility is that it should activate the mark only if
transient-mark-mode is turned ON, like other commands that push the
mark.

> My understanding was that #'use-region-p (which checks transient-mark-mode, and whether the region
> is active) is a standard way for determining whether to act on the region or not, and should generally
> be looked at before acting on the region. Is that not accurate?

This is correct, but only for commands that do something with the text
in the region: limit search/replace to it, or spell-check the text in
it, etc.  mark-sexp doesn't do anything like that, it actually
_modifies_ the region.  So the fact that it changes its effect
depending on whether the region is active is IMO pretty confusing and
unexpected.




This bug report was last modified 2 years and 17 days ago.

Previous Next


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