GNU bug report logs - #31097
27.0.50; Interprogram paste is destructively modified

Previous Next

Package: emacs;

Reported by: "Basil L. Contovounesios" <contovob <at> tcd.ie>

Date: Sun, 8 Apr 2018 15:11:01 UTC

Severity: minor

Tags: fixed, patch

Found in version 27.0.50

Fixed in version 27.1

Done: Noam Postavsky <npostavs <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


Message #18 received at 31097 <at> debbugs.gnu.org (full text, mbox):

From: "Basil L. Contovounesios" <contovob <at> tcd.ie>
To: Noam Postavsky <npostavs <at> gmail.com>
Cc: 31097 <at> debbugs.gnu.org
Subject: Re: bug#31097: 27.0.50; Interprogram paste is destructively modified
Date: Fri, 13 Apr 2018 12:56:38 +0100
[0001-Do-not-destructively-modify-interprogram-paste.patch (text/x-diff, attachment)]
[Message part 2 (text/plain, inline)]
Noam Postavsky <npostavs <at> gmail.com> writes:

> "Basil L. Contovounesios" <contovob <at> tcd.ie> writes:
>
>> * simple.el (kill-new, current-kill): Non-destructively reverse list
>> returned by interprogram-paste-function. (bug#31097)
>
> Seems reasonable.  Perhaps add some comments in case someone tries to
> "optimize" it later?

Are the comments in the updated patch attached clear enough?

>>  If optional arg DO-NOT-MOVE is non-nil, then don't actually
>>  move the yanking point; just return the Nth kill forward."
>> -
>>   (let ((interprogram-paste (and (= n 0)
>
>> -      (let ((ARGth-kill-element
>> +      (let ((nth-kill-element
>>  	     (nthcdr (mod (- n (length kill-ring-yank-pointer))
>>  			  (length kill-ring))
>>  		     kill-ring)))
>>  	(unless do-not-move
>> -	  (setq kill-ring-yank-pointer ARGth-kill-element)
>> +          (setq kill-ring-yank-pointer nth-kill-element)
>>  	  (when (and yank-pop-change-selection
>>  		     (> n 0)
>>  		     interprogram-cut-function)
>> -	    (funcall interprogram-cut-function (car ARGth-kill-element))))
>> -	(car ARGth-kill-element)))))
>> +            (funcall interprogram-cut-function (car nth-kill-element))))
>> +        (car nth-kill-element)))))
>
> I don't think these hunks are needed.

Fair enough, I just thought it was strange having an ARGth element
without an ARG.

Thanks,

-- 
Basil

This bug report was last modified 7 years and 44 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.