From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Philipp Stephani Newsgroups: gmane.emacs.devel Subject: Re: X selection access in xterm (OSC 52) Date: Tue, 24 Mar 2015 15:14:00 +0000 Message-ID: References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=001a1135ea4680b59b05120a3ba4 X-Trace: ger.gmane.org 1427210056 22348 80.91.229.3 (24 Mar 2015 15:14:16 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 24 Mar 2015 15:14:16 +0000 (UTC) Cc: Emacs developers , Yuri Khan To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Mar 24 16:14:15 2015 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1YaQWu-0001hx-Pf for ged-emacs-devel@m.gmane.org; Tue, 24 Mar 2015 16:14:08 +0100 Original-Received: from localhost ([::1]:32982 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YaQWt-0007FV-GE for ged-emacs-devel@m.gmane.org; Tue, 24 Mar 2015 11:14:07 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:46385) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YaQWo-0007EG-MH for emacs-devel@gnu.org; Tue, 24 Mar 2015 11:14:03 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YaQWn-0007Z9-I1 for emacs-devel@gnu.org; Tue, 24 Mar 2015 11:14:02 -0400 Original-Received: from mail-wi0-x235.google.com ([2a00:1450:400c:c05::235]:37713) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YaQWn-0007Yu-CL for emacs-devel@gnu.org; Tue, 24 Mar 2015 11:14:01 -0400 Original-Received: by wixw10 with SMTP id w10so99234995wix.0 for ; Tue, 24 Mar 2015 08:14:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-type; bh=ldrysTDDxzrUDnTy8e/yr/0e72XZGZeJS7mE2ABSC00=; b=jDhCkniiR5YJJOQ/MSEFZYNYettSZuX7VWcU1JyZwn1SPWulVphA5isSKKiy4YH/Pv tN3fNWO0yDPaIWKcYhV+3KgUJS0fClxt/1fV5ukIT1uuUCavJ7jCd+Iw+asEC/qqzUZ3 FnJTA40Kv2BetGDa6poMKVlHcLRRj5QfkOEZswI+JmYd6zyhbWXEQ3bKSL0aHK0r0zJc 7DBuPcJroLZzc07MTEvqQJKxEELdNfmvp+742qc8TsH8swFOZ1IEauslG/QblD2w8x8L t0SM5+s+NO7H6rQeoE+9A6KBfs3FEU61W9fKpIBCgD/X5rZc13WDznc/okHH0H8qkwod g2hw== X-Received: by 10.180.218.162 with SMTP id ph2mr28880260wic.22.1427210040815; Tue, 24 Mar 2015 08:14:00 -0700 (PDT) In-Reply-To: X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:400c:c05::235 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:184153 Archived-At: --001a1135ea4680b59b05120a3ba4 Content-Type: text/plain; charset=UTF-8 > > > >> >> > + (setq interprogram-cut-function >> > + (if (string-prefix-p "screen" (getenv "TERM")) >> > + #'xterm--screen-interprogram-cut >> > + #'xterm--interprogram-cut))) >> >> Please don't change interprogram-cut-function, since this breaks down if >> you use a single Emacs session with both GUI and text frames (and with >> potentially various different terminal kinds). >> >> Instead use gui-method-declare for gui-set-selection (new in Emacs-25). >> > > Thanks, I'll modify the patch accordingly tomorrow. > > Sorry for the delay. I've tried implementing this, but I'm a bit at a loss here: If I understand the GUI method code correctly, it only works for real GUIs, not terminal emulators that happen to be GUI applications, right? At least the window-system variable, which gui-method apparently uses, is always nil in my tests with hterm. Should this be something like 'xterm? --001a1135ea4680b59b05120a3ba4 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
=
=C2=A0

> +=C2=A0 (setq interprogram-cut-function
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 (if (string-prefix-p "screen" (= getenv "TERM"))
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 #'xterm--screen-interpr= ogram-cut
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 #'xterm--interprogram-cut)))
Please don't change interprogram-cut-function, since this breaks down i= f
you use a single Emacs session with both GUI and text frames (and with
potentially various different terminal kinds).

Instead use gui-method-declare for gui-set-selection (new in Emacs-25).
=

Thanks, I'll modify the patch accordingly tomorrow.
=
=C2=A0

Sorry for the delay. I've tr= ied implementing this, but I'm a bit at a loss here: If I understand th= e GUI method code correctly, it only works for real GUIs, not terminal emul= ators that happen to be GUI applications, right? At least the window-system= variable, which gui-method apparently uses, is always nil in my tests with= hterm. Should this be something like 'xterm?=C2=A0
--001a1135ea4680b59b05120a3ba4--