From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.bugs Subject: bug#34798: 27.0.50; xclip issue in tramp mode Date: Mon, 11 Mar 2019 16:16:00 -0400 Message-ID: References: <20190309231128.vo3vraxbgpskpcot@Ergus> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="64478"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) Cc: 34798@debbugs.gnu.org To: Ergus Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Mar 11 21:26:31 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1h3RVH-000GfD-Fe for geb-bug-gnu-emacs@m.gmane.org; Mon, 11 Mar 2019 21:26:31 +0100 Original-Received: from localhost ([127.0.0.1]:39827 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h3RVG-0008Ep-EE for geb-bug-gnu-emacs@m.gmane.org; Mon, 11 Mar 2019 16:26:30 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:45576) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h3RPd-0003Iq-HR for bug-gnu-emacs@gnu.org; Mon, 11 Mar 2019 16:20:42 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h3RM6-0005e4-R0 for bug-gnu-emacs@gnu.org; Mon, 11 Mar 2019 16:17:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:54222) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1h3RM6-0005dF-MO for bug-gnu-emacs@gnu.org; Mon, 11 Mar 2019 16:17:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1h3RM6-0001tl-DS for bug-gnu-emacs@gnu.org; Mon, 11 Mar 2019 16:17:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 11 Mar 2019 20:17:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 34798 X-GNU-PR-Package: emacs Original-Received: via spool by 34798-submit@debbugs.gnu.org id=B34798.15523353677221 (code B ref 34798); Mon, 11 Mar 2019 20:17:02 +0000 Original-Received: (at 34798) by debbugs.gnu.org; 11 Mar 2019 20:16:07 +0000 Original-Received: from localhost ([127.0.0.1]:39533 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1h3RLD-0001sP-3N for submit@debbugs.gnu.org; Mon, 11 Mar 2019 16:16:07 -0400 Original-Received: from pruche.dit.umontreal.ca ([132.204.246.22]:50028) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1h3RLB-0001sG-6t for 34798@debbugs.gnu.org; Mon, 11 Mar 2019 16:16:06 -0400 Original-Received: from pastel.home (lechon.iro.umontreal.ca [132.204.27.242]) by pruche.dit.umontreal.ca (8.14.7/8.14.1) with ESMTP id x2BKG0HT008972; Mon, 11 Mar 2019 16:16:00 -0400 Original-Received: by pastel.home (Postfix, from userid 20848) id 8C117623AD; Mon, 11 Mar 2019 16:16:00 -0400 (EDT) In-Reply-To: <20190309231128.vo3vraxbgpskpcot@Ergus> (Ergus's message of "Sun, 10 Mar 2019 00:11:28 +0100") X-NAI-Spam-Flag: NO X-NAI-Spam-Threshold: 5 X-NAI-Spam-Score: 0 X-NAI-Spam-Rules: 2 Rules triggered EDT_SA_DN_PASS=0, RV6500=0 X-NAI-Spam-Version: 2.3.0.9418 : core <6500> : inlines <7031> : streams <1815425> : uri <2810976> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:156248 Archived-At: Ergus writes: > Hi: > > There is an issue in xclip-mode when using tramp > > emacs -q -nw > C-x C-f /ssh:user@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 ;; 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.