From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Olaf Rogalsky Newsgroups: gmane.emacs.bugs Subject: bug#24652: 25.1.50; gui-backend-get-selection does not work in xterm frame Date: Sun, 09 Oct 2016 18:39:13 +0200 Message-ID: <87vax1zdce.fsf@aol.de> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1476036588 685 195.159.176.226 (9 Oct 2016 18:09:48 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 9 Oct 2016 18:09:48 +0000 (UTC) To: 24652@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Oct 09 20:09:44 2016 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1btIXJ-000575-37 for geb-bug-gnu-emacs@m.gmane.org; Sun, 09 Oct 2016 20:09:21 +0200 Original-Received: from localhost ([::1]:45162 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1btIXH-0007Ac-GT for geb-bug-gnu-emacs@m.gmane.org; Sun, 09 Oct 2016 14:09:19 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:52764) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1btIX5-00078w-Vy for bug-gnu-emacs@gnu.org; Sun, 09 Oct 2016 14:09:09 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1btIX0-0007s9-Nh for bug-gnu-emacs@gnu.org; Sun, 09 Oct 2016 14:09:05 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:44026) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1btIX0-0007s4-JP for bug-gnu-emacs@gnu.org; Sun, 09 Oct 2016 14:09:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1btIX0-0000UO-FQ for bug-gnu-emacs@gnu.org; Sun, 09 Oct 2016 14:09:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Olaf Rogalsky Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 09 Oct 2016 18:09:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 24652 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.14760365071813 (code B ref -1); Sun, 09 Oct 2016 18:09:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 9 Oct 2016 18:08:27 +0000 Original-Received: from localhost ([127.0.0.1]:50214 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1btIWR-0000TB-0M for submit@debbugs.gnu.org; Sun, 09 Oct 2016 14:08:27 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:54046) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1btHWk-0007Jv-6u for submit@debbugs.gnu.org; Sun, 09 Oct 2016 13:04:42 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1btHWd-0000pu-HU for submit@debbugs.gnu.org; Sun, 09 Oct 2016 13:04:37 -0400 Original-Received: from lists.gnu.org ([2001:4830:134:3::11]:33730) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1btHWd-0000pe-EN for submit@debbugs.gnu.org; Sun, 09 Oct 2016 13:04:35 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:45010) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1btHWa-0007Ja-Hz for bug-gnu-emacs@gnu.org; Sun, 09 Oct 2016 13:04:34 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1btHWW-0000nb-6B for bug-gnu-emacs@gnu.org; Sun, 09 Oct 2016 13:04:31 -0400 Original-Received: from omr-m013e.mx.aol.com ([204.29.186.14]:56252) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1btHWV-0000nB-V0 for bug-gnu-emacs@gnu.org; Sun, 09 Oct 2016 13:04:28 -0400 Original-Received: from mtaout-aan01.mx.aol.com (mtaout-aan01.mx.aol.com [172.27.19.77]) by omr-m013e.mx.aol.com (Outbound Mail Relay) with ESMTP id F21DC3800081 for ; Sun, 9 Oct 2016 12:42:14 -0400 (EDT) Original-Received: from blaubaer (dslb-084-063-095-023.084.063.pools.vodafone-ip.de [84.63.95.23]) (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by mtaout-aan01.mx.aol.com (MUA/Third Party Client Interface) with ESMTPSA id 4CA663800008D for ; Sun, 9 Oct 2016 12:42:13 -0400 (EDT) x-aol-global-disposition: G DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mx.aol.de; s=20150623; t=1476031334; bh=5+cld8c5FQP1nWd+9qdlGkF3CIQhC/VDG5UPGGz8+Z0=; h=From:To:Subject:Message-ID:Date:MIME-Version:Content-Type; b=ddQb/2WsHshVeoX+AWWxiP9ZXfmDckma4aossen3YPVMZShWARPWTocpRa9s2Mei9 zybfuaHGiOINiT8zexhSthArPhhLOlQwGjsg0/hEFw/tY4uBjcOWfs8r3UyYgiGEqA T2T/dyjce1C6nCyEZgILV6qxDzo/Naw6+dsXQazM= x-aol-sid: 3039ac1b134d57fa736551c5 X-AOL-IP: 84.63.95.23 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x-2.6.x [generic] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Mailman-Approved-At: Sun, 09 Oct 2016 14:08:25 -0400 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: 208.118.235.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:124277 Archived-At: Hi emacs, I try to get `gui-backend-get-selection' to work with xterm: # In a xterm (version 324): # 1.) put some text into the clipboard: echo foobar | xsel -i -b # 2.) try to insert the clipboard into a fresh *scratch* buffer: emacs -nw -Q --eval "(progn (xterm--init-activate-get-selection) (insert (gui-backend-get-selection 'CLIPBOARD 'STRING)))" No text from the clipboard is inserted, instead "Quit" is displayed in the echo area. # 3.) for further insight, lets do the same with (setq inhibit-quit t): emacs -nw -Q --eval "(progn (setq inhibit-quit t) (xterm--init-activate-get-selection) (insert (gui-backend-get-selection 'CLIPBOARD 'STRING)))" Now the clipboard content is inserted! My undestanding of the problem is: The xterm escape sequence to query the clipboard content is: "\e]52;p;?\a" and xterm responds to this with "\e]52;p;\a" Note, that the last character of the response is an "\a", which is the same as the keyboard quit key "\C-g" and hence, the gui-backend-get-selection command is aborted before finsishing its work. Possible solution: There is an alternative escape sequence for querying the clipoard content: "\e]52;p;?\e\\" and the response to this is "\e]52;p;\e\\" which does not suffer from the "\C-g" abortion. Thanks, Olaf In GNU Emacs 25.1.50.1 (x86_64-unknown-linux-gnu, GTK+ Version 3.10.8, cairo version 1.13.1) of 2016-09-21 built on blaubaer Repository revision: d9741b61c8e446de084cc4dc609aaa8e5702118d System Description: Ubuntu 14.04.4 LTS Recent messages: Mark saved where search started Making completion list... Quit Composing main Info directory...done Making completion list... C-x n C-g is undefined Updating buffer list...done Commands: m, u, t, RET, g, k, S, D, Q; q to quit; h for help Entering debugger... Quit [2 times] Configured using: 'configure --prefix /home/olaf/local --with-x-toolkit=gtk3 --with-cairo --with-modules --with-file-notification --without-gconf --without-gsettings PKG_CONFIG_PATH=/home/olaf/local/lib/pkgconfig --infodir /home/olaf/local/share/info --infodir=/home/olaf/local/share/info' Configured features: XPM JPEG TIFF GIF PNG RSVG CAIRO IMAGEMAGICK SOUND GPM DBUS NOTIFY ACL LIBSELINUX GNUTLS LIBXML2 FREETYPE M17N_FLT LIBOTF XFT ZLIB TOOLKIT_SCROLL_BARS GTK3 X11 MODULES Important settings: value of $LANG: de_DE.UTF-8 value of $XMODIFIERS: @im=ibus locale-coding-system: utf-8-unix Major mode: Emacs-Lisp Minor modes in effect: diff-auto-refine-mode: t savehist-mode: t save-place-mode: t global-page-break-lines-mode: t page-break-lines-mode: t rainbow-delimiters-mode: t indent-guide-global-mode: t indent-guide-mode: t global-company-mode: t company-mode: t recentf-mode: t xterm-mouse-mode: t override-global-mode: t auto-compile-on-load-mode: t auto-compile-on-save-mode: t auto-compile-mode: t tooltip-mode: t global-eldoc-mode: t electric-indent-mode: t mouse-wheel-mode: t tool-bar-mode: t menu-bar-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t blink-cursor-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t size-indication-mode: t column-number-mode: t line-number-mode: t transient-mark-mode: t Load-path shadows: /home/olaf/local/share/emacs/site-lisp/emms/tq hides /home/olaf/local/share/emacs/25.1.50/lisp/emacs-lisp/tq Features: (shadow mail-extr filecache emacsbug message subr-x puny rfc822 mml mml-sec epa derived epg gnus-util rmail rmail-loaddefs mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums mm-util mail-prsvr mail-utils info misearch multi-isearch pulse find-func thingatpt ibuf-ext ibuffer ibuffer-loaddefs help-fns radix-tree debug warnings compile comint vc-git diff-mode map term/xterm xterm disp-table company-oddmuse company-keywords company-etags etags xref project ring company-gtags company-dabbrev-code company-dabbrev company-files company-capf company-cmake company-xcode company-clang company-semantic company-eclim company-template company-css company-nxml company-bbdb my-tests my-key-bindings my-audio eap-autoloads eap-dired-keybindings my-packages emms-librefm-stream xml emms-librefm-scrobbler emms-playlist-limit emms-volume emms-volume-amixer emms-i18n emms-history emms-score emms-stream-info emms-metaplaylist-mode emms-bookmarks emms-cue emms-mode-line-icon emms-browser sort emms-playlist-sort emms-last-played emms-player-xine emms-player-mpd tq emms-playing-time emms-lyrics emms-url url url-proxy url-privacy url-expand url-methods url-history url-cookie url-domsuf url-util mailcap emms-streams emms-tag-editor format-spec emms-mark emms-mode-line emms-cache emms-info-ogginfo emms-info-mp3info emms-info later-do emms-playlist-mode emms-player-vlc emms-player-mplayer emms-player-simple emms-source-playlist emms-source-file locate dired dired-loaddefs emms-setup emms emms-compat savehist saveplace page-break-lines paren mic-paren rainbow-delimiters rainbow-mode ansi-color color indent-guide windmove browse-kill-ring loccur yank-pop-improved company edmacro kmacro recentf tree-widget wid-edit linum xt-mouse use-package diminish bind-key easy-mmode my-tex my-defaults my-functions my-xterm time-date delsel cus-start jka-compr cus-load sanityinc-tomorrow-eighties-theme color-theme-sanityinc-tomorrow auto-compile advice packed dash finder-inf package epg-config url-handlers url-parse auth-source cl-seq eieio eieio-core cl-macs eieio-loaddefs password-cache url-vars seq byte-opt gv bytecomp byte-compile cl-extra help-mode easymenu cconv cl-loaddefs pcase cl-lib mule-util tooltip eldoc electric uniquify ediff-hook vc-hooks lisp-float-type mwheel term/x-win x-win term/common-win x-dnd tool-bar dnd fontset image regexp-opt fringe tabulated-list newcomment elisp-mode lisp-mode prog-mode register page menu-bar rfn-eshadow timer select scroll-bar mouse jit-lock font-lock syntax facemenu font-core term/tty-colors frame cl-generic cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms cp51932 hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese charscript case-table epa-hook jka-cmpr-hook help simple abbrev obarray minibuffer cl-preloaded nadvice loaddefs button faces cus-face macroexp files text-properties overlay sha1 md5 base64 format env code-pages mule custom widget hashtable-print-readable backquote dbusbind inotify dynamic-setting font-render-setting cairo move-toolbar gtk x-toolkit x multi-tty make-network-process emacs) Memory information: ((conses 16 243748 15982) (symbols 48 30612 0) (miscs 40 120 557) (strings 32 56664 5894) (string-bytes 1 1720863) (vectors 16 25121) (vector-slots 8 545849 2832) (floats 8 496 1920) (intervals 56 4573 90) (buffers 976 21) (heap 1024 48333 3644))