diff options
author | Stefan Monnier <[email protected]> | 2010-09-13 16:40:48 +0200 |
---|---|---|
committer | Stefan Monnier <[email protected]> | 2010-09-13 16:40:48 +0200 |
commit | cc390e46c7ba95b76ea133d98fd386214cd01709 (patch) | |
tree | ead4400d22bd07214b782ff7e46e79d473fac419 /lisp/term/ns-win.el | |
parent | c566235d981eba73c88bbff00b6a1d88360b6e9f (diff) | |
parent | c5fe4acb5fb456d6e8e147d8bc7981ce56c5c03d (diff) |
Merge from trunk
Diffstat (limited to 'lisp/term/ns-win.el')
-rw-r--r-- | lisp/term/ns-win.el | 27 |
1 files changed, 12 insertions, 15 deletions
diff --git a/lisp/term/ns-win.el b/lisp/term/ns-win.el index f73b3d7e67..dd386fe133 100644 --- a/lisp/term/ns-win.el +++ b/lisp/term/ns-win.el @@ -293,7 +293,7 @@ The properties returned may include `top', `left', `height', and `width'." (unless (terminal-parameter frame 'x-setup-function-keys) (with-selected-frame frame (setq interprogram-cut-function 'x-select-text - interprogram-paste-function 'x-cut-buffer-or-selection-value) + interprogram-paste-function 'x-selection-value) (let ((map (copy-keymap ns-alternatives-map))) (set-keymap-parent map (keymap-parent local-function-key-map)) (set-keymap-parent local-function-key-map map)) @@ -1003,7 +1003,7 @@ See the documentation of `create-fontset-from-fontset-spec' for the format.") (defun ns-get-pasteboard () "Returns the value of the pasteboard." - (ns-get-cut-buffer-internal 'PRIMARY)) + (ns-get-cut-buffer-internal 'CLIPBOARD)) (declare-function ns-store-cut-buffer-internal "nsselect.m" (buffer string)) @@ -1011,27 +1011,25 @@ See the documentation of `create-fontset-from-fontset-spec' for the format.") "Store STRING into the pasteboard of the Nextstep display server." ;; Check the data type of STRING. (if (not (stringp string)) (error "Nonstring given to pasteboard")) - (ns-store-cut-buffer-internal 'PRIMARY string)) + (ns-store-cut-buffer-internal 'CLIPBOARD string)) ;; We keep track of the last text selected here, so we can check the ;; current selection against it, and avoid passing back our own text -;; from x-cut-buffer-or-selection-value. +;; from x-selection-value. (defvar ns-last-selected-text nil) -(defun x-select-text (text &optional push) +(defun x-select-text (text) "Select TEXT, a string, according to the window system. -On X, put TEXT in the primary X selection. For backward -compatibility with older X applications, set the value of X cut -buffer 0 as well, and if the optional argument PUSH is non-nil, -rotate the cut buffers. If `x-select-enable-clipboard' is -non-nil, copy the text to the X clipboard as well. +On X, if `x-select-enable-clipboard' is non-nil, copy TEXT to the +clipboard. If `x-select-enable-primary' is non-nil, put TEXT in +the primary selection. On Windows, make TEXT the current selection. If `x-select-enable-clipboard' is non-nil, copy the text to the -clipboard as well. The argument PUSH is ignored. +clipboard as well. -On Nextstep, put TEXT in the pasteboard; PUSH is ignored." +On Nextstep, put TEXT in the pasteboard." ;; Don't send the pasteboard too much text. ;; It becomes slow, and if really big it causes errors. (ns-set-pasteboard text) @@ -1040,11 +1038,10 @@ On Nextstep, put TEXT in the pasteboard; PUSH is ignored." ;; Return the value of the current Nextstep selection. For ;; compatibility with older Nextstep applications, this checks cut ;; buffer 0 before retrieving the value of the primary selection. -(defun x-cut-buffer-or-selection-value () +(defun x-selection-value () (let (text) - ;; Consult the selection, then the cut buffer. Treat empty strings - ;; as if they were unset. + ;; Consult the selection. Treat empty strings as if they were unset. (or text (setq text (ns-get-pasteboard))) (if (string= text "") (setq text nil)) |