Subject: bug#64185: proposal for new function: copy-line

From: Zachary Kanfer <[email-masked]>
Date: Mon, 26 Jun 2023 15:18:19 -0400

> > The code becomes slightly more verbose this way, but is far easier to
read
> > and comprehend. It seems an extremely worthwhile tradeoff to me.
>
> Not sure how often users will read the code of duplicate-line.

Developers will. And it's easier to read with symbols.

On Mon, Jun 26, 2023 at 1:41 PM Juri Linkov <[email-masked]> wrote:

> >> This might surprise you, but code would be more complicated with
> symbols.
> >> Instead of
> >>
> >>   (unless (eq duplicate-line-final-position 0)
> >>     (forward-line duplicate-line-final-position)
> >>
> >> it will be
> >>
> >>   (unless (eq duplicate-line-final-position 'old-original-line)
> >>     (when (eq duplicate-line-final-position
> 'first-copied-duplicate-line)
> >>       (forward-line 1))
> >>     (when (eq duplicate-line-final-position 'last-copied-duplicate-line)
> >>       (forward-line -1))
> >
> > The code doesn't need the (unless (eq duplicate-line-final-position
> > 'old-original-line) ... check. It can be only the two when cases. But
> > that's a secondary matter.
>
> I agree.
>
> > The code becomes slightly more verbose this way, but is far easier to
> read
> > and comprehend. It seems an extremely worthwhile tradeoff to me.
>
> Not sure how often users will read the code of duplicate-line.
>