diff options
| author | Miles Bader | 2007-12-06 09:51:45 +0000 |
|---|---|---|
| committer | Miles Bader | 2007-12-06 09:51:45 +0000 |
| commit | 0bd508417142ff377f34aec8dcec9438d9175c2c (patch) | |
| tree | 4d60fe09e5cebf7d79766b11e9cda8cc1c9dbb9b /lisp/term | |
| parent | 98fe991da804a42f53f6a5e84cd5eab18a82e181 (diff) | |
| parent | 9fb1ba8090da3528de56158a79bd3527d31c7f2f (diff) | |
| download | emacs-0bd508417142ff377f34aec8dcec9438d9175c2c.tar.gz emacs-0bd508417142ff377f34aec8dcec9438d9175c2c.zip | |
Merge from emacs--devo--0
Revision: emacs@sv.gnu.org/emacs--unicode--0--patch-294
Diffstat (limited to 'lisp/term')
| -rw-r--r-- | lisp/term/mac-win.el | 54 | ||||
| -rw-r--r-- | lisp/term/pc-win.el | 4 | ||||
| -rw-r--r-- | lisp/term/tty-colors.el | 3 | ||||
| -rw-r--r-- | lisp/term/w32-win.el | 15 | ||||
| -rw-r--r-- | lisp/term/w32console.el | 65 | ||||
| -rw-r--r-- | lisp/term/x-win.el | 21 |
6 files changed, 119 insertions, 43 deletions
diff --git a/lisp/term/mac-win.el b/lisp/term/mac-win.el index e81f71c582f..3c648b9e6b3 100644 --- a/lisp/term/mac-win.el +++ b/lisp/term/mac-win.el | |||
| @@ -84,6 +84,14 @@ | |||
| 84 | (defvar mac-font-panel-mode) | 84 | (defvar mac-font-panel-mode) |
| 85 | (defvar mac-ts-active-input-overlay) | 85 | (defvar mac-ts-active-input-overlay) |
| 86 | (defvar x-invocation-args) | 86 | (defvar x-invocation-args) |
| 87 | (declare-function mac-code-convert-string "mac.c") | ||
| 88 | (declare-function mac-coerce-ae-data "mac.c") | ||
| 89 | (declare-function mac-resume-apple-event "macselect.c") | ||
| 90 | ;; Suppress warning when compiling on non-Mac. | ||
| 91 | (declare-function mac-font-panel-mode "mac-win.el") | ||
| 92 | (declare-function mac-atsu-font-face-attributes "macfns.c") | ||
| 93 | (declare-function mac-ae-set-reply-parameter "macselect.c") | ||
| 94 | (declare-function mac-clear-font-name-table "macfns.c") | ||
| 87 | 95 | ||
| 88 | (defvar x-command-line-resources nil) | 96 | (defvar x-command-line-resources nil) |
| 89 | 97 | ||
| @@ -1058,28 +1066,31 @@ XConsortium: rgb.txt,v 10.41 94/02/20 18:39:36 rws Exp") | |||
| 1058 | 1066 | ||
| 1059 | ;;;; Function keys | 1067 | ;;;; Function keys |
| 1060 | 1068 | ||
| 1061 | (substitute-key-definition 'suspend-emacs 'iconify-or-deiconify-frame | ||
| 1062 | global-map) | ||
| 1063 | |||
| 1064 | (defun x-setup-function-keys (frame) | 1069 | (defun x-setup-function-keys (frame) |
| 1065 | "Setup Function Keys for mac." | 1070 | "Setup Function Keys for mac." |
| 1066 | ;; Map certain keypad keys into ASCII characters | 1071 | ;; Don't do this twice on the same display, or it would break |
| 1067 | ;; that people usually expect. | 1072 | ;; normal-erase-is-backspace-mode. |
| 1068 | (define-key local-function-key-map [backspace] [?\d]) | 1073 | (unless (terminal-parameter frame 'x-setup-function-keys) |
| 1069 | (define-key local-function-key-map [delete] [?\d]) | 1074 | (with-selected-frame frame |
| 1070 | (define-key local-function-key-map [tab] [?\t]) | 1075 | ;; Map certain keypad keys into ASCII characters |
| 1071 | (define-key local-function-key-map [linefeed] [?\n]) | 1076 | ;; that people usually expect. |
| 1072 | (define-key local-function-key-map [clear] [?\C-l]) | 1077 | (define-key local-function-key-map [backspace] [?\d]) |
| 1073 | (define-key local-function-key-map [return] [?\C-m]) | 1078 | (define-key local-function-key-map [delete] [?\d]) |
| 1074 | (define-key local-function-key-map [escape] [?\e]) | 1079 | (define-key local-function-key-map [tab] [?\t]) |
| 1075 | (define-key local-function-key-map [M-backspace] [?\M-\d]) | 1080 | (define-key local-function-key-map [linefeed] [?\n]) |
| 1076 | (define-key local-function-key-map [M-delete] [?\M-\d]) | 1081 | (define-key local-function-key-map [clear] [?\C-l]) |
| 1077 | (define-key local-function-key-map [M-tab] [?\M-\t]) | 1082 | (define-key local-function-key-map [return] [?\C-m]) |
| 1078 | (define-key local-function-key-map [M-linefeed] [?\M-\n]) | 1083 | (define-key local-function-key-map [escape] [?\e]) |
| 1079 | (define-key local-function-key-map [M-clear] [?\M-\C-l]) | 1084 | (define-key local-function-key-map [M-backspace] [?\M-\d]) |
| 1080 | (define-key local-function-key-map [M-return] [?\M-\C-m]) | 1085 | (define-key local-function-key-map [M-delete] [?\M-\d]) |
| 1081 | (define-key local-function-key-map [M-escape] [?\M-\e]) | 1086 | (define-key local-function-key-map [M-tab] [?\M-\t]) |
| 1082 | ) | 1087 | (define-key local-function-key-map [M-linefeed] [?\M-\n]) |
| 1088 | (define-key local-function-key-map [M-clear] [?\M-\C-l]) | ||
| 1089 | (define-key local-function-key-map [M-return] [?\M-\C-m]) | ||
| 1090 | (define-key local-function-key-map [M-escape] [?\M-\e]) | ||
| 1091 | (substitute-key-definition 'suspend-emacs 'iconify-or-deiconify-frame | ||
| 1092 | local-function-key-map global-map)) | ||
| 1093 | (set-terminal-parameter frame 'x-setup-function-keys t))) | ||
| 1083 | 1094 | ||
| 1084 | ;; These tell read-char how to convert | 1095 | ;; These tell read-char how to convert |
| 1085 | ;; these special chars to ASCII. | 1096 | ;; these special chars to ASCII. |
| @@ -1811,6 +1822,9 @@ if possible. If there's no such frame, a new frame is created." | |||
| 1811 | ;; Reaches here if the user has canceled the quit. | 1822 | ;; Reaches here if the user has canceled the quit. |
| 1812 | (mac-resume-apple-event ae -128)))) ; userCanceledErr | 1823 | (mac-resume-apple-event ae -128)))) ; userCanceledErr |
| 1813 | 1824 | ||
| 1825 | ;; url-generic-parse-url is autoloaded from url-parse. | ||
| 1826 | (declare-function url-type "url-parse" t t) ; defstruct | ||
| 1827 | |||
| 1814 | (defun mac-ae-get-url (event) | 1828 | (defun mac-ae-get-url (event) |
| 1815 | "Open the URL specified by the Apple event EVENT. | 1829 | "Open the URL specified by the Apple event EVENT. |
| 1816 | Currently the `mailto' scheme is supported." | 1830 | Currently the `mailto' scheme is supported." |
diff --git a/lisp/term/pc-win.el b/lisp/term/pc-win.el index ecbda7d9c1e..2ddb4e40433 100644 --- a/lisp/term/pc-win.el +++ b/lisp/term/pc-win.el | |||
| @@ -29,6 +29,10 @@ | |||
| 29 | 29 | ||
| 30 | (load "term/internal" nil t) | 30 | (load "term/internal" nil t) |
| 31 | 31 | ||
| 32 | (declare-function msdos-remember-default-colors "msdos.c") | ||
| 33 | (declare-function w16-set-clipboard-data "w16select.c") | ||
| 34 | (declare-function w16-get-clipboard-data "w16select.c") | ||
| 35 | |||
| 32 | ;;; This is copied from etc/rgb.txt, except that some values were changed | 36 | ;;; This is copied from etc/rgb.txt, except that some values were changed |
| 33 | ;;; a bit to make them consistent with DOS console colors, and the RGB | 37 | ;;; a bit to make them consistent with DOS console colors, and the RGB |
| 34 | ;;; values were scaled up to 16 bits, as `tty-define-color' requires. | 38 | ;;; values were scaled up to 16 bits, as `tty-define-color' requires. |
diff --git a/lisp/term/tty-colors.el b/lisp/term/tty-colors.el index 70323e3155b..5622efa022d 100644 --- a/lisp/term/tty-colors.el +++ b/lisp/term/tty-colors.el | |||
| @@ -63,7 +63,6 @@ | |||
| 63 | ;;; Code: | 63 | ;;; Code: |
| 64 | 64 | ||
| 65 | (defvar msdos-color-values) | 65 | (defvar msdos-color-values) |
| 66 | (defvar w32-tty-standard-colors) | ||
| 67 | 66 | ||
| 68 | ;; The following list is taken from rgb.txt distributed with X. | 67 | ;; The following list is taken from rgb.txt distributed with X. |
| 69 | ;; | 68 | ;; |
| @@ -816,8 +815,6 @@ Value is the modified color alist for FRAME." | |||
| 816 | "Register the default set of colors for a character terminal." | 815 | "Register the default set of colors for a character terminal." |
| 817 | (let* ((colors (cond ((eq window-system 'pc) | 816 | (let* ((colors (cond ((eq window-system 'pc) |
| 818 | msdos-color-values) | 817 | msdos-color-values) |
| 819 | ((eq system-type 'windows-nt) | ||
| 820 | w32-tty-standard-colors) | ||
| 821 | (t tty-standard-colors))) | 818 | (t tty-standard-colors))) |
| 822 | (color (car colors))) | 819 | (color (car colors))) |
| 823 | (while colors | 820 | (while colors |
diff --git a/lisp/term/w32-win.el b/lisp/term/w32-win.el index 688dd7deea8..bdaeaf1b52e 100644 --- a/lisp/term/w32-win.el +++ b/lisp/term/w32-win.el | |||
| @@ -87,6 +87,10 @@ | |||
| 87 | (defvar xlfd-regexp-registry-subnum) | 87 | (defvar xlfd-regexp-registry-subnum) |
| 88 | (defvar w32-color-map) ;; defined in w32fns.c | 88 | (defvar w32-color-map) ;; defined in w32fns.c |
| 89 | 89 | ||
| 90 | (declare-function w32-send-sys-command "w32fns.c") | ||
| 91 | (declare-function w32-select-font "w32fns.c") | ||
| 92 | (declare-function set-message-beep "w32console.c") | ||
| 93 | |||
| 90 | ;; Conditional on new-fontset so bootstrapping works on non-GUI compiles | 94 | ;; Conditional on new-fontset so bootstrapping works on non-GUI compiles |
| 91 | (if (fboundp 'new-fontset) | 95 | (if (fboundp 'new-fontset) |
| 92 | (require 'fontset)) | 96 | (require 'fontset)) |
| @@ -1053,17 +1057,6 @@ XConsortium: rgb.txt,v 10.41 94/02/20 18:39:36 rws Exp") | |||
| 1053 | If FRAME is nil or not given, use the selected frame." | 1057 | If FRAME is nil or not given, use the selected frame." |
| 1054 | (interactive "i") | 1058 | (interactive "i") |
| 1055 | (w32-send-sys-command ?\xf100 frame)) | 1059 | (w32-send-sys-command ?\xf100 frame)) |
| 1056 | |||
| 1057 | (defun x-setup-function-keys (frame) | ||
| 1058 | "Setup Function Keys for w32." | ||
| 1059 | (with-selected-frame frame | ||
| 1060 | (define-key local-function-key-map [f10] 'menu-bar-open) | ||
| 1061 | |||
| 1062 | (substitute-key-definition 'suspend-emacs 'iconify-or-deiconify-frame | ||
| 1063 | local-function-key-map global-map) | ||
| 1064 | |||
| 1065 | (define-key local-function-key-map [S-tab] [backtab])) | ||
| 1066 | (set-terminal-parameter frame 'x-setup-function-keys t)) | ||
| 1067 | 1060 | ||
| 1068 | 1061 | ||
| 1069 | ;; W32 systems have different fonts than commonly found on X, so | 1062 | ;; W32 systems have different fonts than commonly found on X, so |
diff --git a/lisp/term/w32console.el b/lisp/term/w32console.el new file mode 100644 index 00000000000..f45d7e0ad7a --- /dev/null +++ b/lisp/term/w32console.el | |||
| @@ -0,0 +1,65 @@ | |||
| 1 | ;;; w32console.el -- Setup w32 console keys and colors. | ||
| 2 | |||
| 3 | ;; Copyright (C) 2007 Free Software Foundation, Inc. | ||
| 4 | |||
| 5 | ;; Author: FSF | ||
| 6 | ;; Keywords: terminals | ||
| 7 | |||
| 8 | ;; This file is part of GNU Emacs. | ||
| 9 | |||
| 10 | ;; GNU Emacs is free software; you can redistribute it and/or modify | ||
| 11 | ;; it under the terms of the GNU General Public License as published by | ||
| 12 | ;; the Free Software Foundation; either version 3, or (at your option) | ||
| 13 | ;; any later version. | ||
| 14 | |||
| 15 | ;; GNU Emacs is distributed in the hope that it will be useful, | ||
| 16 | ;; but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 17 | ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 18 | ;; GNU General Public License for more details. | ||
| 19 | |||
| 20 | ;; You should have received a copy of the GNU General Public License | ||
| 21 | ;; along with GNU Emacs; see the file COPYING. If not, write to the | ||
| 22 | ;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | ||
| 23 | ;; Boston, MA 02110-1301, USA. | ||
| 24 | |||
| 25 | ;;; Commentary: | ||
| 26 | |||
| 27 | ;;; Code: | ||
| 28 | |||
| 29 | ;; W32 uses different color indexes than standard: | ||
| 30 | |||
| 31 | (defvar w32-tty-standard-colors | ||
| 32 | '(("black" 0 0 0 0) | ||
| 33 | ("blue" 1 0 0 52480) ; MediumBlue | ||
| 34 | ("green" 2 8704 35584 8704) ; ForestGreen | ||
| 35 | ("cyan" 3 0 52736 53504) ; DarkTurquoise | ||
| 36 | ("red" 4 45568 8704 8704) ; FireBrick | ||
| 37 | ("magenta" 5 35584 0 35584) ; DarkMagenta | ||
| 38 | ("brown" 6 40960 20992 11520) ; Sienna | ||
| 39 | ("lightgray" 7 48640 48640 48640) ; Gray | ||
| 40 | ("darkgray" 8 26112 26112 26112) ; Gray40 | ||
| 41 | ("lightblue" 9 0 0 65535) ; Blue | ||
| 42 | ("lightgreen" 10 0 65535 0) ; Green | ||
| 43 | ("lightcyan" 11 0 65535 65535) ; Cyan | ||
| 44 | ("lightred" 12 65535 0 0) ; Red | ||
| 45 | ("lightmagenta" 13 65535 0 65535) ; Magenta | ||
| 46 | ("yellow" 14 65535 65535 0) ; Yellow | ||
| 47 | ("white" 15 65535 65535 65535)) | ||
| 48 | "A list of VGA console colors, their indices and 16-bit RGB values.") | ||
| 49 | |||
| 50 | (defun terminal-init-w32console () | ||
| 51 | "Terminal initialization function for w32 console." | ||
| 52 | ;; Share function key initialization with w32 gui frames | ||
| 53 | (x-setup-function-keys (selected-frame)) | ||
| 54 | (let* ((colors w32-tty-standard-colors) | ||
| 55 | (color (car colors))) | ||
| 56 | (tty-color-clear) | ||
| 57 | (while colors | ||
| 58 | (tty-color-define (car color) (cadr color) (cddr color)) | ||
| 59 | (setq colors (cdr colors) | ||
| 60 | color (car colors)))) | ||
| 61 | (clear-face-cache) | ||
| 62 | (tty-set-up-initial-frame-faces) | ||
| 63 | (run-hooks 'terminal-init-w32-hook)) | ||
| 64 | |||
| 65 | ;; arch-tag: 3195fd5e-ab86-4a46-b1dc-4f7a8c8deff3 | ||
diff --git a/lisp/term/x-win.el b/lisp/term/x-win.el index eb2e559a0d1..ffd2a98c6b0 100644 --- a/lisp/term/x-win.el +++ b/lisp/term/x-win.el | |||
| @@ -2576,15 +2576,18 @@ If you don't want stock icons, set the variable to nil." | |||
| 2576 | 2576 | ||
| 2577 | (defun x-gtk-map-stock (file) | 2577 | (defun x-gtk-map-stock (file) |
| 2578 | "Map icon with file name FILE to a Gtk+ stock name, using `x-gtk-stock-map'." | 2578 | "Map icon with file name FILE to a Gtk+ stock name, using `x-gtk-stock-map'." |
| 2579 | (let* ((file-sans (file-name-sans-extension file)) | 2579 | (if (stringp file) |
| 2580 | (key (and (string-match "/\\([^/]+/[^/]+/[^/]+$\\)" file-sans) | 2580 | (let* ((file-sans (file-name-sans-extension file)) |
| 2581 | (match-string 1 file-sans))) | 2581 | (key (and (string-match "/\\([^/]+/[^/]+/[^/]+$\\)" file-sans) |
| 2582 | (value)) | 2582 | (match-string 1 file-sans))) |
| 2583 | (mapc (lambda (elem) | 2583 | (value)) |
| 2584 | (let ((assoc (if (symbolp elem) (symbol-value elem) elem))) | 2584 | (mapc (lambda (elem) |
| 2585 | (or value (setq value (assoc-string (or key file-sans) assoc))))) | 2585 | (let ((assoc (if (symbolp elem) (symbol-value elem) elem))) |
| 2586 | icon-map-list) | 2586 | (or value (setq value (assoc-string (or key file-sans) |
| 2587 | (and value (cdr value)))) | 2587 | assoc))))) |
| 2588 | icon-map-list) | ||
| 2589 | (and value (cdr value))) | ||
| 2590 | nil)) | ||
| 2588 | 2591 | ||
| 2589 | (provide 'x-win) | 2592 | (provide 'x-win) |
| 2590 | 2593 | ||