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

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

bug#46621: Copy line


From: Juri Linkov
Subject: bug#46621: Copy line
Date: Wed, 22 Jun 2022 21:24:51 +0300
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (x86_64-pc-linux-gnu)

>>> BTW, what do you think about the already suggested leaving point
>>> at the end of duplicated lines?  This means removing save-excursion
>>> and adding backward-char to the end of `duplicate-line' to move point
>>> before the last newline.
>>
>> It was also suggested to leave point at the start of the duplicated
>> lines.  I think that makes more sense -- the use case here is to copy
>> lines so that you can start altering them, after all.
>
> Behaviour could be different, depending upon what programming construct
> your are in. For example, in C,
>
> #include <a.h>
> #include <b.h>
> ...
>
> if I have to include a new library I’ll go to line-no 2 call
> duplicate-line and then I want the point at the end. But in the
> following lines, I want the opposite behaviour if I want to declare a
> variables of other types.
>
> int a1, b1, c1
> float a2, b2, c2
> // now I want variables of type char
>
> In this case I want the cursor at beginning.
>
> But I feel that former is more useful i.e. point at the end. Think of
> different types of statements in a programming language.

It seems in both cases you expect point to be at the duplicated line,
either at the beginning or the end of the duplicated line.  But the
problem is that currently point stays at the original line.





reply via email to

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