XEmacsNull Blog

Bi-Day XEmacs Tip Blog

Monday, November 28, 2005

Topic: Creating Key Bindings

Question: How do I assign my own key bindings? ie. Hit hotkey combination and get XEmacs to type, something personalized. . . .

= This is a rather deeper subject. So, I will have to introduce a few things. First, what is the XEmacs way? Answer: Using letters of the alphabet with the Ctrl-x key binding, is the recommended practice for assigning custom key bindings.

= How do I check, if a key binding is already in use?

Lookup Key Binding: Alt-?, Ctrl-k, key-binding.
Example to check: Ctrl-x, u. List: Alt-?, Ctrl-k, Ctrl-x, u.

Results: When it shows, "Look up key in XEmacs manual (still)". Then, it hasn't been allocated (by the major or minor modes, you are using).

= (A) Otherwise, if you see, a function name? Then, it is taken.

= (B) If you get stuck in a enter sequence, Don't forget Ctrl-g, in most instances. Othewise, if it is about buffer confusion. Use Ctrl-x, 1, (then) Ctrl-x, k, enter.

= If you try; Ctrl-x, Ctrl-c to test: You will see: Found save-buffers-kill-emacs. All the letters from a to z are available for Ctrl-c, ??? combinations. Also, capital A to Z are unique from the lower letters, as well. If you care to confuse yourself some more? (Full Correction)

Platform: Linux
Level: Amateur
GlR

PS. Yes, there are conflicts with Ctrl-x, and various letters. Just as "u" for Undo is one such letter. Ctrl-x keys typically are file-related, Ctrl-c being mode-specific bindings, and Ctrl-h for help.

• Key binding is a rather large subject. What can go wrong? (1) If you want to set it globally. (2) Or just override, when loading specifically. (3) Or what to run it with your own LISP functions. (4) Or dealing with mode-compatibility. ie. Not stepping on your file's mode toes. (5) Or assigning recorded macros. (6) Or just creating plain type shortcut keys, as the Windows people say.

= So, I'll apologize in advance. If I turn out to be not fully accurate. It is rather vacous and I'll assure you. I have spent three hours on key binding, so far, to reduce your time at, off the bat.

0 Comments:

Post a Comment

<< Home