# HG changeset patch # User Stefan Monnier # Date 1252891362 0 # Node ID b520d55cdd726c8ad543aa4adbf137e7fd428366 # Parent b9b9c3b2718d8a8181ba21706c53f08790cd0f8c * 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 -r b9b9c3b2718d -r b520d55cdd72 lisp/ChangeLog --- a/lisp/ChangeLog Mon Sep 14 00:48:06 2009 +0000 +++ b/lisp/ChangeLog Mon Sep 14 01:22:42 2009 +0000 @@ -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 -r b9b9c3b2718d -r b520d55cdd72 lisp/simple.el --- a/lisp/simple.el Mon Sep 14 00:48:06 2009 +0000 +++ b/lisp/simple.el Mon Sep 14 01:22:42 2009 +0000 @@ -6104,7 +6104,17 @@ (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 -r b9b9c3b2718d -r b520d55cdd72 lisp/term/internal.el --- a/lisp/term/internal.el Mon Sep 14 00:48:06 2009 +0000 +++ b/lisp/term/internal.el Mon Sep 14 01:22:42 2009 +0000 @@ -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 -r b9b9c3b2718d -r b520d55cdd72 lisp/term/ns-win.el --- a/lisp/term/ns-win.el Mon Sep 14 00:48:06 2009 +0000 +++ b/lisp/term/ns-win.el Mon Sep 14 01:22:42 2009 +0000 @@ -187,33 +187,13 @@ ;;;; 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 -r b9b9c3b2718d -r b520d55cdd72 lisp/term/x-win.el --- a/lisp/term/x-win.el Mon Sep 14 00:48:06 2009 +0000 +++ b/lisp/term/x-win.el Mon Sep 14 01:22:42 2009 +0000 @@ -272,13 +272,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]) @@ -302,17 +295,6 @@ (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 -r b9b9c3b2718d -r b520d55cdd72 lisp/w32-fns.el --- a/lisp/w32-fns.el Mon Sep 14 00:48:06 2009 +0000 +++ b/lisp/w32-fns.el Mon Sep 14 01:22:42 2009 +0000 @@ -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 @@ (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'.