all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Jonathan Ganc <jonpublic2@gmail.com>
To: help-gnu-emacs@gnu.org
Subject: A macro for printing keymap bindings in a pretty fashion
Date: Mon, 05 Sep 2011 15:20:08 -0500	[thread overview]
Message-ID: <4E652EF8.6020707@gmail.com> (raw)

[-- 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 --]

             reply	other threads:[~2011-09-05 20:20 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-09-05 20:20 Jonathan Ganc [this message]
2011-09-05 20:26 ` A macro for printing keymap bindings in a pretty fashion 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4E652EF8.6020707@gmail.com \
    --to=jonpublic2@gmail.com \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.