There has been a recent change in select.el/get-selection that results
in cut and paste not working anymore under win32. The symptoms are as
follow. The form (get-selection 'CLIPBOARD) is always returning
nil. However, (get-selection 'CLIPBOARD 'STRING) is returning what is
expected. So it is pretty clear that this part of the code for
get-selection is wrong:
;; The source app didn't offer us anything compatible in TARGETS,
;; or they're not negotiating at all. (That is, we're probably not
;; on X11.) Try to convert to the types specified by our caller,
;; and throw an error if the last one of those fails.
(while data-type
(condition-case err
(progn
(setq res (get-selection-internal type (car data-type)))
(throw 'converted res))
(selection-conversion-error
(if (cdr data-type)
(setq data-type (pop data-type))
(signal (car err) (cdr err))))))))
The fact is that get-selection-internal seems to return nil, not to
trigger an error. Moreover, data-type is supposed to be a list at this
point and it won't stay a list after the (setq data-type (pop
data-type)) . So I can offer this patch but possibly there are best ways
to fix that:
C:\Source\XEmTeX\xemacs>diff -u -b \mirror\xemtex\xemacs\xemacs-21.5\lisp\select
.el "\Program Files\XEmacs\xemacs-21.5\lisp\select.el"
--- \mirror\xemtex\xemacs\xemacs-21.5\lisp\select.el 2005-03-09 22:58:34.0000
00000 +0100
+++ \Program Files\XEmacs\xemacs-21.5\lisp\select.el 2005-03-10 22:33:53.0000
00000 +0100
@@ -146,10 +146,12 @@
(condition-case err
(progn
(setq res (get-selection-internal type (car data-type)))
- (throw 'converted res))
+ (if res (throw 'converted res)
+ (signal 'selection-conversion-error nil)
+ ))
(selection-conversion-error
(if (cdr data-type)
- (setq data-type (pop data-type))
+ (setq data-type (cdr data-type))
(signal (car err) (cdr err))))))))
(get-selection-internal type data-type)))
Moreover, I don't know much about this stuff, but win32 doesn't seem to
take advantage of the TARGETS tag, which would certainly make much more
sense. Opinions on how to do that?
Best,
--
Fabrice Popineau
------------------------
e-mail: Fabrice.Popineau(a)supelec.fr | The difference between theory
voice-mail: +33 (0) 387764715 | and practice, is that
surface-mail: Supelec, 2 rue E. Belin, | theoretically,
F-57070 Metz | there is no difference !