Subject: 24.5; Paste from clipboard to emacs -nw on windows 8.1

From: Pablo Mercader Alcántara <[email-masked]>
Date: Wed, 5 Aug 2015 20:06:19 -0400

Some days ago I installed version 24.5, in the previous version that I
used (24.3) everything was fine.

I start my emacs session with the "-nw" command line option. And
proceeded to work. Everything works fine, except that now after the
update the text that I kill on emacs doesn't go into windows
clipboard. I can paste on emacs text coming from other programs through
the clipboard, but the inverse is not possible.

When I start emacs normally (without "-nw") everything works fine, so at
first I thought that this was some kind of new configuration. Later I
decided to make some research and found where the problem was. Looking
at the value of the variable "interprogram-cut-function" in my system I
see that it's set to "x-select-text" and in my system this function is
defined at "common-win.el". In the body of "x-select-text" the first
"cond" function is like this "(cond ((eq (framep (selected-frame)) 'w32)
..." and I think this is the cause for the kill function to be unable to
send the text to the clipboard when running with the "-nw" option,
because when emacs runs in this mode the call "(framep
(selected-frame))" returns "t" when it is waiting for a "w32"
value. When the same call is run on the emacs running whithout the "-nw"
option the expected "w32" value appears.

I was also curious about why the yank function does work so, I went to
see the source of the "x-get-selection-value" function too. It turns out
that it's even defined on a different source file named
"w32-common-fns.el". Seeing that I think that only the windows version
defines this function this way, and I can't see anything like the
"framep" function arround here so there is the problem.

Thanks for the great emacs editor! I really admire this project!

In GNU Emacs 24.5.1 (i686-pc-mingw32)
 of 2015-04-11 on LEG570
Windowing system distributor `Microsoft Corp.', version 6.3.9600
Configured using:
 `configure --prefix=/c/usr --host=i686-pc-mingw32'

Important settings:
  value of $LANG: ESD
  locale-coding-system: cp1252

Major mode: Help

Minor modes in effect:
  yas-global-mode: t
  yas-minor-mode: t
  tooltip-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
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  buffer-read-only: t
  line-number-mode: t
  transient-mark-mode: t

