all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* A macro for printing keymap bindings in a pretty fashion
@ 2011-09-05 20:20 Jonathan Ganc
  2011-09-05 20:26 ` Drew Adams
  2011-09-06  1:15 ` Yuri Khan
  0 siblings, 2 replies; 6+ messages in thread
From: Jonathan Ganc @ 2011-09-05 20:20 UTC (permalink / raw)
  To: help-gnu-emacs

[-- Attachment #1: Type: text/plain, Size: 2315 bytes --]

I've been using emacs for a while now and I've found that some of the 
default keybindings are somewhat/very annoying. However, I found it was 
difficult to bind keys as I wanted to without being able to see the 
bindings in a table like a keyboard, whereas the only option I found for 
listing bindings was `describe-bindings', which just vomits up a list of 
all bindings.

So I wrote a macro "pkb" (for print key-bindings), which I've attached. 
It outputs the keybindings as a (somewhat) pretty html document. The 
simplified instructions: after loading the two .el files, run 
(pkb-html-save-keymap KEYMAP OUTPUT-FILE-NAME), where KEYMAP is the 
KEYMAP you want printed and OUTPUT-FILE-NAME is where the output will 
stored; e.g. (pkb-html-save-keymap (current-global-map) "~/test.html"). 
`pkb-html-save-keymap' has many other options that are described in the 
help function. I have placed an example of the output at 
http://www.ph.utexas.edu/~jonganc/emacs/example.html; note that the 
example is direct output from the macro.

If the attachment doesn't work, you can also use download the program 
from http://www.ph.utexas.edu/~jonganc/emacs.html.

I would be very interested in any comments people have (although I don't 
know that I'll have time to make any updates anytime soon, since I'm 
busy and the program currently does what I need).

Some notes about the program:
-- The output is not currently terribly pretty. This should be very easy 
to change; I haven't spent too much time on that since it otherwise does 
what I want. Also, if you are using an older browser that doesn't 
support CSS 3 (e.g. IE 6 or 7), the output will be particularly 
unattractive.
-- The current default settings are aimed at me and my keyboard. 
However, by customizing the various default variables (e.g. 
`pkb-include-base-key-list', `pkb-html-event-replace-bk', 
`pkb-key-groups', etc.) it should be fairly straightforward to adapt the 
code for different keyboards. In fact, it would probably be possible to 
set these settings by detecting some system variables if someone were 
interested in implementing that.

--
Jonathan



__________ Information from ESET Smart Security, version of virus signature database 6439 (20110905) __________

The message was checked by ESET Smart Security.

http://www.eset.com


[-- Attachment #2: pkb-0.2.zip --]
[-- Type: application/octet-stream, Size: 30598 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2011-09-07  7:53 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-09-05 20:20 A macro for printing keymap bindings in a pretty fashion Jonathan Ganc
2011-09-05 20:26 ` Drew Adams
2011-09-06  1:15 ` Yuri Khan
2011-09-07  4:12   ` Jonathan Ganc
2011-09-07  4:13   ` Jonathan Ganc
2011-09-07  7:53     ` Le Wang

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.