help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Transposing words over middle words


From: Bob Proulx
Subject: Re: Transposing words over middle words
Date: Thu, 16 Nov 2017 15:55:17 -0700
User-agent: NeoMutt/20170609 (1.8.3)

Emanuel Berg wrote:
> Marcin Borkowski wrote:
> > I had no idea! How cool is that?
> > Thanks a lot!!!
> 
> Cool indeed, but the mark business makes it as
> complicated anyway compared with transposing
> two times:

Yes.  Agreed.

> (defun transpose-over-word ()
>   (interactive)
>   (transpose-subr #'forward-word  2)
>   (backward-word 1)
>   (transpose-subr #'forward-word -1) )

This is a nice example of the joy of customizing emacs.  For my tastes
I would want it to move the point with the word being dragged forward
two words.  Here is my modification to the above.

 (defun transpose-over-word ()
   (interactive)
   (transpose-subr #'forward-word  2)
   (backward-word 1)
   (transpose-subr #'forward-word -1) 
   (forward-word 1) )

That actually does exactly what I would want M-1 M-t to do.

Bob



reply via email to

[Prev in Thread] Current Thread [Next in Thread]