From: Stefan Monnier Date: Mon, 14 Sep 2009 01:22:42 +0000 (+0000) Subject: * simple.el: Add mapping for backspace/delete/clear/tab/escape/return X-Git-Tag: emacs-pretest-23.1.90~1328 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=31cd2dd4e14916714a5178b57dfda171a219cc93;p=emacs.git * simple.el: Add mapping for backspace/delete/clear/tab/escape/return to function-key-map, and give them ascii-character property. * term/x-win.el (x-alternatives-map): * term/ns-win.el (ns-alternatives-map): * term/internal.el (msdos-key-remapping-map): * w32-fns.el (x-alternatives-map): Remove redundant mappings. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 41362abced0..72054a6835f 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,12 @@ +2009-09-14 Stefan Monnier + + * simple.el: Add mapping for backspace/delete/clear/tab/escape/return + to function-key-map, and give them ascii-character property. + * term/x-win.el (x-alternatives-map): + * term/ns-win.el (ns-alternatives-map): + * term/internal.el (msdos-key-remapping-map): + * w32-fns.el (x-alternatives-map): Remove redundant mappings. + 2009-09-14 Glenn Morris * emacs-lisp/elint.el (elint-add-required-env): Revert to not using @@ -28,16 +37,16 @@ * progmodes/cperl-mode.el (cperl-init-faces): Revert last change. * eshell/em-hist.el: - * eshell/em-dirs.el (eshell-complete-user-reference): Declare - pcomplete functions and variables to avoid compiler warnings. + * eshell/em-dirs.el (eshell-complete-user-reference): + Declare pcomplete functions and variables to avoid compiler warnings. 2009-09-13 Leo (tiny change) * eshell/em-script.el (eshell-login-script, eshell-rc-script): * eshell/em-dirs.el (eshell-last-dir-ring-file-name): * eshell/em-alias.el (eshell-aliases-file): - * eshell/em-hist.el (eshell-history-file-name): Use - expand-file-name instead of concat to make file names (Bug#4308). + * eshell/em-hist.el (eshell-history-file-name): + Use expand-file-name instead of concat to make file names (Bug#4308). 2009-09-13 Glenn Morris @@ -1541,11 +1550,9 @@ (cperl-forward-re): Check cperl-brace-recursing. (cperl-highlight-charclass): New function. (cperl-find-pods-heres): Use it. - (cperl-fill-paragraph): Synch to save-excursion placement used - upstream. + (cperl-fill-paragraph): Synch to save-excursion placement used upstream. (cperl-beautify-regexp-piece): Fix column calculation. - (cperl-make-regexp-x): Handle case where point is between "q" and - "rs". + (cperl-make-regexp-x): Handle case where point is between "q" and "rs". (cperl-beautify-level): Don't process entire regexp. (cperl-build-manpage, cperl-perldoc): Bind Man-switches before calling man. diff --git a/lisp/simple.el b/lisp/simple.el index a34d8937cd8..e9498c4e6d0 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -6104,7 +6104,17 @@ PREFIX is the string that represents this modifier in an event type symbol." (kp-subtract ?-) (kp-decimal ?.) (kp-divide ?/) - (kp-equal ?=))) + (kp-equal ?=) + ;; Do the same for various keys that are represented as symbols under + ;; GUIs but naturally correspond to characters. + (backspace 127) + (delete 127) + (tab ?\t) + (linefeed ?\n) + (clear ?\C-l) + (return ?\C-m) + (escape ?\e) + )) ;;;; ;;;; forking a twin copy of a buffer. diff --git a/lisp/term/internal.el b/lisp/term/internal.el index bbcedf75630..995605bacf0 100644 --- a/lisp/term/internal.el +++ b/lisp/term/internal.el @@ -28,13 +28,6 @@ (defvar msdos-key-remapping-map (let ((map (make-sparse-keymap))) ;; keyboard setup -- that's simple! - (define-key map [backspace] "\177") ; Normal behavior for BS - (define-key map [delete] "\C-d") ; ... and Delete - (define-key map [tab] [?\t]) - (define-key map [linefeed] [?\n]) - (define-key map [clear] [11]) - (define-key map [return] [13]) - (define-key map [escape] [?\e]) (define-key map [M-backspace] [?\M-\d]) (define-key map [M-delete] [?\M-d]) (define-key map [M-tab] [?\M-\t]) @@ -45,15 +38,6 @@ map) "Keymap for remapping special keys on MS-DOS keyboard.") -;; These tell read-char how to convert these special chars to ASCII. -(put 'backspace 'ascii-character 127) -(put 'delete 'ascii-character 127) -(put 'tab 'ascii-character ?\t) -(put 'linefeed 'ascii-character ?\n) -(put 'clear 'ascii-character 12) -(put 'return 'ascii-character 13) -(put 'escape 'ascii-character ?\e) - (defun msdos-setup-keyboard (frame) "Setup `local-function-key-map' for MS-DOS keyboard." ;; Don't do this twice on the same display, or it would break diff --git a/lisp/term/ns-win.el b/lisp/term/ns-win.el index 17ec9306fc8..3dbf3c063af 100644 --- a/lisp/term/ns-win.el +++ b/lisp/term/ns-win.el @@ -187,33 +187,13 @@ The properties returned may include `top', `left', `height', and `width'." ;;;; Keyboard mapping. ;; These tell read-char how to convert these special chars to ASCII. -;;TODO: all terms have these, and at least the return mapping is necessary -;; for tramp to recognize the enter key. -;; Perhaps they should be moved into common code somewhere -;; (when a window system is active). -;; Remove if no problems for some time after 2008-08-06. -(put 'backspace 'ascii-character 127) -(put 'delete 'ascii-character 127) -(put 'tab 'ascii-character ?\t) (put 'S-tab 'ascii-character (logior 16 ?\t)) -(put 'linefeed 'ascii-character ?\n) -(put 'clear 'ascii-character 12) -(put 'return 'ascii-character 13) -(put 'escape 'ascii-character ?\e) - (defvar ns-alternatives-map (let ((map (make-sparse-keymap))) ;; Map certain keypad keys into ASCII characters ;; that people usually expect. - (define-key map [backspace] [?\d]) - (define-key map [delete] [?\d]) - (define-key map [tab] [?\t]) (define-key map [S-tab] [25]) - (define-key map [linefeed] [?\n]) - (define-key map [clear] [?\C-l]) - (define-key map [return] [?\C-m]) - (define-key map [escape] [?\e]) (define-key map [M-backspace] [?\M-\d]) (define-key map [M-delete] [?\M-\d]) (define-key map [M-tab] [?\M-\t]) diff --git a/lisp/term/x-win.el b/lisp/term/x-win.el index 2648865e0a0..e10e6c6e2d0 100644 --- a/lisp/term/x-win.el +++ b/lisp/term/x-win.el @@ -272,13 +272,6 @@ exists." (defvar x-alternatives-map (let ((map (make-sparse-keymap))) ;; Map certain keypad keys into ASCII characters that people usually expect. - (define-key map [backspace] [127]) - (define-key map [delete] [127]) - (define-key map [tab] [?\t]) - (define-key map [linefeed] [?\n]) - (define-key map [clear] [?\C-l]) - (define-key map [return] [?\C-m]) - (define-key map [escape] [?\e]) (define-key map [M-backspace] [?\M-\d]) (define-key map [M-delete] [?\M-\d]) (define-key map [M-tab] [?\M-\t]) @@ -302,17 +295,6 @@ exists." (set-keymap-parent map (keymap-parent local-function-key-map)) (set-keymap-parent local-function-key-map map))) (set-terminal-parameter frame 'x-setup-function-keys t))) - -;; These tell read-char how to convert -;; these special chars to ASCII. -(put 'backspace 'ascii-character 127) -(put 'delete 'ascii-character 127) -(put 'tab 'ascii-character ?\t) -(put 'linefeed 'ascii-character ?\n) -(put 'clear 'ascii-character 12) -(put 'return 'ascii-character 13) -(put 'escape 'ascii-character ?\e) - ;;;; Keysyms diff --git a/lisp/w32-fns.el b/lisp/w32-fns.el index f118408e400..f1579a97663 100644 --- a/lisp/w32-fns.el +++ b/lisp/w32-fns.el @@ -34,13 +34,6 @@ (defvar x-alternatives-map (let ((map (make-sparse-keymap))) ;; Map certain keypad keys into ASCII characters that people usually expect. - (define-key map [backspace] [127]) - (define-key map [delete] [127]) - (define-key map [tab] [?\t]) - (define-key map [linefeed] [?\n]) - (define-key map [clear] [?\C-l]) - (define-key map [return] [?\C-m]) - (define-key map [escape] [?\e]) (define-key map [M-backspace] [?\M-\d]) (define-key map [M-delete] [?\M-\d]) (define-key map [M-tab] [?\M-\t]) @@ -369,16 +362,6 @@ This function is provided for backward compatibility, since (global-set-key [lwindow] 'ignore) (global-set-key [rwindow] 'ignore) -;; These tell read-char how to convert -;; these special chars to ASCII. -(put 'tab 'ascii-character ?\t) -(put 'linefeed 'ascii-character ?\n) -(put 'clear 'ascii-character 12) -(put 'return 'ascii-character 13) -(put 'escape 'ascii-character ?\e) -(put 'backspace 'ascii-character 127) -(put 'delete 'ascii-character 127) - (defun w32-add-charset-info (xlfd-charset windows-charset codepage) "Function to add character sets to display with Windows fonts. Creates entries in `w32-charset-info-alist'.