diff options
| author | Andrew Innes | 2000-12-08 14:34:15 +0000 |
|---|---|---|
| committer | Andrew Innes | 2000-12-08 14:34:15 +0000 |
| commit | 30cd075d946b02da3ed5118c527eaeed8b1d6088 (patch) | |
| tree | e6f780508bce1078c41c7051ee30e51c1f5b85b2 | |
| parent | 3b4cf5db1655250c13ed72eb521523f97b6ba553 (diff) | |
| download | emacs-30cd075d946b02da3ed5118c527eaeed8b1d6088.tar.gz emacs-30cd075d946b02da3ed5118c527eaeed8b1d6088.zip | |
Remove stuff about selection timeout, which is
irrelevant on Windows. Move clipboard support to w32-fns.el, so
it is accessible in -nw mode.
| -rw-r--r-- | lisp/ChangeLog | 9 | ||||
| -rw-r--r-- | lisp/term/w32-win.el | 61 |
2 files changed, 9 insertions, 61 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 67647818c2c..34d63e4b520 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,12 @@ | |||
| 1 | 2000-12-08 Andrew Innes <andrewi@gnu.org> | ||
| 2 | |||
| 3 | * w32-fns.el: Add clipboard support from term/w32-win.el, so it is | ||
| 4 | accessible in -nw mode. | ||
| 5 | |||
| 6 | * term/w32-win.el: Remove stuff about selection timeout, which is | ||
| 7 | irrelevant on Windows. Move clipboard support to w32-fns.el, so | ||
| 8 | it is accessible in -nw mode. | ||
| 9 | |||
| 1 | 2000-12-08 Dave Love <fx@gnu.org> | 10 | 2000-12-08 Dave Love <fx@gnu.org> |
| 2 | 11 | ||
| 3 | * emacs-lisp/lisp-mode.el (lisp-mode): Set | 12 | * emacs-lisp/lisp-mode.el (lisp-mode): Set |
diff --git a/lisp/term/w32-win.el b/lisp/term/w32-win.el index 7db6b475abd..71e7f56256b 100644 --- a/lisp/term/w32-win.el +++ b/lisp/term/w32-win.el | |||
| @@ -554,56 +554,6 @@ This returns ARGS with the arguments that have been processed removed." | |||
| 554 | global-map) | 554 | global-map) |
| 555 | 555 | ||
| 556 | 556 | ||
| 557 | ;;;; Selections and cut buffers | ||
| 558 | |||
| 559 | ;;; We keep track of the last text selected here, so we can check the | ||
| 560 | ;;; current selection against it, and avoid passing back our own text | ||
| 561 | ;;; from x-cut-buffer-or-selection-value. | ||
| 562 | (defvar x-last-selected-text nil) | ||
| 563 | |||
| 564 | ;;; It is said that overlarge strings are slow to put into the cut buffer. | ||
| 565 | ;;; Note this value is overridden below. | ||
| 566 | (defvar x-cut-buffer-max 20000 | ||
| 567 | "Max number of characters to put in the cut buffer.") | ||
| 568 | |||
| 569 | (defcustom x-select-enable-clipboard t | ||
| 570 | "Non-nil means cutting and pasting uses the clipboard. | ||
| 571 | This is in addition to the primary selection." | ||
| 572 | :type 'boolean | ||
| 573 | :group 'killing) | ||
| 574 | |||
| 575 | (defun x-select-text (text &optional push) | ||
| 576 | "Make TEXT the last selected text. | ||
| 577 | If `x-select-enable-clipboard' is non-nil, copy the text to the system | ||
| 578 | clipboard as well. Optional PUSH is ignored on Windows." | ||
| 579 | (if x-select-enable-clipboard | ||
| 580 | (w32-set-clipboard-data text)) | ||
| 581 | (setq x-last-selected-text text)) | ||
| 582 | |||
| 583 | (defun x-get-selection-value () | ||
| 584 | "Return the value of the current selection. | ||
| 585 | Consult the selection, then the cut buffer. Treat empty strings as if | ||
| 586 | they were unset." | ||
| 587 | (if x-select-enable-clipboard | ||
| 588 | (let (text) | ||
| 589 | ;; Don't die if x-get-selection signals an error. | ||
| 590 | (condition-case c | ||
| 591 | (setq text (w32-get-clipboard-data)) | ||
| 592 | (error (message "w32-get-clipboard-data:%s" c))) | ||
| 593 | (if (string= text "") (setq text nil)) | ||
| 594 | (cond | ||
| 595 | ((not text) nil) | ||
| 596 | ((eq text x-last-selected-text) nil) | ||
| 597 | ((string= text x-last-selected-text) | ||
| 598 | ;; Record the newer string, so subsequent calls can use the 'eq' test. | ||
| 599 | (setq x-last-selected-text text) | ||
| 600 | nil) | ||
| 601 | (t | ||
| 602 | (setq x-last-selected-text text)))))) | ||
| 603 | |||
| 604 | (defalias 'x-cut-buffer-or-selection-value 'x-get-selection-value) | ||
| 605 | |||
| 606 | |||
| 607 | ;;; Do the actual Windows setup here; the above code just defines | 557 | ;;; Do the actual Windows setup here; the above code just defines |
| 608 | ;;; functions and variables that we use now. | 558 | ;;; functions and variables that we use now. |
| 609 | 559 | ||
| @@ -714,22 +664,11 @@ See the documentation of `create-fontset-from-fontset-spec for the format.") | |||
| 714 | (setq default-frame-alist | 664 | (setq default-frame-alist |
| 715 | (cons '(reverse . t) default-frame-alist))))) | 665 | (cons '(reverse . t) default-frame-alist))))) |
| 716 | 666 | ||
| 717 | ;; Set x-selection-timeout, measured in milliseconds. | ||
| 718 | (let ((res-selection-timeout | ||
| 719 | (x-get-resource "selectionTimeout" "SelectionTimeout"))) | ||
| 720 | (setq x-selection-timeout 20000) | ||
| 721 | (if res-selection-timeout | ||
| 722 | (setq x-selection-timeout (string-to-number res-selection-timeout)))) | ||
| 723 | |||
| 724 | (defun x-win-suspend-error () | 667 | (defun x-win-suspend-error () |
| 725 | "Report an error when a suspend is attempted." | 668 | "Report an error when a suspend is attempted." |
| 726 | (error "Suspending an Emacs running under W32 makes no sense")) | 669 | (error "Suspending an Emacs running under W32 makes no sense")) |
| 727 | (add-hook 'suspend-hook 'x-win-suspend-error) | 670 | (add-hook 'suspend-hook 'x-win-suspend-error) |
| 728 | 671 | ||
| 729 | ;;; Arrange for the kill and yank functions to set and check the clipboard. | ||
| 730 | (setq interprogram-cut-function 'x-select-text) | ||
| 731 | (setq interprogram-paste-function 'x-get-selection-value) | ||
| 732 | |||
| 733 | ;;; Turn off window-splitting optimization; w32 is usually fast enough | 672 | ;;; Turn off window-splitting optimization; w32 is usually fast enough |
| 734 | ;;; that this is only annoying. | 673 | ;;; that this is only annoying. |
| 735 | (setq split-window-keep-point t) | 674 | (setq split-window-keep-point t) |