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

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

Re: Keybinding to transpose current line with next line


From: Emanuel Berg
Subject: Re: Keybinding to transpose current line with next line
Date: Tue, 22 Sep 2020 21:55:12 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux)

Francis Belliveau wrote:

> You could either bind a macro or create a simple
> elisp function

You mean like this?

(defun transpose-next-line ()
  (interactive)
  (beginning-of-line)
  (kill-line)
  (yank)
  (kill-line)
  (forward-line -1)
  (yank) )
(defalias 'tnl #'transpose-next-line) ; [1]


[1] https://dataswamp.org/~incal/emacs-init/geh.el

-- 
underground experts united
http://user.it.uu.se/~embe8573
https://dataswamp.org/~incal




reply via email to

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