emacs-devel
[Top][All Lists]
Advanced

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

Re: master 6362f65474: Add new command `duplicate-line'


From: Ergus
Subject: Re: master 6362f65474: Add new command `duplicate-line'
Date: Sun, 19 Jun 2022 00:22:25 +0200

On Sat, Jun 18, 2022 at 07:52:30PM +0300, Eli Zaretskii wrote:
Date: Sat, 18 Jun 2022 18:30:43 +0200
From: Ergus <spacibba@aol.com>

2) From the same package may we consider a command "move-line", which in
the same fashion the user could bind to move the current line up/down?

Isn't that what transpose-lines already provides?

Actually no, transpose-lines is very confusing from the user point of
view... because the line moved is not the current one, but the previous
one...

but also, the cursor moves with it but not to it, but to the beginning
of the next one, so we lost the current column position and line; so it
looks like a command that acts outside the current position and moves
the cursor to random places.

Moving the current line one row up means all these steps:

(let ((column (current-column)))
     (next-line)
     (transpose-lines -1)
     (previous-line)
     (forward-char column))

Could we make user live easier for simple editing stuff??

These commands + a repeat keymap are very useful?

Best,
Ergus


reply via email to

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