At 02:01 PM 6/14/99 +0200, giacomo boffi wrote:
with the new 21.2.16, i was surprised to find that
- selecting (dragging button1),
- doing something else (that undoes the highlighting)
- and finally pasting (button2)
This should fix it.
andy
1999-06-15 Andy Piper <andy(a)xemacs.org>
* select.el (get-selection-no-error): really make there be no-error.
(get-selection): revert to original.
Index: lisp/select.el
===================================================================
RCS file: /usr/CVSroot/XEmacs/xemacs/lisp/select.el,v
retrieving revision 1.5.2.5
diff -u -r1.5.2.5 select.el
--- lisp/select.el 1999/06/12 03:20:15 1.5.2.5
+++ lisp/select.el 1999/06/15 15:29:55
@@ -75,17 +75,14 @@
"Return the value of one of the cut buffers.
This will do nothing under anything other than X.")
-(defun get-selection (&optional type data-type)
+(defun get-selection-no-error (&optional type data-type)
"Return the value of a Windows selection.
The argument TYPE (default `PRIMARY') says which selection,
and the argument DATA-TYPE (default `STRING', or `COMPOUND_TEXT' under Mule)
says how to convert the data. If there is no selection an error is signalled."
- (let ((text (get-selection-no-error type data-type)))
- (when (not (stringp text))
- (error "Selection is not a string: %S" text))
- text))
+ (condition-case err (get-selection type data-type) (t nil)))
-(defun get-selection-no-error (&optional type data-type)
+(defun get-selection (&optional type data-type)
"Return the value of a Windows selection.
The argument TYPE (default `PRIMARY') says which selection,
and the argument DATA-TYPE (default `STRING', or `COMPOUND_TEXT' under Mule)
@@ -98,11 +95,13 @@
(get-selection-internal type (car data-type))
(selection-conversion-error
(if (cdr data-type)
- (get-selection type (cdr data-type))
+ (get-selection-no-error type (cdr data-type))
(signal (car err) (cdr err)))))
(get-selection-internal type data-type))))
(when (and (consp text) (symbolp (car text)))
(setq text (cdr text)))
+ (when (not (stringp text))
+ (error "Selection is not a string: %S" text))
text))
;; FSFmacs calls this `x-set-selection', and reverses the
--------------------------------------------------------------
Dr Andy Piper
Senior Consultant Architect, BEA Systems Ltd