aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Monnier2009-10-22 19:31:43 +0000
committerStefan Monnier2009-10-22 19:31:43 +0000
commit28a90c44b4f5009470b6d2ecbea3b9c6e5fa5180 (patch)
tree6c9a3d88938e8c08d5dbb9eb789b6b079a8dada4
parenta452eee82d9dfff06caa64cec4480362c2b0ad03 (diff)
downloademacs-28a90c44b4f5009470b6d2ecbea3b9c6e5fa5180.tar.gz
emacs-28a90c44b4f5009470b6d2ecbea3b9c6e5fa5180.zip
* simple.el (normal-erase-is-backspace-mode): Use input-decode-map
rather than fiddling with global-map bindings, since it should only affect per-terminal settings. See http://bugs.gentoo.org/show_bug.cgi?id=289709.
-rw-r--r--lisp/ChangeLog5
-rw-r--r--lisp/simple.el30
2 files changed, 18 insertions, 17 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 5e77cb43175..3fa53ded61e 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,5 +1,10 @@
12009-10-22 Stefan Monnier <monnier@iro.umontreal.ca> 12009-10-22 Stefan Monnier <monnier@iro.umontreal.ca>
2 2
3 * simple.el (normal-erase-is-backspace-mode): Use input-decode-map
4 rather than fiddling with global-map bindings, since it should only
5 affect per-terminal settings.
6 See http://bugs.gentoo.org/show_bug.cgi?id=289709.
7
3 * minibuffer.el (completion-table-with-terminator): Allow to specify 8 * minibuffer.el (completion-table-with-terminator): Allow to specify
4 the terminator-regexp. 9 the terminator-regexp.
5 10
diff --git a/lisp/simple.el b/lisp/simple.el
index 34107edf432..ed9f57fc773 100644
--- a/lisp/simple.el
+++ b/lisp/simple.el
@@ -6415,31 +6415,27 @@ See also `normal-erase-is-backspace'."
6415 (let* ((bindings 6415 (let* ((bindings
6416 `(([M-delete] [M-backspace]) 6416 `(([M-delete] [M-backspace])
6417 ([C-M-delete] [C-M-backspace]) 6417 ([C-M-delete] [C-M-backspace])
6418 (,esc-map 6418 ([?\e C-delete] [?\e C-backspace])))
6419 [C-delete] [C-backspace])))
6420 (old-state (lookup-key local-function-key-map [delete]))) 6419 (old-state (lookup-key local-function-key-map [delete])))
6421 6420
6422 (if enabled 6421 (if enabled
6423 (progn 6422 (progn
6424 (define-key local-function-key-map [delete] [?\C-d]) 6423 (define-key local-function-key-map [delete] [?\C-d])
6425 (define-key local-function-key-map [kp-delete] [?\C-d]) 6424 (define-key local-function-key-map [kp-delete] [?\C-d])
6426 (define-key local-function-key-map [backspace] [?\C-?])) 6425 (define-key local-function-key-map [backspace] [?\C-?])
6426 (dolist (b bindings)
6427 ;; Not sure if input-decode-map is really right, but
6428 ;; keyboard-translate-table (used below) only works
6429 ;; for integer events, and key-translation-table is
6430 ;; global (like the global-map, used earlier).
6431 (define-key input-decode-map (car b) nil)
6432 (define-key input-decode-map (cadr b) nil)))
6427 (define-key local-function-key-map [delete] [?\C-?]) 6433 (define-key local-function-key-map [delete] [?\C-?])
6428 (define-key local-function-key-map [kp-delete] [?\C-?]) 6434 (define-key local-function-key-map [kp-delete] [?\C-?])
6429 (define-key local-function-key-map [backspace] [?\C-?])) 6435 (define-key local-function-key-map [backspace] [?\C-?])
6430 6436 (dolist (b bindings)
6431 ;; Maybe swap bindings of C-delete and C-backspace, etc. 6437 (define-key input-decode-map (car b) (cadr b))
6432 (unless (equal old-state (lookup-key local-function-key-map [delete])) 6438 (define-key input-decode-map (cadr b) (car b))))))
6433 (dolist (binding bindings)
6434 (let ((map global-map))
6435 (when (keymapp (car binding))
6436 (setq map (car binding) binding (cdr binding)))
6437 (let* ((key1 (nth 0 binding))
6438 (key2 (nth 1 binding))
6439 (binding1 (lookup-key map key1))
6440 (binding2 (lookup-key map key2)))
6441 (define-key map key1 binding2)
6442 (define-key map key2 binding1)))))))
6443 (t 6439 (t
6444 (if enabled 6440 (if enabled
6445 (progn 6441 (progn