Subject: bug#62892: proposal to extend mark-sexp to go forward and backward on command

From: Zachary Kanfer <[email-masked]>
Date: Tue, 30 May 2023 23:23:13 -0400

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?

> But adding new commands that still change behavior in mysterious ways
> depending on transient-mark-mode and active region is not something I
> would like to do.

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?

On Fri, May 26, 2023 at 2:06 AM Eli Zaretskii <[email-masked]> wrote:

> > Cc: [email-masked], [email-masked], [email-masked],
> >  [email-masked], [email-masked]
> > From: Richard Stallman <[email-masked]>
> > Date: Thu, 25 May 2023 18:32:56 -0400
> >
> > I don't think we could find standard key bindings that are easy enough
> > to be worth thinking about.
> >
> >   > > Are you envisioning that users would bind some of these functions
> >   > > to keys themselves?
> >
> >   > Yes. This is the main use-case I envisioned.
> >
> > This is not outright unreasonable.  I still doubt they would
> > interest many users, and I would not favor documenting these
> > features fully in the Emacs Manual.
>
> After some more thinking, I came to the conclusion that I can only
> support adding these new commands if they would work in a much more
> predictable fashion: always move forward/back by ARG sexps and set the
> region on all the sexps they moved across.  IOW, no change in behavior
> depending on whether transient-mark-mode is ON or OFF, no change in
> behavior depending on whether the region is active or not, and no
> confusing notion of "extending the region" lumped into them.
>
> Adding such simple commands could cater to those users who want
> predictable marking behavior; perhaps those user will also want to
> rebind C-M-f and C-M-b to these new commands.
>
> But adding new commands that still change behavior in mysterious ways
> depending on transient-mark-mode and active region is not something I
> would like to do.
>
> Sorry for bringing this up so late, I probably should have said this
> at the very beginning of this discussion, if I were thinking fast
> enough to realize this back then.
>