all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Ergus <spacibba@aol.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: emacs-devel@gnu.org, larsi@gnus.org
Subject: Re: master 6362f65474: Add new command `duplicate-line'
Date: Sun, 19 Jun 2022 00:22:25 +0200	[thread overview]
Message-ID: <20220618222225.3ajabf4otw7ze3pn@Ergus> (raw)
In-Reply-To: <835ykxoqwh.fsf@gnu.org>

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	other threads:[~2022-06-18 22:22 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <165548727183.24473.6170306052807994962@vcs2.savannah.gnu.org>
     [not found] ` <20220617173432.17B6FC00BAF@vcs2.savannah.gnu.org>
2022-06-17 17:44   ` master 6362f65474: Add new command `duplicate-line' Visuwesh
2022-06-17 17:47     ` Lars Ingebrigtsen
2022-06-18 16:30     ` Ergus
2022-06-18 16:52       ` Eli Zaretskii
2022-06-18 22:22         ` Ergus [this message]
2022-06-19  5:55           ` Eli Zaretskii
2022-06-19 11:55           ` Andreas Schwab
2022-06-19 11:06       ` Lars Ingebrigtsen
2022-06-19 17:10         ` [External] : " Drew Adams
2022-06-19  5:53 Pedro Andres Aranda Gutierrez

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220618222225.3ajabf4otw7ze3pn@Ergus \
    --to=spacibba@aol.com \
    --cc=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=larsi@gnus.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.