Mercurial > hg > xemacs-beta
changeset 829:42a86787d173
[xemacs-hg @ 2002-05-07 15:58:46 by stephent]
fix kill-ring bug <87elgoufss.fsf_-_@tleepslib.sk.tsukuba.ac.jp>
author | stephent |
---|---|
date | Tue, 07 May 2002 15:59:03 +0000 |
parents | 4ead1e0842f0 |
children | 20baef34a0b0 |
files | lisp/ChangeLog lisp/select.el lisp/simple.el src/ChangeLog src/select.c |
diffstat | 5 files changed, 42 insertions(+), 20 deletions(-) [+] |
line wrap: on
line diff
--- a/lisp/ChangeLog Tue May 07 15:30:18 2002 +0000 +++ b/lisp/ChangeLog Tue May 07 15:59:03 2002 +0000 @@ -1,3 +1,13 @@ +2002-04-23 Jerry James <james@xemacs.org> + + * select.el (get-clipboard): Document connection with + interprogram-paste-function. + * select.el (get-selection): Document that nil should be + returned if XEmacs owns the selection. + Remove unnecessary variable. + * simple.el (kill-ring-max): Synch with FSF Emacs 21.2. + * simple.el (kill-new): Synch with FSF Emacs 21.2 + 2002-05-05 Ben Wing <ben@xemacs.org> * bytecomp-runtime.el (with-obsolete-variable):
--- a/lisp/select.el Tue May 07 15:30:18 2002 +0000 +++ b/lisp/select.el Tue May 07 15:59:03 2002 +0000 @@ -75,7 +75,8 @@ (insert clip)))) (defun get-clipboard () - "Return text pasted to the clipboard." + "Return text pasted to the clipboard. +See `interprogram-paste-function' for more information." (get-selection 'CLIPBOARD)) (define-device-method get-cutbuffer @@ -90,22 +91,21 @@ (condition-case nil (get-selection type data-type) (t nil))) (defun get-selection (&optional type data-type) - "Return the value of a window-system selection. + "Return the value of a window-system selection, or nil if XEmacs owns it. 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." +says how to convert the data. If there is no selection an error is signalled. +See `interprogram-paste-function' for more information." (or type (setq type 'PRIMARY)) (or data-type (setq data-type selected-text-type)) - (let ((text - (if (consp data-type) - (condition-case err - (get-selection-internal type (car data-type)) - (selection-conversion-error - (if (cdr data-type) - (get-selection type (cdr data-type)) - (signal (car err) (cdr err))))) - (get-selection-internal type data-type)))) - text)) + (if (consp data-type) + (condition-case err + (get-selection-internal type (car data-type)) + (selection-conversion-error + (if (cdr data-type) + (get-selection type (cdr data-type)) + (signal (car err) (cdr err))))) + (get-selection-internal type data-type))) ;; FSFmacs calls this `x-set-selection', and reverses the ;; first two arguments (duh ...). This order is more logical.
--- a/lisp/simple.el Tue May 07 15:30:18 2002 +0000 +++ b/lisp/simple.el Tue May 07 15:59:03 2002 +0000 @@ -1271,7 +1271,7 @@ interaction; you may want to use them instead of manipulating the kill ring directly.") -(defcustom kill-ring-max 30 +(defcustom kill-ring-max 60 "*Maximum length of kill ring before oldest elements are thrown away." :type 'integer :group 'killing) @@ -1282,12 +1282,13 @@ (defun kill-new (string &optional replace) "Make STRING the latest kill in the kill ring. Set `kill-ring-yank-pointer' to point to it. +If `interprogram-cut-function' is non-nil, apply it to STRING. Run `kill-hooks'. Optional second argument REPLACE non-nil means that STRING will replace the front of the kill ring, rather than being added to the list." ; (and (fboundp 'menu-bar-update-yank-menu) ; (menu-bar-update-yank-menu string (and replace (car kill-ring)))) - (if replace + (if (and replace kill-ring) (setcar kill-ring string) (setq kill-ring (cons string kill-ring)) (if (> (length kill-ring) kill-ring-max)
--- a/src/ChangeLog Tue May 07 15:30:18 2002 +0000 +++ b/src/ChangeLog Tue May 07 15:59:03 2002 +0000 @@ -1,3 +1,11 @@ +2002-04-23 Jerry James <james@xemacs.org> + + * select.c (Fown_selection_internal): Document connection with + interprogram-cut-function. + * select.c (Fget_selection_internal): return Qnil if XEmacs owns + the selection and it does not need coercion. + Document connection with interprogram-paste-function. + 2002-05-06 Jonathan Harris <jonathan@xemacs.org> * console-msw.h:
--- a/src/select.c Tue May 07 15:30:18 2002 +0000 +++ b/src/select.c Tue May 07 15:59:03 2002 +0000 @@ -139,8 +139,8 @@ SELECTION-VALUE is typically a string, or a cons of two markers, but may be anything that the functions on selection-converter-out-alist know about. Optional arg HOW-TO-ADD specifies how the selection will be combined -with any existing selection(s) - see `own-selection' for more -information. +with any existing selection(s) - see `own-selection' and +`interprogram-cut-function' for more information. Optional arg DATA-TYPE is a window-system-specific type. Optional arg DEVICE specifies the device on which to assert the selection. It defaults to the selected device. @@ -509,8 +509,8 @@ } /* Request the selection value from the owner. If we are the owner, - simply return our selection value. If we are not the owner, this - will block until all of the data has arrived. + return Qnil. If we are not the owner, this will block until all of + the data has arrived. */ DEFUN ("get-selection-internal", Fget_selection_internal, 2, 3, 0, /* Return text selected from some window-system window. @@ -518,6 +518,8 @@ TARGET-TYPE is the type of data desired, typically STRING or COMPOUND_TEXT. Under Mule, if the resultant data comes back as 8-bit data in type TEXT or COMPOUND_TEXT, it will be decoded as Compound Text. +If XEmacs already owns the selection, return nil. See +`interprogram-paste-function' for more information. */ (selection, target_type, device)) { @@ -559,7 +561,8 @@ { /* If we get something from the local cache, we may need to convert it slightly - to do this, we call select-coerce */ - val = call3 (Qselect_coerce, selection, target_type, val); + Lisp_Object val2 = call3 (Qselect_coerce, selection, target_type, val); + return (EQ (val, val2)) ? Qnil : val2; } else if (HAS_DEVMETH_P (XDEVICE (device), get_foreign_selection)) {