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

* RE: A macro for printing keymap bindings in a pretty fashion
  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
  1 sibling, 0 replies; 6+ messages in thread
From: Drew Adams @ 2011-09-05 20:26 UTC (permalink / raw)
  To: 'Jonathan Ganc', help-gnu-emacs

> I wrote a macro "pkb" (for print key-bindings)...
> It outputs the keybindings as a (somewhat) pretty html document.

Please consider posting the output image (e.g., from an uncustomized Emacs
session) here:

http://www.emacswiki.org/emacs/CategoryReferenceSheet


You might also be interested in command `describe-keymap' (bound by default to
`C-h M-k') in library `help-fns+.el'.

http://www.emacswiki.org/emacs/download/help-fns%2b.el
http://www.emacswiki.org/emacs/HelpPlus




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

* Re: A macro for printing keymap bindings in a pretty fashion
  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
  1 sibling, 2 replies; 6+ messages in thread
From: Yuri Khan @ 2011-09-06  1:15 UTC (permalink / raw)
  To: Jonathan Ganc; +Cc: help-gnu-emacs

On Tue, Sep 6, 2011 at 03:20, Jonathan Ganc <jonpublic2@gmail.com> wrote:

> 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.

Your choice of up arrow for 'forward' and down arrow for 'backward' is
a bit counter-intuitive. Otherwise, nice idea.



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

* Re: A macro for printing keymap bindings in a pretty fashion
  2011-09-06  1:15 ` Yuri Khan
@ 2011-09-07  4:12   ` Jonathan Ganc
  2011-09-07  4:13   ` Jonathan Ganc
  1 sibling, 0 replies; 6+ messages in thread
From: Jonathan Ganc @ 2011-09-07  4:12 UTC (permalink / raw)
  To: Yuri Khan; +Cc: help-gnu-emacs

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


> Please consider posting the output image (e.g., from an uncustomized 
> Emacs
> session) here:
>
> http://www.emacswiki.org/emacs/CategoryReferenceSheet
>

I added the macro to emacswiki at 
http://www.emacswiki.org/emacs/PrintKeyBindings, including an image as 
you've described. I also added it to CategoryKeys.


> You might also be interested in command `describe-keymap' (bound by 
> default to
> `C-h M-k') in library `help-fns+.el'.
>
> http://www.emacswiki.org/emacs/download/help-fns%2b.el
> http://www.emacswiki.org/emacs/HelpPlus
>
>

Thanks. I will look at the package.



__________ Information from ESET Smart Security, version of virus signature database 6442 (20110906) __________

The message was checked by ESET Smart Security.

http://www.eset.com


[-- Attachment #2: Type: text/html, Size: 2046 bytes --]

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

* Re: A macro for printing keymap bindings in a pretty fashion
  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
  1 sibling, 1 reply; 6+ messages in thread
From: Jonathan Ganc @ 2011-09-07  4:13 UTC (permalink / raw)
  Cc: help-gnu-emacs

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

On 9/5/2011 8:15 PM, Yuri Khan wrote:

> Your choice of up arrow for 'forward' and down arrow for 'backward' is
> a bit counter-intuitive.
I agree that the choices for replacements are not necessarily ideal. 
However, that can be customized fairly straightforwardly using 
`pkb-html-binding-replace-regexp'.

> Otherwise, nice idea.

Thanks.



__________ Information from ESET Smart Security, version of virus signature database 6442 (20110906) __________

The message was checked by ESET Smart Security.

http://www.eset.com


[-- Attachment #2: Type: text/html, Size: 1246 bytes --]

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

* Re: A macro for printing keymap bindings in a pretty fashion
  2011-09-07  4:13   ` Jonathan Ganc
@ 2011-09-07  7:53     ` Le Wang
  0 siblings, 0 replies; 6+ messages in thread
From: Le Wang @ 2011-09-07  7:53 UTC (permalink / raw)
  To: Jonathan Ganc; +Cc: help-gnu-emacs

Hi Jonathan,

What you wrote would be called a "macro" in Word or Excel, but a macro
has a very specific meaning in lisp (see:
http://www.gnu.org/software/emacs/elisp/html_node/Macro-Forms.html).
In order to avoid confusion for future googlers, maybe you will
consider revising the wiki entries appropriately?

-- 
Le



^ 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.