unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#29346: dwim transpose-subr opportunity?
@ 2017-11-17 22:00 Tomas Nordin
  2017-11-18  7:48 ` Eli Zaretskii
  2017-11-25 11:51 ` bug#29346: dwim transpose-subr opportunity new suggestion Tomas Nordin
  0 siblings, 2 replies; 7+ messages in thread
From: Tomas Nordin @ 2017-11-17 22:00 UTC (permalink / raw)
  To: 29346

Hello List

Not a bug report but maybe a feature request. I was wondering if there
is an opportunity for a dwim feature of the transpose-<thing> set of
functions by something like the following:

1 file changed, 1 insertion(+), 1 deletion(-)
lisp/simple.el | 2 +-

modified   lisp/simple.el
@@ -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?

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)))

Best regards
--
Tomas





^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2020-08-10 14:10 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-11-17 22:00 bug#29346: dwim transpose-subr opportunity? Tomas Nordin
2017-11-18  7:48 ` Eli Zaretskii
2017-11-18 13:35   ` Tomas Nordin
2017-11-18 14:45     ` Eli Zaretskii
2017-11-26 13:54       ` Tomas Nordin
2020-08-10 14:10   ` Lars Ingebrigtsen
2017-11-25 11:51 ` bug#29346: dwim transpose-subr opportunity new suggestion Tomas Nordin

Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).