Subject: bug#50038: Permanent shift-select-mode

From: Eli Zaretskii <[email-masked]>
Date: Sat, 14 Aug 2021 09:37:58 +0300

> From: Juri Linkov <[email-masked]>
> Date: Fri, 13 Aug 2021 10:04:27 +0300
> 
> But when there is a need to extend the region by typing a navigation key
> that is not shift-translated, it abruptly deactivates the region.
> The current default behavior was implemented in such unusable way
> because "other apps" behave the same way.
> 
> So the following patch provides an option for the behavior that is more
> convenient than in "other apps":

Thanks.

> --- a/lisp/simple.el
> +++ b/lisp/simple.el
> @@ -6649,9 +6649,15 @@ shift-select-mode
>  by any subsequent point motion key that was not shift-translated, or
>  by any action that normally deactivates the mark in Transient Mark mode.
>  
> +When the value is `permanent', the mark will not be deactivated
> +by any subsequent point motion key that was not shift-translated.

This is a negative description, which tells half of the story, and
leaves it to the reader to guess the other half (how to deactivate the
mark in this case).  How about describing both, and in a positive way?
For example:

  When the value is `permanent', the mark will be deactivated by any
  action which normally does that, but not by motion keys that were
  not shift-translated.

And finally, a question: is it enough to have this as a user option?
That is, what if the user wants this only temporarily, for the next
sequence of commands that extend the region?  Should we perhaps have a
better solution for that use case?  More generally, perhaps this
feature is almost always wanted only for a sequence of commands, never
globally for extended periods of time?  In that case, a user option is
not the best solution; it is better to have some minor mode that could
be turned on and off with a simple key sequence.
>  See `this-command-keys-shift-translated' for the meaning of
>  shift-translation."
> -  :type 'boolean
> +  :type '(choice (const :tag "Off" nil)
> +                 (const :tag "Permanent" permanent)
> +                 (other :tag "On" t))
> +  :version "28.1"
>    :group 'editing-basics)

This would also need a NEWS entry, if we eventually decide to do it
this way.