Recent messages:
End of buffer [2 times]
x-get-selection-value
Quit
x-get-selection-value
Type "q" to restore previous buffer.
You can run the command `describe-function' with C-h f
Type "q" to restore previous buffer.
C-x C-g is undefined
Quit
Making completion list...

Load-path shadows:
c:/Users/pmercader/AppData/Roaming/.emacs.d/elpa/csharp-mode-20150714.138/csharp-mode
hides d:/share/emacs/share/emacs/site-lisp/nxhtml/related/csharp-mode
d:/share/emacs/share/emacs/site-lisp/yasnippet/snippets/c++-mode/.yas-compiled-snippets
hides d:/share/emacs/share/emacs/site-lisp/yasnippet/snippets/c-mode/.yas-compiled-snippets
d:/share/emacs/share/emacs/site-lisp/yasnippet/snippets/c++-mode/.yas-compiled-snippets
hides d:/share/emacs/share/emacs/site-lisp/yasnippet/snippets/cc-mode/.yas-compiled-snippets
d:/share/emacs/share/emacs/site-lisp/yasnippet/snippets/c++-mode/.yas-compiled-snippets
hides d:/share/emacs/share/emacs/site-lisp/yasnippet/snippets/cperl-mode/.yas-compiled-snippets
d:/share/emacs/share/emacs/site-lisp/yasnippet/snippets/c++-mode/.yas-compiled-snippets
hides d:/share/emacs/share/emacs/site-lisp/yasnippet/snippets/csharp-mode/.yas-compiled-snippets
d:/share/emacs/share/emacs/site-lisp/yasnippet/snippets/c++-mode/.yas-compiled-snippets
hides d:/share/emacs/share/emacs/site-lisp/yasnippet/snippets/css-mode/.yas-compiled-snippets
d:/share/emacs/share/emacs/site-lisp/yasnippet/snippets/c++-mode/.yas-compiled-snippets
hides d:/share/emacs/share/emacs/site-lisp/yasnippet/snippets/emacs-lisp-mode/.yas-compiled-snippets
d:/share/emacs/share/emacs/site-lisp/yasnippet/snippets/c++-mode/.yas-compiled-snippets
hides d:/share/emacs/share/emacs/site-lisp/yasnippet/snippets/erlang-mode/.yas-compiled-snippets
d:/share/emacs/share/emacs/site-lisp/yasnippet/snippets/c++-mode/.yas-compiled-snippets
hides d:/share/emacs/share/emacs/site-lisp/yasnippet/snippets/f90-mode/.yas-compiled-snippets
d:/share/emacs/share/emacs/site-lisp/yasnippet/snippets/c++-mode/.yas-compiled-snippets
hides d:/share/emacs/share/emacs/site-lisp/yasnippet/snippets/html-mode/.yas-compiled-snippets
d:/share/emacs/share/emacs/site-lisp/yasnippet/snippets/c++-mode/.yas-compiled-snippets
hides d:/share/emacs/share/emacs/site-lisp/yasnippet/snippets/js-mode/.yas-compiled-snippets
d:/share/emacs/share/emacs/site-lisp/yasnippet/snippets/c++-mode/.yas-compiled-snippets
hides d:/share/emacs/share/emacs/site-lisp/yasnippet/snippets/latex-mode/.yas-compiled-snippets
d:/share/emacs/share/emacs/site-lisp/yasnippet/snippets/c++-mode/.yas-compiled-snippets
hides d:/share/emacs/share/emacs/site-lisp/yasnippet/snippets/markdown-mode/.yas-compiled-snippets
d:/share/emacs/share/emacs/site-lisp/yasnippet/snippets/c++-mode/.yas-compiled-snippets
hides d:/share/emacs/share/emacs/site-lisp/yasnippet/snippets/nxml-mode/.yas-compiled-snippets
d:/share/emacs/share/emacs/site-lisp/yasnippet/snippets/c++-mode/.yas-compiled-snippets
hides d:/share/emacs/share/emacs/site-lisp/yasnippet/snippets/objc-mode/.yas-compiled-snippets
d:/share/emacs/share/emacs/site-lisp/yasnippet/snippets/c++-mode/.yas-compiled-snippets
hides d:/share/emacs/share/emacs/site-lisp/yasnippet/snippets/perl-mode/.yas-compiled-snippets
d:/share/emacs/share/emacs/site-lisp/yasnippet/snippets/c++-mode/.yas-compiled-snippets
hides d:/share/emacs/share/emacs/site-lisp/yasnippet/snippets/python-mode/.yas-compiled-snippets
d:/share/emacs/share/emacs/site-lisp/yasnippet/snippets/c++-mode/.yas-compiled-snippets
hides d:/share/emacs/share/emacs/site-lisp/yasnippet/snippets/rst-mode/.yas-compiled-snippets
d:/share/emacs/share/emacs/site-lisp/yasnippet/snippets/c++-mode/.yas-compiled-snippets
hides d:/share/emacs/share/emacs/site-lisp/yasnippet/snippets/ruby-mode/.yas-compiled-snippets
d:/share/emacs/share/emacs/site-lisp/yasnippet/snippets/c++-mode/.yas-compiled-snippets
hides d:/share/emacs/share/emacs/site-lisp/yasnippet/snippets/scala-mode/.yas-compiled-snippets
d:/share/emacs/share/emacs/site-lisp/yasnippet/snippets/c++-mode/.yas-compiled-snippets
hides d:/share/emacs/share/emacs/site-lisp/yasnippet/snippets/snippet-mode/.yas-compiled-snippets
d:/share/emacs/share/emacs/site-lisp/yasnippet/snippets/c++-mode/.yas-compiled-snippets
hides d:/share/emacs/share/emacs/site-lisp/yasnippet/snippets/sql-mode/.yas-compiled-snippets
d:/share/emacs/share/emacs/site-lisp/yasnippet/snippets/c++-mode/.yas-compiled-snippets
hides d:/share/emacs/share/emacs/site-lisp/yasnippet/snippets/text-mode/.yas-compiled-snippets
d:/share/emacs/share/emacs/site-lisp/yasnippet/extras/imported/html-mode/.yas-setup
hides d:/share/emacs/share/emacs/site-lisp/yasnippet/extras/imported/objc-mode/.yas-setup
d:/share/emacs/share/emacs/site-lisp/yasnippet/extras/imported/html-mode/.yas-setup
hides d:/share/emacs/share/emacs/site-lisp/yasnippet/extras/imported/rails-mode/.yas-setup
d:/share/emacs/share/emacs/site-lisp/yasnippet/extras/imported/html-mode/.yas-setup
hides d:/share/emacs/share/emacs/site-lisp/yasnippet/extras/imported/ruby-mode/.yas-setup
d:/share/emacs/share/emacs/site-lisp/nxhtml/tests/ert hides
d:/share/emacs/share/emacs/24.5/lisp/emacs-lisp/ert

Features:
(shadow sort gnus-util mail-extr emacsbug message format-spec rfc822 mml
mml-sec mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev
gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums mm-util
mail-prsvr mail-utils find-func debug apropos misearch multi-isearch
time-date yasnippet advice cl-extra help-fns derived easy-mmode cl-macs
edmacro kmacro help-mode cl gv cl-loaddefs cl-lib setup-cygwin
cygwin-mount ange-ftp comint ansi-color ring omnisharp-autoloads info
easymenu flycheck-autoloads auto-complete-autoloads dash-autoloads
pkg-info-autoloads epl-autoloads popup-autoloads package epg-config
windmove ido tooltip electric uniquify ediff-hook vc-hooks
lisp-float-type mwheel dos-w32 ls-lisp w32-common-fns disp-table w32-win
w32-vars tool-bar dnd fontset image regexp-opt fringe tabulated-list
newcomment lisp-mode prog-mode register page menu-bar rfn-eshadow timer
select scroll-bar mouse jit-lock font-lock syntax facemenu font-core
frame cham georgian utf-8-lang misc-lang vietnamese tibetan thai
tai-viet lao korean japanese hebrew greek romanian slovak czech european
ethiopic indian cyrillic chinese case-table epa-hook jka-cmpr-hook help
simple abbrev minibuffer 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 make-network-process
w32notify w32 multi-tty emacs)

Memory information:
((conses 8 175944 5846)
 (symbols 32 24552 0)
 (miscs 32 87 681)
 (strings 16 36102 5289)
 (string-bytes 1 952830)
 (vectors 8 14963)
 (vector-slots 4 475764 5888)
 (floats 8 377 405)
 (intervals 28 920 33)
 (buffers 508 18))