unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#24652: 25.1.50; gui-backend-get-selection does not work in xterm frame
@ 2016-10-09 16:39 Olaf Rogalsky
  2016-12-09  9:30 ` bug#24652: 25.1.50; gui-backend-get-selection does not work in xterm fra Stephane Chauveau
  2021-02-06 12:08 ` bug#24652: 25.1.50; gui-backend-get-selection does not work in xterm frame Lars Ingebrigtsen
  0 siblings, 2 replies; 4+ messages in thread
From: Olaf Rogalsky @ 2016-10-09 16:39 UTC (permalink / raw)
  To: 24652

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;<base64-encoded-clipboard-content>\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;<base64-encoded-clipboard-content>\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))





^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-03-12  1:51 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-10-09 16:39 bug#24652: 25.1.50; gui-backend-get-selection does not work in xterm frame Olaf Rogalsky
2016-12-09  9:30 ` bug#24652: 25.1.50; gui-backend-get-selection does not work in xterm fra Stephane Chauveau
2021-02-06 12:08 ` bug#24652: 25.1.50; gui-backend-get-selection does not work in xterm frame Lars Ingebrigtsen
2021-03-12  1:51   ` Lars Ingebrigtsen

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).