Re: move-lines.el: a lazy programmer's package to move lines around

Philip Kaludercic <[email protected]>
Newsgroups gmane.emacs.devel
Message-ID <[email protected]>
"Pedro A. Aranda" <[email protected]> writes:

> Hi
>
> I'm back from my Internet-free month and ready to start a fruitful
> discussion.
>
> First of all, thanks for the interest and the encouragement. It was a
> temptation to take my computer to the holidays and work on this, but I
> resisted :-)
>
> Things that have come up and I've been maturing:
>
> 1.- landscape: I need to start browsing ELPA to find other packages
> that could implement something like this. I recognise that I've been
> using move-text for too long to look for alternatives.

Also recall that transpose-lines exists in Emacs.

> 2.- (maybe this should be first) my motivation: I was using move-text
> to move one or more lines. When writing pure text, a paragraph is just
> a block of lines and when I needed to move a sentence, I'd select the
> sentence, kill it to the kill-buffer and yank it at its new position.
> move-text wasn't intuitive for this and I never tried to hard to learn
> how to do it.

Have you taken a look at Embark or my do-at-point package?  It might
provide some inspiration.  It might be interesting to provide some
generalized tranpose-thing command.

> 3.- repeat-maps: Never used them, but happy to learn how to use them :-)
>
> My main concern is that I don't know how to write one for the situation:
>
> Currently, I'm using C-S-up and C-S-down and I think I would be able
> to write a repeat-map for this. However, suppose user uses C-S-up and
> C-S-down to mark paragraphs and wants to remap move-lines-up and
> move-lines-down. Is there a way to reflect the new bindings in a repeat map?

They would also have to update the repeat map in that case.

> 4.- Contributing the code: there are already a couple lines of mine in
> Emacs plain and I'm contributing a bit more to org-mode, so I don't
> think it would be a problem.

What is this in reference to?  Have you signed the FSF copyright assignment?

> Best, /PA
>
>
> On 11/08/2026 06:44, Richard Stallman wrote:
>> [[[ To any NSA and FBI agents reading my email: please consider    ]]]
>> [[[ whether defending the US Constitution against all enemies,     ]]]
>> [[[ foreign or domestic, requires you to follow Snowden's example. ]]]
>>    > >>> What exactly is your concern here?  Having a command that
>> can move
>>    > >>> around text in an interactive setting is useful in general, but also not
>>    > >>> something that we expect to be upgraded and extended extensively, so
>>    > >>> having it stable and complete in core sounds like a good idea to me,
>> That's what I thought, too, when I first saw this.  Also, I think it
>> is worth some effort and discussion to choose a command interface that
>> is very natural and easy for people to remember.
>> That could make the difference between a useful feature and a very
>> handy feature.
>>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.