GNU bug report logs -
#29346
dwim transpose-subr opportunity?
Previous Next
Reported by: Tomas Nordin <tomasn <at> posteo.net>
Date: Fri, 17 Nov 2017 22:01:01 UTC
Severity: wishlist
Tags: patch, wontfix
Done: Lars Ingebrigtsen <larsi <at> gnus.org>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
> From: Tomas Nordin <tomasn <at> posteo.net>
> Date: Fri, 17 Nov 2017 23:00:29 +0100
>
> @@ -6967,7 +6967,7 @@ transpose-subr
> (progn (funcall mover (- x)) (point))))))
> pos1 pos2)
> (cond
> - ((= arg 0)
> + ((or (= arg 0) (use-region-p))
> (save-excursion
> (setq pos1 (funcall aux 1))
> (goto-char (or (mark) (error "No mark set in this buffer")))
>
>
> The intention is that a 0 number prefix argument is not necessary if
> there is a region so that use-region-p is non-nil. I have tried it in
> some various ways and to me it seem to work, but I don't know all the
> delicate ways in which those commands might be used. What do you think?
I think this would be a source of inadvertent mistakes and
annoyances. Transient Mark mode is on by default, which means M-t can
frequently do something the user didn't intend it to, just because the
region happened to be active. A similar situation exists with typing
DEL when the region is active, but at least in that case we behave
like many GUI applications out there, so we can hope the user is ready
for that and expects that to happen. (I'm never ready, which is
probably the reason why I turn Transient Mark mode off.) With M-t, we
don't have that defense.
> It gets a bit silly as suggested though, I guess the logic should be
> something like (or (= arg 0) (and transpose-dwim (use-region-p)))
Maybe. But I wonder why this relatively rare use case is so important
as to mandate a new defcustom, whose only purpose is to save the user
from typing M-0 or "C-u 0". Just because people didn't read the doc
string and therefore didn't know about the special meaning of an
argument of zero? But then they will not know about the proposed
magic, either.
Thanks.
This bug report was last modified 4 years and 289 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.