From: pjb@informatimago.com (Pascal J. Bourguignon)
To: help-gnu-emacs@gnu.org
Subject: Re: complete list of keybindings
Date: Wed, 12 Aug 2009 04:12:02 +0200 [thread overview]
Message-ID: <87ocql3hn1.fsf@galatea.local> (raw)
In-Reply-To: mailman.4430.1250034465.2239.help-gnu-emacs@gnu.org
Lennart Borgman <lennart.borgman@gmail.com> writes:
> Does this really catch longer key bindings?
No, for prefixes, it just write the prefix handling function, or
print the keymap. (that's why there's no specific processing for the
various mode variants). You may improve it and send me a patch ;-)
> And chars above 127?
Read the source!
It says "to 127" right there!
Scanning the while unicode would be even slower. Well, we could skip
inserting lines form unbound keys, this is where the time is spent
actually.
>> (defmacro rloop (clauses &rest body)
>> (if (null clauses)
>> `(progn ,@body)
>> `(loop ,@(car clauses) do (rloop ,(cdr clauses) ,@body))))
>>
>> (defun all-bindings ()
>> (interactive)
>> (message "all-bindings: wait a few seconds please...")
>> (let ((data
>> (with-output-to-string
>> (let ((bindings '()))
>> (rloop ((for C in '("" "C-")) ; Control
>> (for M in '("" "M-")) ; Meta
>> (for A in '("" "A-")) ; Alt
>> (for S in '("" "S-")) ; Shift
>> (for H in '("" "H-")) ; Hyper
>> (for s in '("" "s-")) ; super
>> (for x from 32 to 127))
>> (let* ((k (format "%s%s%s%s%s%s%c" C M A S H s x))
>> (key (ignore-errors (read-kbd-macro k))))
>> (when key
>> (push
>> (list k
>> (format "%-12s %-12s %S\n" k key
>> (or
>> ;; (string-key-binding key)
>> ;; What is this string-key-binding?
>> (key-binding key))))
>> bindings))))
>> (dolist (item
>> (sort bindings
>> (lambda (a b)
>> (or (< (length (first a))
>> (length (first b)))
>> (and (= (length (first a))
>> (length (first b)))
>> (string< (first a)
>> (first b)))))))
>> (princ (second item)))))))
>> (switch-to-buffer (format "Keybindings in %s" (buffer-name)))
>> (erase-buffer)
>> (insert data)
>> (goto-char (point-min))
>> (values)))
--
__Pascal Bourguignon__
next prev parent reply other threads:[~2009-08-12 2:12 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <mailman.4425.1250031270.2239.help-gnu-emacs@gnu.org>
2009-08-11 23:17 ` complete list of keybindings Pascal J. Bourguignon
2009-08-11 23:47 ` Lennart Borgman
[not found] ` <mailman.4430.1250034465.2239.help-gnu-emacs@gnu.org>
2009-08-12 2:12 ` Pascal J. Bourguignon [this message]
2009-08-12 5:30 ` Teemu Likonen
2009-08-13 22:29 ` Brendan Miller
2009-08-11 22:54 Brendan Miller
2009-08-11 23:08 ` Lennart Borgman
2009-08-11 23:11 ` Drew Adams
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
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87ocql3hn1.fsf@galatea.local \
--to=pjb@informatimago.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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).