[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Customizing key bindings (was: Re: [CVS] f7, f8 bound..)
From: |
Per Abrahamsen |
Subject: |
Customizing key bindings (was: Re: [CVS] f7, f8 bound..) |
Date: |
Mon, 02 Sep 2002 18:40:03 +0200 |
User-agent: |
Gnus/5.090007 (Oort Gnus v0.07) Emacs/21.1 (sparc-sun-solaris2.8) |
Here is a version that handle [DEL].
To test, evaluate the code,
M-x customize-option <ret> global-key-bindings <ret>
Activate the [INS] button.
Enter <f7> in the Key field and apropos in the Command field.
Activate the [Set for Current Session] button
Press <f7> to test.
Activate the [DEL] button.
Press <f7> to test.
Obviously the UI needs to be improved, but the basic mechanism (except
perhaps the use of use-global-map) should work. A similar mechanism
can be used for the mode specific maps, instead of fiddling with
use-global-map, we would just change the mode to use
custom-my-mode-map directly.
(defvar custom-global-keymap (let ((map (make-sparse-keymap)))
(set-keymap-parent map global-map)
map)
"Global keymap for use by customize.")
(defcustom global-key-bindings nil
"Global keybindings defined through customize."
:type '(repeat
(group (string :tag "Key") (function))
:set (lambda (sym val)
(set-default sym val)
(setq custom-global-keymap (make-sparse-keymap))
(set-keymap-parent custom-global-keymap global-map)
(mapc (lambda (bind)
(define-key custom-global-keymap (read-kbd-macro (car bind))
(cadr bind)))
val)
(use-global-map custom-global-keymap)
val))
- Re: Customizing key bindings, (continued)
- Re: Customizing key bindings, Richard Stallman, 2002/09/08
- Re: Customizing key bindings, Miles Bader, 2002/09/08
- Re: Customizing key bindings, Richard Stallman, 2002/09/09
- Re: [CVS] f7, f8 bound.., Richard Stallman, 2002/09/04
- Re: [CVS] f7, f8 bound.., Per Abrahamsen, 2002/09/05
- Re: [CVS] f7, f8 bound.., Richard Stallman, 2002/09/04
- Re: [CVS] f7, f8 bound.., Kai Großjohann, 2002/09/03
- Re: [CVS] f7, f8 bound.., Stefan Monnier, 2002/09/03
- Re: [CVS] f7, f8 bound.., Kai Großjohann, 2002/09/03
- Re: [CVS] f7, f8 bound.., Richard Stallman, 2002/09/02
- Customizing key bindings (was: Re: [CVS] f7, f8 bound..),
Per Abrahamsen <=
- Re: Customizing key bindings (was: Re: [CVS] f7, f8 bound..), Alex Schroeder, 2002/09/02
- Re: Customizing key bindings (was: Re: [CVS] f7, f8 bound..), Per Abrahamsen, 2002/09/03
- Re: Customizing key bindings (was: Re: [CVS] f7, f8 bound..), Alex Schroeder, 2002/09/03
- Re: Customizing key bindings (was: Re: [CVS] f7, f8 bound..), Alex Schroeder, 2002/09/03
- Re: Customizing key bindings (was: Re: [CVS] f7, f8 bound..), Alex Schroeder, 2002/09/03
- Re: Customizing key bindings (was: Re: [CVS] f7, f8 bound..), Per Abrahamsen, 2002/09/04
- Re: Customizing key bindings (was: Re: [CVS] f7, f8 bound..), Richard Stallman, 2002/09/04
- Re: Customizing key bindings (was: Re: [CVS] f7, f8 bound..), Per Abrahamsen, 2002/09/05
- Re: Customizing key bindings (was: Re: [CVS] f7, f8 bound..), Richard Stallman, 2002/09/06
- Re: Customizing key bindings (was: Re: [CVS] f7, f8 bound..), Per Abrahamsen, 2002/09/06