Gentoo Archives: gentoo-commits

From: "Ulrich Mueller (ulm)" <ulm@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in app-editors/emacs/files: emacs-23.1-backspace.patch
Date: Wed, 28 Oct 2009 19:38:56
Message-Id: E1N3EM9-0001b8-Lu@stork.gentoo.org
1 ulm 09/10/28 19:38:53
2
3 Added: emacs-23.1-backspace.patch
4 Log:
5 Fix swapped backspace and delete keys when started as daemon, bug 289709.
6 (Portage version: 2.2_rc46/cvs/Linux i686)
7
8 Revision Changes Path
9 1.1 app-editors/emacs/files/emacs-23.1-backspace.patch
10
11 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/app-editors/emacs/files/emacs-23.1-backspace.patch?rev=1.1&view=markup
12 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/app-editors/emacs/files/emacs-23.1-backspace.patch?rev=1.1&content-type=text/plain
13
14 Index: emacs-23.1-backspace.patch
15 ===================================================================
16 2009-10-22 Stefan Monnier <monnier@×××××××××××××.ca>
17
18 * simple.el (normal-erase-is-backspace-mode): Use input-decode-map
19 rather than fiddling with global-map bindings, since it should only
20 affect per-terminal settings.
21 See http://bugs.gentoo.org/show_bug.cgi?id=289709.
22
23 --- emacs-23.1-orig/lisp/simple.el
24 +++ emacs-23.1/lisp/simple.el
25 @@ -6269,31 +6269,27 @@
26 (let* ((bindings
27 `(([M-delete] [M-backspace])
28 ([C-M-delete] [C-M-backspace])
29 - (,esc-map
30 - [C-delete] [C-backspace])))
31 + ([?\e C-delete] [?\e C-backspace])))
32 (old-state (lookup-key local-function-key-map [delete])))
33
34 (if enabled
35 (progn
36 (define-key local-function-key-map [delete] [?\C-d])
37 (define-key local-function-key-map [kp-delete] [?\C-d])
38 - (define-key local-function-key-map [backspace] [?\C-?]))
39 + (define-key local-function-key-map [backspace] [?\C-?])
40 + (dolist (b bindings)
41 + ;; Not sure if input-decode-map is really right, but
42 + ;; keyboard-translate-table (used below) only works
43 + ;; for integer events, and key-translation-table is
44 + ;; global (like the global-map, used earlier).
45 + (define-key input-decode-map (car b) nil)
46 + (define-key input-decode-map (cadr b) nil)))
47 (define-key local-function-key-map [delete] [?\C-?])
48 (define-key local-function-key-map [kp-delete] [?\C-?])
49 - (define-key local-function-key-map [backspace] [?\C-?]))
50 -
51 - ;; Maybe swap bindings of C-delete and C-backspace, etc.
52 - (unless (equal old-state (lookup-key local-function-key-map [delete]))
53 - (dolist (binding bindings)
54 - (let ((map global-map))
55 - (when (keymapp (car binding))
56 - (setq map (car binding) binding (cdr binding)))
57 - (let* ((key1 (nth 0 binding))
58 - (key2 (nth 1 binding))
59 - (binding1 (lookup-key map key1))
60 - (binding2 (lookup-key map key2)))
61 - (define-key map key1 binding2)
62 - (define-key map key2 binding1)))))))
63 + (define-key local-function-key-map [backspace] [?\C-?])
64 + (dolist (b bindings)
65 + (define-key input-decode-map (car b) (cadr b))
66 + (define-key input-decode-map (cadr b) (car b))))))
67 (t
68 (if enabled
69 (progn