diff options
| author | Richard M. Stallman | 1994-04-06 04:51:37 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1994-04-06 04:51:37 +0000 |
| commit | dc20df9586dd9a33e33ea5fddaca135f2ac654ff (patch) | |
| tree | c10f0c9137895a24a0b1bebbae1cef31f18e180b /lisp/term | |
| parent | 31cd83e9449ad163e0db7a79cb392d38958b2879 (diff) | |
| download | emacs-dc20df9586dd9a33e33ea5fddaca135f2ac654ff.tar.gz emacs-dc20df9586dd9a33e33ea5fddaca135f2ac654ff.zip | |
(x-select-enable-clipboard): New variable.
(x-select-text, x-cut-buffer-or-selection-value): Obey it.
(x-handle-args): Doc fix.
Diffstat (limited to 'lisp/term')
| -rw-r--r-- | lisp/term/x-win.el | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/lisp/term/x-win.el b/lisp/term/x-win.el index dc826b3cc2b..e60759ec59e 100644 --- a/lisp/term/x-win.el +++ b/lisp/term/x-win.el | |||
| @@ -196,8 +196,8 @@ | |||
| 196 | (defvar x-invocation-args nil) | 196 | (defvar x-invocation-args nil) |
| 197 | 197 | ||
| 198 | (defun x-handle-args (args) | 198 | (defun x-handle-args (args) |
| 199 | "Here the X-related command line options in ARGS are processed, | 199 | "Process the X-related command line options in ARGS. |
| 200 | before the user's startup file is loaded. They are copied to | 200 | This is done before the user's startup file is loaded. They are copied to |
| 201 | x-invocation args from which the X-related things are extracted, first | 201 | x-invocation args from which the X-related things are extracted, first |
| 202 | the switch (e.g., \"-fg\") in the following code, and possible values | 202 | the switch (e.g., \"-fg\") in the following code, and possible values |
| 203 | (e.g., \"black\") in the option handler code (e.g., x-handle-switch). | 203 | (e.g., \"black\") in the option handler code (e.g., x-handle-switch). |
| @@ -542,6 +542,10 @@ This returns ARGS with the arguments that have been processed removed." | |||
| 542 | (defvar x-cut-buffer-max 20000 | 542 | (defvar x-cut-buffer-max 20000 |
| 543 | "Max number of characters to put in the cut buffer.") | 543 | "Max number of characters to put in the cut buffer.") |
| 544 | 544 | ||
| 545 | (defvar x-select-enable-clipboard nil | ||
| 546 | "Non-nil means cutting and pasting uses the clipboard. | ||
| 547 | This is in addition to the primary selection.") | ||
| 548 | |||
| 545 | ;;; Make TEXT, a string, the primary X selection. | 549 | ;;; Make TEXT, a string, the primary X selection. |
| 546 | ;;; Also, set the value of X cut buffer 0, for backward compatibility | 550 | ;;; Also, set the value of X cut buffer 0, for backward compatibility |
| 547 | ;;; with older X applications. | 551 | ;;; with older X applications. |
| @@ -554,6 +558,8 @@ This returns ARGS with the arguments that have been processed removed." | |||
| 554 | (x-set-cut-buffer text push) | 558 | (x-set-cut-buffer text push) |
| 555 | (x-set-cut-buffer "" push)) | 559 | (x-set-cut-buffer "" push)) |
| 556 | (x-set-selection 'PRIMARY text) | 560 | (x-set-selection 'PRIMARY text) |
| 561 | (if x-select-enable-clipboard | ||
| 562 | (x-set-selection 'CLIPBOARD text)) | ||
| 557 | (setq x-last-selected-text text)) | 563 | (setq x-last-selected-text text)) |
| 558 | 564 | ||
| 559 | ;;; Return the value of the current X selection. | 565 | ;;; Return the value of the current X selection. |
| @@ -567,6 +573,12 @@ This returns ARGS with the arguments that have been processed removed." | |||
| 567 | (setq text (x-get-selection 'PRIMARY)) | 573 | (setq text (x-get-selection 'PRIMARY)) |
| 568 | (error (message "%s" c))) | 574 | (error (message "%s" c))) |
| 569 | (if (string= text "") (setq text nil)) | 575 | (if (string= text "") (setq text nil)) |
| 576 | |||
| 577 | (if x-select-enable-clipboard | ||
| 578 | (condition-case c | ||
| 579 | (setq text (x-get-selection 'CLIPBOARD)) | ||
| 580 | (error (message "%s" c)))) | ||
| 581 | (if (string= text "") (setq text nil)) | ||
| 570 | (or text (setq text (x-get-cut-buffer 0))) | 582 | (or text (setq text (x-get-cut-buffer 0))) |
| 571 | (if (string= text "") (setq text nil)) | 583 | (if (string= text "") (setq text nil)) |
| 572 | 584 | ||