diff options
| author | Glenn Morris | 2010-10-24 15:04:45 -0700 |
|---|---|---|
| committer | Glenn Morris | 2010-10-24 15:04:45 -0700 |
| commit | a44d921f06db9b6bb43fa00bf291f2fb6737da71 (patch) | |
| tree | 367e612b4ee41ad0d5b4702a77588400c501dae2 | |
| parent | a11de514760cb39dab01081fbe1342924b351c9c (diff) | |
| download | emacs-a44d921f06db9b6bb43fa00bf291f2fb6737da71.tar.gz emacs-a44d921f06db9b6bb43fa00bf291f2fb6737da71.zip | |
Move some more shared x-, w32- things to common-win.
* term/ns-win.el (x-select-text): Doc fix.
* w32-fns.el (x-alternatives-map, x-setup-function-keys)
(x-select-text): Move to term/common-win.
* term/w32-win.el (xw-defined-colors): Move to common-win.
* term/x-win.el (xw-defined-colors, x-alternatives-map)
(x-setup-function-keys, x-select-text): Move to common-win.
* term/common-win.el (x-select-text, x-alternatives-map)
(x-setup-function-keys, xw-defined-colors): Merge x- and w32-
definitions here.
| -rw-r--r-- | lisp/ChangeLog | 15 | ||||
| -rw-r--r-- | lisp/term/common-win.el | 74 | ||||
| -rw-r--r-- | lisp/term/ns-win.el | 2 | ||||
| -rw-r--r-- | lisp/term/w32-win.el | 11 | ||||
| -rw-r--r-- | lisp/term/x-win.el | 67 | ||||
| -rw-r--r-- | lisp/w32-fns.el | 45 |
6 files changed, 89 insertions, 125 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 7cbe7d8366c..e2c5d1f6719 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,15 @@ | |||
| 1 | 2010-10-24 Glenn Morris <rgm@gnu.org> | ||
| 2 | |||
| 3 | * term/ns-win.el (x-select-text): Doc fix. | ||
| 4 | * w32-fns.el (x-alternatives-map, x-setup-function-keys) | ||
| 5 | (x-select-text): Move to term/common-win. | ||
| 6 | * term/w32-win.el (xw-defined-colors): Move to common-win. | ||
| 7 | * term/x-win.el (xw-defined-colors, x-alternatives-map) | ||
| 8 | (x-setup-function-keys, x-select-text): Move to common-win. | ||
| 9 | * term/common-win.el (x-select-text, x-alternatives-map) | ||
| 10 | (x-setup-function-keys, xw-defined-colors): Merge x- and w32- | ||
| 11 | definitions here. | ||
| 12 | |||
| 1 | 2010-10-24 "T.V. Raman" <tv.raman.tv@gmail.com> | 13 | 2010-10-24 "T.V. Raman" <tv.raman.tv@gmail.com> |
| 2 | 14 | ||
| 3 | * net/mairix.el (mairix-searches-mode-map): | 15 | * net/mairix.el (mairix-searches-mode-map): |
| @@ -159,14 +171,13 @@ | |||
| 159 | (set-cursor-color, set-mouse-color, set-border-color): Use | 171 | (set-cursor-color, set-mouse-color, set-border-color): Use |
| 160 | read-color. | 172 | read-color. |
| 161 | 173 | ||
| 162 | 2010-10-24 Leo <sdl.web@gmail.com> | 174 | 2010-10-24 Leo <sdl.web@gmail.com> |
| 163 | 175 | ||
| 164 | * eshell/em-unix.el (eshell-remove-entries): Use the TRASH | 176 | * eshell/em-unix.el (eshell-remove-entries): Use the TRASH |
| 165 | argument of delete-file and delete-directory (Bug#7011). | 177 | argument of delete-file and delete-directory (Bug#7011). |
| 166 | 178 | ||
| 167 | 2010-10-24 Chong Yidong <cyd@stupidchicken.com> | 179 | 2010-10-24 Chong Yidong <cyd@stupidchicken.com> |
| 168 | 180 | ||
| 169 | |||
| 170 | * emacs-lisp/package.el (package-menu-mode-map): Inherit from | 181 | * emacs-lisp/package.el (package-menu-mode-map): Inherit from |
| 171 | button-buffer-map. | 182 | button-buffer-map. |
| 172 | 183 | ||
diff --git a/lisp/term/common-win.el b/lisp/term/common-win.el index 832dde1d8a1..1c53f09abad 100644 --- a/lisp/term/common-win.el +++ b/lisp/term/common-win.el | |||
| @@ -37,6 +37,67 @@ accessible to other programs on MS-Windows.\)" | |||
| 37 | ;; The GNU/Linux version changed in 24.1, the MS-Windows version did not. | 37 | ;; The GNU/Linux version changed in 24.1, the MS-Windows version did not. |
| 38 | :version "24.1") | 38 | :version "24.1") |
| 39 | 39 | ||
| 40 | (defvar x-last-selected-text) ; w32-fns.el | ||
| 41 | (declare-function w32-set-clipboard-data "w32select.c" | ||
| 42 | (string &optional ignored)) | ||
| 43 | |||
| 44 | (defun x-select-text (text) | ||
| 45 | "Select TEXT, a string, according to the window system. | ||
| 46 | |||
| 47 | On X, if `x-select-enable-clipboard' is non-nil, copy TEXT to the | ||
| 48 | clipboard. If `x-select-enable-primary' is non-nil, put TEXT in | ||
| 49 | the primary selection. | ||
| 50 | |||
| 51 | On MS-Windows, make TEXT the current selection. If | ||
| 52 | `x-select-enable-clipboard' is non-nil, copy the text to the | ||
| 53 | clipboard as well. | ||
| 54 | |||
| 55 | On Nextstep, put TEXT in the pasteboard." | ||
| 56 | (if (eq system-type 'windows-nt) | ||
| 57 | (progn | ||
| 58 | (if x-select-enable-clipboard | ||
| 59 | (w32-set-clipboard-data text)) | ||
| 60 | (setq x-last-selected-text text)) | ||
| 61 | ;; With multi-tty, this function may be called from a tty frame. | ||
| 62 | (when (eq (framep (selected-frame)) 'x) | ||
| 63 | (when x-select-enable-primary | ||
| 64 | (x-set-selection 'PRIMARY text) | ||
| 65 | (setq x-last-selected-text-primary text)) | ||
| 66 | (when x-select-enable-clipboard | ||
| 67 | (x-set-selection 'CLIPBOARD text) | ||
| 68 | (setq x-last-selected-text-clipboard text))))) | ||
| 69 | |||
| 70 | ;;;; Function keys | ||
| 71 | |||
| 72 | (defvar x-alternatives-map | ||
| 73 | (let ((map (make-sparse-keymap))) | ||
| 74 | ;; Map certain keypad keys into ASCII characters that people usually expect. | ||
| 75 | (define-key map [M-backspace] [?\M-\d]) | ||
| 76 | (define-key map [M-delete] [?\M-\d]) | ||
| 77 | (define-key map [M-tab] [?\M-\t]) | ||
| 78 | (define-key map [M-linefeed] [?\M-\n]) | ||
| 79 | (define-key map [M-clear] [?\M-\C-l]) | ||
| 80 | (define-key map [M-return] [?\M-\C-m]) | ||
| 81 | (define-key map [M-escape] [?\M-\e]) | ||
| 82 | (define-key map [iso-lefttab] [backtab]) | ||
| 83 | (define-key map [S-iso-lefttab] [backtab]) | ||
| 84 | (and (eq system-type 'windows-nt) | ||
| 85 | (define-key map [S-tab] [backtab])) | ||
| 86 | map) | ||
| 87 | "Keymap of possible alternative meanings for some keys.") | ||
| 88 | |||
| 89 | (defun x-setup-function-keys (frame) | ||
| 90 | "Set up `function-key-map' on the graphical frame FRAME." | ||
| 91 | ;; Don't do this twice on the same display, or it would break | ||
| 92 | ;; normal-erase-is-backspace-mode. | ||
| 93 | (unless (terminal-parameter frame 'x-setup-function-keys) | ||
| 94 | ;; Map certain keypad keys into ASCII characters that people usually expect. | ||
| 95 | (with-selected-frame frame | ||
| 96 | (let ((map (copy-keymap x-alternatives-map))) | ||
| 97 | (set-keymap-parent map (keymap-parent local-function-key-map)) | ||
| 98 | (set-keymap-parent local-function-key-map map))) | ||
| 99 | (set-terminal-parameter frame 'x-setup-function-keys t))) | ||
| 100 | |||
| 40 | (defvar x-invocation-args) | 101 | (defvar x-invocation-args) |
| 41 | 102 | ||
| 42 | (defvar x-command-line-resources nil) | 103 | (defvar x-command-line-resources nil) |
| @@ -382,4 +443,17 @@ For X, the list comes from the `rgb.txt' file,v 10.41 94/02/20. | |||
| 382 | For Nextstep, this is a list of non-PANTONE colors returned by | 443 | For Nextstep, this is a list of non-PANTONE colors returned by |
| 383 | the operating system.") | 444 | the operating system.") |
| 384 | 445 | ||
| 446 | (defvar w32-color-map) | ||
| 447 | |||
| 448 | (defun xw-defined-colors (&optional frame) | ||
| 449 | "Internal function called by `defined-colors', which see." | ||
| 450 | (or frame (setq frame (selected-frame))) | ||
| 451 | (let (defined-colors) | ||
| 452 | (dolist (this-color (if (eq system-type 'windows-nt) | ||
| 453 | (or (mapcar 'car w32-color-map) x-colors) | ||
| 454 | x-colors)) | ||
| 455 | (and (color-supported-p this-color frame t) | ||
| 456 | (setq defined-colors (cons this-color defined-colors)))) | ||
| 457 | defined-colors)) | ||
| 458 | |||
| 385 | ;;; common-win.el ends here | 459 | ;;; common-win.el ends here |
diff --git a/lisp/term/ns-win.el b/lisp/term/ns-win.el index 0eb7322c618..acd6bda60f0 100644 --- a/lisp/term/ns-win.el +++ b/lisp/term/ns-win.el | |||
| @@ -1028,7 +1028,7 @@ On X, if `x-select-enable-clipboard' is non-nil, copy TEXT to the | |||
| 1028 | clipboard. If `x-select-enable-primary' is non-nil, put TEXT in | 1028 | clipboard. If `x-select-enable-primary' is non-nil, put TEXT in |
| 1029 | the primary selection. | 1029 | the primary selection. |
| 1030 | 1030 | ||
| 1031 | On Windows, make TEXT the current selection. If | 1031 | On MS-Windows, make TEXT the current selection. If |
| 1032 | `x-select-enable-clipboard' is non-nil, copy the text to the | 1032 | `x-select-enable-clipboard' is non-nil, copy the text to the |
| 1033 | clipboard as well. | 1033 | clipboard as well. |
| 1034 | 1034 | ||
diff --git a/lisp/term/w32-win.el b/lisp/term/w32-win.el index 54bb5a5027b..a1ab5a8225c 100644 --- a/lisp/term/w32-win.el +++ b/lisp/term/w32-win.el | |||
| @@ -148,18 +148,8 @@ the last file dropped is selected." | |||
| 148 | (global-set-key [language-change] 'ignore) | 148 | (global-set-key [language-change] 'ignore) |
| 149 | 149 | ||
| 150 | (defvar x-resource-name) | 150 | (defvar x-resource-name) |
| 151 | (defvar x-colors) | ||
| 152 | 151 | ||
| 153 | 152 | ||
| 154 | (defun xw-defined-colors (&optional frame) | ||
| 155 | "Internal function called by `defined-colors', which see." | ||
| 156 | (or frame (setq frame (selected-frame))) | ||
| 157 | (let ((defined-colors nil)) | ||
| 158 | (dolist (this-color (or (mapcar 'car w32-color-map) x-colors)) | ||
| 159 | (and (color-supported-p this-color frame t) | ||
| 160 | (setq defined-colors (cons this-color defined-colors)))) | ||
| 161 | defined-colors)) | ||
| 162 | |||
| 163 | ;;;; Function keys | 153 | ;;;; Function keys |
| 164 | 154 | ||
| 165 | ;;; make f10 activate the real menubar rather than the mini-buffer menu | 155 | ;;; make f10 activate the real menubar rather than the mini-buffer menu |
| @@ -316,5 +306,4 @@ See the documentation of `create-fontset-from-fontset-spec' for the format.") | |||
| 316 | 306 | ||
| 317 | (provide 'w32-win) | 307 | (provide 'w32-win) |
| 318 | 308 | ||
| 319 | ;; arch-tag: 69fb1701-28c2-4890-b351-3d1fe4b4f166 | ||
| 320 | ;;; w32-win.el ends here | 309 | ;;; w32-win.el ends here |
diff --git a/lisp/term/x-win.el b/lisp/term/x-win.el index c39332cc12b..bd426012532 100644 --- a/lisp/term/x-win.el +++ b/lisp/term/x-win.el | |||
| @@ -1,7 +1,7 @@ | |||
| 1 | ;;; x-win.el --- parse relevant switches and set up for X -*-coding: iso-2022-7bit;-*- | 1 | ;;; x-win.el --- parse relevant switches and set up for X -*-coding: iso-2022-7bit;-*- |
| 2 | 2 | ||
| 3 | ;; Copyright (C) 1993, 1994, 2001, 2002, 2003, 2004, 2005, 2006, 2007, | 3 | ;; Copyright (C) 1993, 1994, 2001, 2002, 2003, 2004, 2005, 2006, 2007, |
| 4 | ;; 2008, 2009, 2010 Free Software Foundation, Inc. | 4 | ;; 2008, 2009, 2010 Free Software Foundation, Inc. |
| 5 | 5 | ||
| 6 | ;; Author: FSF | 6 | ;; Author: FSF |
| 7 | ;; Keywords: terminals, i18n | 7 | ;; Keywords: terminals, i18n |
| @@ -252,50 +252,6 @@ exists." | |||
| 252 | (defconst x-pointer-invisible 255) | 252 | (defconst x-pointer-invisible 255) |
| 253 | 253 | ||
| 254 | 254 | ||
| 255 | (defvar x-colors) | ||
| 256 | |||
| 257 | (defun xw-defined-colors (&optional frame) | ||
| 258 | "Internal function called by `defined-colors', which see." | ||
| 259 | (or frame (setq frame (selected-frame))) | ||
| 260 | (let ((all-colors x-colors) | ||
| 261 | (this-color nil) | ||
| 262 | (defined-colors nil)) | ||
| 263 | (while all-colors | ||
| 264 | (setq this-color (car all-colors) | ||
| 265 | all-colors (cdr all-colors)) | ||
| 266 | (and (color-supported-p this-color frame t) | ||
| 267 | (setq defined-colors (cons this-color defined-colors)))) | ||
| 268 | defined-colors)) | ||
| 269 | |||
| 270 | ;;;; Function keys | ||
| 271 | |||
| 272 | (defvar x-alternatives-map | ||
| 273 | (let ((map (make-sparse-keymap))) | ||
| 274 | ;; Map certain keypad keys into ASCII characters that people usually expect. | ||
| 275 | (define-key map [M-backspace] [?\M-\d]) | ||
| 276 | (define-key map [M-delete] [?\M-\d]) | ||
| 277 | (define-key map [M-tab] [?\M-\t]) | ||
| 278 | (define-key map [M-linefeed] [?\M-\n]) | ||
| 279 | (define-key map [M-clear] [?\M-\C-l]) | ||
| 280 | (define-key map [M-return] [?\M-\C-m]) | ||
| 281 | (define-key map [M-escape] [?\M-\e]) | ||
| 282 | (define-key map [iso-lefttab] [backtab]) | ||
| 283 | (define-key map [S-iso-lefttab] [backtab]) | ||
| 284 | map) | ||
| 285 | "Keymap of possible alternative meanings for some keys.") | ||
| 286 | |||
| 287 | (defun x-setup-function-keys (frame) | ||
| 288 | "Set up `function-key-map' on the graphical frame FRAME." | ||
| 289 | ;; Don't do this twice on the same display, or it would break | ||
| 290 | ;; normal-erase-is-backspace-mode. | ||
| 291 | (unless (terminal-parameter frame 'x-setup-function-keys) | ||
| 292 | ;; Map certain keypad keys into ASCII characters that people usually expect. | ||
| 293 | (with-selected-frame frame | ||
| 294 | (let ((map (copy-keymap x-alternatives-map))) | ||
| 295 | (set-keymap-parent map (keymap-parent local-function-key-map)) | ||
| 296 | (set-keymap-parent local-function-key-map map))) | ||
| 297 | (set-terminal-parameter frame 'x-setup-function-keys t))) | ||
| 298 | |||
| 299 | ;;;; Keysyms | 255 | ;;;; Keysyms |
| 300 | 256 | ||
| 301 | (defun vendor-specific-keysyms (vendor) | 257 | (defun vendor-specific-keysyms (vendor) |
| @@ -1212,27 +1168,6 @@ pasted text.") | |||
| 1212 | :group 'killing | 1168 | :group 'killing |
| 1213 | :version "24.1") | 1169 | :version "24.1") |
| 1214 | 1170 | ||
| 1215 | (defun x-select-text (text) | ||
| 1216 | "Select TEXT, a string, according to the window system. | ||
| 1217 | |||
| 1218 | On X, if `x-select-enable-clipboard' is non-nil, copy TEXT to the | ||
| 1219 | clipboard. If `x-select-enable-primary' is non-nil, put TEXT in | ||
| 1220 | the primary selection. | ||
| 1221 | |||
| 1222 | On Windows, make TEXT the current selection. If | ||
| 1223 | `x-select-enable-clipboard' is non-nil, copy the text to the | ||
| 1224 | clipboard as well. | ||
| 1225 | |||
| 1226 | On Nextstep, put TEXT in the pasteboard." | ||
| 1227 | ;; With multi-tty, this function may be called from a tty frame. | ||
| 1228 | (when (eq (framep (selected-frame)) 'x) | ||
| 1229 | (when x-select-enable-primary | ||
| 1230 | (x-set-selection 'PRIMARY text) | ||
| 1231 | (setq x-last-selected-text-primary text)) | ||
| 1232 | (when x-select-enable-clipboard | ||
| 1233 | (x-set-selection 'CLIPBOARD text) | ||
| 1234 | (setq x-last-selected-text-clipboard text)))) | ||
| 1235 | |||
| 1236 | (defvar x-select-request-type nil | 1171 | (defvar x-select-request-type nil |
| 1237 | "*Data type request for X selection. | 1172 | "*Data type request for X selection. |
| 1238 | The value is one of the following data types, a list of them, or nil: | 1173 | The value is one of the following data types, a list of them, or nil: |
diff --git a/lisp/w32-fns.el b/lisp/w32-fns.el index 1abb29febc7..0c6c56f84fb 100644 --- a/lisp/w32-fns.el +++ b/lisp/w32-fns.el | |||
| @@ -32,34 +32,6 @@ | |||
| 32 | 32 | ||
| 33 | ;;;; Function keys | 33 | ;;;; Function keys |
| 34 | 34 | ||
| 35 | (defvar x-alternatives-map | ||
| 36 | (let ((map (make-sparse-keymap))) | ||
| 37 | ;; Map certain keypad keys into ASCII characters that people usually expect. | ||
| 38 | (define-key map [M-backspace] [?\M-\d]) | ||
| 39 | (define-key map [M-delete] [?\M-\d]) | ||
| 40 | (define-key map [M-tab] [?\M-\t]) | ||
| 41 | (define-key map [M-linefeed] [?\M-\n]) | ||
| 42 | (define-key map [M-clear] [?\M-\C-l]) | ||
| 43 | (define-key map [M-return] [?\M-\C-m]) | ||
| 44 | (define-key map [M-escape] [?\M-\e]) | ||
| 45 | (define-key map [iso-lefttab] [backtab]) | ||
| 46 | (define-key map [S-iso-lefttab] [backtab]) | ||
| 47 | (define-key map [S-tab] [backtab]) | ||
| 48 | map) | ||
| 49 | "Keymap of possible alternative meanings for some keys.") | ||
| 50 | |||
| 51 | (defun x-setup-function-keys (frame) | ||
| 52 | "Set up `function-key-map' on the graphical frame FRAME." | ||
| 53 | ;; Don't do this twice on the same display, or it would break | ||
| 54 | ;; normal-erase-is-backspace-mode. | ||
| 55 | (unless (terminal-parameter frame 'x-setup-function-keys) | ||
| 56 | ;; Map certain keypad keys into ASCII characters that people usually expect. | ||
| 57 | (with-selected-frame frame | ||
| 58 | (let ((map (copy-keymap x-alternatives-map))) | ||
| 59 | (set-keymap-parent map (keymap-parent local-function-key-map)) | ||
| 60 | (set-keymap-parent local-function-key-map map))) | ||
| 61 | (set-terminal-parameter frame 'x-setup-function-keys t))) | ||
| 62 | |||
| 63 | (declare-function set-message-beep "w32console.c") | 35 | (declare-function set-message-beep "w32console.c") |
| 64 | (declare-function w32-get-clipboard-data "w32select.c") | 36 | (declare-function w32-get-clipboard-data "w32select.c") |
| 65 | (declare-function w32-get-locale-info "w32proc.c") | 37 | (declare-function w32-get-locale-info "w32proc.c") |
| @@ -432,22 +404,6 @@ bit output with no translation." | |||
| 432 | ;; from x-selection-value. | 404 | ;; from x-selection-value. |
| 433 | (defvar x-last-selected-text nil) | 405 | (defvar x-last-selected-text nil) |
| 434 | 406 | ||
| 435 | (defun x-select-text (text) | ||
| 436 | "Select TEXT, a string, according to the window system. | ||
| 437 | |||
| 438 | On X, if `x-select-enable-clipboard' is non-nil, copy TEXT to the | ||
| 439 | clipboard. If `x-select-enable-primary' is non-nil, put TEXT in | ||
| 440 | the primary selection. | ||
| 441 | |||
| 442 | On Windows, make TEXT the current selection. If | ||
| 443 | `x-select-enable-clipboard' is non-nil, copy the text to the | ||
| 444 | clipboard as well. | ||
| 445 | |||
| 446 | On Nextstep, put TEXT in the pasteboard." | ||
| 447 | (if x-select-enable-clipboard | ||
| 448 | (w32-set-clipboard-data text)) | ||
| 449 | (setq x-last-selected-text text)) | ||
| 450 | |||
| 451 | (defun x-get-selection-value () | 407 | (defun x-get-selection-value () |
| 452 | "Return the value of the current selection. | 408 | "Return the value of the current selection. |
| 453 | Consult the selection. Treat empty strings as if they were unset." | 409 | Consult the selection. Treat empty strings as if they were unset." |
| @@ -503,5 +459,4 @@ to include Sed, which is used by leim/Makefile.in to do the job." | |||
| 503 | (delete-matching-lines "^$\\|^;") | 459 | (delete-matching-lines "^$\\|^;") |
| 504 | (save-buffers-kill-emacs t)) | 460 | (save-buffers-kill-emacs t)) |
| 505 | 461 | ||
| 506 | ;; arch-tag: c49b48cc-0f4f-454f-a274-c2dc34815e14 | ||
| 507 | ;;; w32-fns.el ends here | 462 | ;;; w32-fns.el ends here |