diff options
| author | Stefan Monnier | 2014-10-06 13:47:56 -0400 |
|---|---|---|
| committer | Stefan Monnier | 2014-10-06 13:47:56 -0400 |
| commit | 3ef041ae3b98dde7300c9be4a28047748903ddc7 (patch) | |
| tree | c77175d1d9ba4506878ccda9aa2132f1e47856b4 /lisp/term | |
| parent | 71785ae78c87c3b96b20900cd7a9d4f69bce7757 (diff) | |
| download | emacs-3ef041ae3b98dde7300c9be4a28047748903ddc7.tar.gz emacs-3ef041ae3b98dde7300c9be4a28047748903ddc7.zip | |
* lisp/term/w32-win.el: Move all code from 32-common-fns.el here.
(gui-select-text, gui-selection-value): Use w32 handlers in the w32
console as well.
* lisp/w32-common-fns.el: Remove.
* lisp/loadup.el: Don't load w32-common-fns.el.
* w32-fns.elc: Don't require w32-common-fns.
* src/lisp.mk (lisp): Remove w32-common-fns.elc.
Fixes: debbugs:18629
Diffstat (limited to 'lisp/term')
| -rw-r--r-- | lisp/term/w32-win.el | 65 |
1 files changed, 61 insertions, 4 deletions
diff --git a/lisp/term/w32-win.el b/lisp/term/w32-win.el index 8ef718ad230..7e32791c179 100644 --- a/lisp/term/w32-win.el +++ b/lisp/term/w32-win.el | |||
| @@ -376,12 +376,69 @@ See the documentation of `create-fontset-from-fontset-spec' for the format.") | |||
| 376 | (gui-method-define window-system-initialization w32 | 376 | (gui-method-define window-system-initialization w32 |
| 377 | #'w32-initialize-window-system) | 377 | #'w32-initialize-window-system) |
| 378 | 378 | ||
| 379 | ;;;; Selections | ||
| 380 | |||
| 379 | (declare-function w32-set-clipboard-data "w32select.c" | 381 | (declare-function w32-set-clipboard-data "w32select.c" |
| 380 | (string &optional ignored)) | 382 | (string &optional ignored)) |
| 381 | (gui-method-define gui-select-text w32 | 383 | (declare-function w32-get-clipboard-data "w32select.c") |
| 382 | (lambda (text) | 384 | |
| 383 | (if gui-select-enable-clipboard | 385 | (defun w32--select-text (text) |
| 384 | (w32-set-clipboard-data text)))) | 386 | (if gui-select-enable-clipboard (w32-set-clipboard-data text))) |
| 387 | |||
| 388 | (defun w32--get-selection-value () | ||
| 389 | "Return the value of the current selection. | ||
| 390 | Consult the selection. Treat empty strings as if they were unset." | ||
| 391 | (if gui-select-enable-clipboard | ||
| 392 | ;; Don't die if x-get-selection signals an error. | ||
| 393 | (with-demoted-errors "w32-get-clipboard-data:%S" | ||
| 394 | (w32-get-clipboard-data)))) | ||
| 395 | |||
| 396 | ;; Arrange for the kill and yank functions to set and check the clipboard. | ||
| 397 | (gui-method-define gui-select-text w32 #'w32--select-text) | ||
| 398 | (gui-method-define gui-selection-value w32 #'w32--get-selection-value) | ||
| 399 | |||
| 400 | (when (eq system-type 'windows-nt) | ||
| 401 | ;; Make copy&pasting in w32's console interact with the system's clipboard! | ||
| 402 | (gui-method-define gui-select-text t #'w32--select-text) | ||
| 403 | (gui-method-define gui-selection-value t #'w32--get-selection-value)) | ||
| 404 | |||
| 405 | ;;; Fix interface to (X-specific) mouse.el | ||
| 406 | (gui-method-define gui-own-selection w32 | ||
| 407 | (lambda (type value) | ||
| 408 | (put 'x-selections (or type 'PRIMARY) data))) | ||
| 409 | |||
| 410 | (gui-method-define gui-disown-selection w32 | ||
| 411 | (lambda (type) | ||
| 412 | (put 'x-selections (or type 'PRIMARY) nil))) | ||
| 413 | |||
| 414 | (gui-method-define gui-get-selection w32 | ||
| 415 | (lambda (&optional type _data-type) | ||
| 416 | (get 'x-selections (or type 'PRIMARY)))) | ||
| 417 | |||
| 418 | ;; gui-selection-owner-p is used in simple.el | ||
| 419 | (gui-method-define gui-selection-owner-p w32 | ||
| 420 | (lambda (selection) | ||
| 421 | (and (memq selection '(nil PRIMARY SECONDARY)) | ||
| 422 | (get 'x-selections (or selection 'PRIMARY))))) | ||
| 423 | |||
| 424 | ;; The "Windows" keys on newer keyboards bring up the Start menu | ||
| 425 | ;; whether you want it or not - make Emacs ignore these keystrokes | ||
| 426 | ;; rather than beep. | ||
| 427 | (global-set-key [lwindow] 'ignore) | ||
| 428 | (global-set-key [rwindow] 'ignore) | ||
| 429 | |||
| 430 | (declare-function x-server-version "w32fns.c" (&optional terminal)) | ||
| 431 | |||
| 432 | (defun w32-version () | ||
| 433 | "Return the MS-Windows version numbers. | ||
| 434 | The value is a list of three integers: the major and minor version | ||
| 435 | numbers, and the build number." | ||
| 436 | (x-server-version)) | ||
| 437 | |||
| 438 | (defun w32-using-nt () | ||
| 439 | "Return non-nil if running on a Windows NT descendant. | ||
| 440 | That includes all Windows systems except for 9X/Me." | ||
| 441 | (getenv "SystemRoot")) | ||
| 385 | 442 | ||
| 386 | (provide 'w32-win) | 443 | (provide 'w32-win) |
| 387 | 444 | ||