bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#5668: acknowledged by developer (control message for bug #5668)


From: Gallagher, Kevin
Subject: bug#5668: acknowledged by developer (control message for bug #5668)
Date: Wed, 13 Jul 2011 15:01:29 -0500

Lars Magne Ingebrigtsen <larsi <at> gnus.org> writes:

 

> Yes, binding [kp-delete] seems rather gratuitous, but many modes bind

> [delete].  If you want to rebind them to something else, you can use the

> mode hooks to alter their definitions.  So I don't really think this is

> a bug.

 

I should have been more specific.  The above change affects the EDT Emulation package (bundled with GNU Emacs) in a shell window.  (I am the maintainer of this package.).  Now, EDT Emulation does not run as a mode.  Instead, it copies the global map, escape map, etc., and modifies the copies of these maps, saving off the originals. 

 

During first time setup, when using a Window system, a user executes edt-mapper.el to bind EDT functions to the keypad keys, function keys, and some other keys like Home, PageUp, End, PageDown, Delete, Insert, etc.  This allows the user to map EDT functions to the same (or almost the same) physical location they are bound to on DEC VT-100/VT-200 series keyboards when using the actual EDT editor on DEC VMS computers.

 

Normally, on a PC keyboard, an EDT Emulation user will map [delete] and [kp-delete] to the function edt-select to correspond to the default mapping in the EDT editor, but users are free to map it differently if they choose.  However, the recent change made to comint.el overrides these EDT Emulation bindings in a shell window, which really puzzled me, at first, until I cracked open comint.el and saw what was going on.

 

Recently, I discovered in Emacs 23.x that the keymap, local-function-key-map, has new bindings made to all the keypad keys.  These bindings override the behavior expected by edt-mapper.el and prevent it from doing the right thing.  I did develop a workaround to deal with this, but it is rather ugly.  In my .emacs file, I have to unbind all the PC keypad keys like this:

 

(defun undef-keys-for-edt-mapper ()

  (define-key local-function-key-map [kp-0] nil)

  (define-key local-function-key-map [kp-1] nil)

  (define-key local-function-key-map [kp-2] nil)

  (define-key local-function-key-map [kp-3] nil)

  (define-key local-function-key-map [kp-4] nil)

  (define-key local-function-key-map [kp-5] nil)

  (define-key local-function-key-map [kp-6] nil)

  (define-key local-function-key-map [kp-7] nil)

  (define-key local-function-key-map [kp-8] nil)

  (define-key local-function-key-map [kp-9] nil)

  (define-key local-function-key-map [kp-divide] nil)

  (define-key local-function-key-map [kp-multiply] nil)

  (define-key local-function-key-map [kp-subtract] nil)

  (define-key local-function-key-map [kp-add] nil)

  (define-key local-function-key-map [kp-enter] nil)

  (define-key local-function-key-map [kp-decimal] nil)

  (define-key local-function-key-map [delete] nil)

  ))

 

And start the EDT Emulation like this:

 

(defun my-term-setup ()

  ;; Allow rebinding of keypad keys and delete key in EDT

  ;; Emulation by edt-mapper.el. This is accomplished by removing

  ;; lower level redirection of these keys.

  (undef-keys-for-edt-mapper))

  ;; On MS Windows, normal-erase-is-backspace-mode is turned on by

  ;; default. When on, it also remaps most of the keypad keys,

  ;; which breaks EDT Emulation. So, it is turned off, here, to

  ;; prevent the remapping.

  (normal-erase-is-backspace-mode nil)

  (setq edt-word-entities '(?\t ?- ?/))

  (edt-emulation-on)

)

(add-hook 'term-setup-hook 'my-term-setup)

 

Kevin Gallagher

 


reply via email to

[Prev in Thread] Current Thread [Next in Thread]