all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: pjb@informatimago.com (Pascal J. Bourguignon)
To: help-gnu-emacs@gnu.org
Subject: Re: complete list of keybindings
Date: Wed, 12 Aug 2009 01:17:51 +0200	[thread overview]
Message-ID: <87ws5a2b4w.fsf@galatea.local> (raw)
In-Reply-To: mailman.4425.1250031270.2239.help-gnu-emacs@gnu.org

Brendan Miller <catphive@catphive.net> writes:

> Is there a complete list of keybindings somewhere, or a way to force
> emacs to give me a discription of every keybinding currently active?
>
> There's a lot of different partial lists online, but I want a complete list.

You will have to build the complete list yourself, because it is
different for each user.  You may change the key bindings at will.

And even, the following code is not entirely correct, since it doesn't
take into account the various modes, which may overload the same key
chords.


(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__


       reply	other threads:[~2009-08-11 23:17 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 ` Pascal J. Bourguignon [this message]
2009-08-11 23:47   ` complete list of keybindings Lennart Borgman
     [not found]   ` <mailman.4430.1250034465.2239.help-gnu-emacs@gnu.org>
2009-08-12  2:12     ` Pascal J. Bourguignon
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

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

  git send-email \
    --in-reply-to=87ws5a2b4w.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.
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.