|
From: | Zachary Kanfer |
Subject: | bug#64185: proposal for new function: copy-line |
Date: | Mon, 26 Jun 2023 15:18:19 -0400 |
>> 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.
[Prev in Thread] | Current Thread | [Next in Thread] |