GNU bug report logs -
#34798
27.0.50; xclip issue in tramp mode
Previous Next
Reported by: Ergus <spacibba <at> aol.com>
Date: Sat, 9 Mar 2019 23:12:02 UTC
Severity: normal
Tags: fixed
Found in version 27.0.50
Done: Noam Postavsky <npostavs <at> gmail.com>
Bug is archived. No further changes may be made.
Full log
Message #11 received at 34798 <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
Hi.
Yes, I just tried your changes and it looks to be working fine now.
On the other hand it looks like there is a bug or undocumented/unclear feature in the process-file function.
A special comment should be added in all the external process call functions to clarify whats the expected behaviour in tramp mode.
Does it makes sense?
On 11 March 2019 21:16:00 CET, Stefan Monnier <monnier <at> IRO.UMontreal.CA> wrote:
>Ergus <spacibba <at> aol.com> writes:
>
>> Hi:
>>
>> There is an issue in xclip-mode when using tramp
>>
>> emacs -q -nw
>> C-x C-f /ssh:user <at> host:file RET
>> M-x load-file RET xclip.el RET
>> M-x xclip-mode RET
>> abcd C-SPC C-a M-w C-e RET <-1
>> C-y <-2
>> RET <-3
>> C-y M-y RET <-4
>> S-C-v <-5
>>
>> Produces this output:
>> abcd <-1
>> sh: xclip: command not found <-2
>
>Duh! I pushed the patch below which seems to fix it for me.
>
>> abcd <-4
>> abcd <-5
>>
>> As you can see the 2) yanks the error message including a new line.
>> But 4) (emacs yank + yank-pop) yanks the text and 5 (xterm-paste)
>too.
>
>I think these were side-effects of the previous problem.
>xclip-1.8 (to appear soonish) will include this fix.
>
> Stefan
>
>
>diff --git a/packages/xclip/xclip.el b/packages/xclip/xclip.el
>index b142475b5..b1686e14d 100644
>--- a/packages/xclip/xclip.el
>+++ b/packages/xclip/xclip.el
>@@ -1,6 +1,6 @@
>;;; xclip.el --- Copy&paste GUI clipboard from text terminal -*-
>lexical-binding:t -*-
>
>-;; Copyright (C) 2007, 2012, 2013, 2017, 2018 Free Software
>Foundation, Inc.
>+;; Copyright (C) 2007-2019 Free Software Foundation, Inc.
>
> ;; Author: Leo Liu <sdl.web <at> gmail.com>
> ;; Keywords: convenience, tools
>@@ -144,21 +144,21 @@ See also `x-set-selection'."
> (pcase xclip-method
> (`pbpaste
> (when (memq type '(clipboard CLIPBOARD))
>- (process-file xclip-program nil standard-output nil
>+ (call-process xclip-program nil standard-output nil
> "-Prefer" "txt")))
> (`getclip
> (when (memq type '(clipboard CLIPBOARD))
>- (process-file xclip-program nil standard-output nil)))
>+ (call-process xclip-program nil standard-output nil)))
> (`xclip
> (when (getenv "DISPLAY")
>- (process-file xclip-program nil standard-output nil
>+ (call-process xclip-program nil standard-output nil
> "-o" "-selection" (symbol-name type))))
> (`xsel
> (when (and (getenv "DISPLAY")
> (memq type '(clipboard CLIPBOARD
> primary PRIMARY
> secondary SECONDARY)))
>- (process-file xclip-program nil standard-output nil
>+ (call-process xclip-program nil standard-output nil
> "-o" (concat "--" (downcase (symbol-name type))))))
> (method (error "Unknown `xclip-method': %S" method))))))
>
>@@ -281,7 +281,7 @@ Emacs-NN and is then later run by Emacs>NN."
> (or clip-text
> (when (and (memq xclip-method '(xsel xclip)) (getenv "DISPLAY"))
> (let ((primary-text (with-output-to-string
>- (process-file xclip-program nil
>+ (call-process xclip-program nil
> standard-output nil "-o"))))
> (setq primary-text
> (cond ; Check primary selection.
[Message part 2 (text/html, inline)]
This bug report was last modified 6 years and 119 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.