all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Sébastien Vauban" <zthjwsqqafhv@spammotel.com>
To: help-gnu-emacs@gnu.org
Subject: Re: Find all commands bound to key prefix
Date: Fri, 04 Apr 2008 09:34:11 +0200	[thread overview]
Message-ID: <87ve2yaxak.fsf@mundaneum.com> (raw)
In-Reply-To: 87abkakwae.fsf@thalassa.informatimago.com

Hello,

To add on Pascal's answer, if you want to see the bindings
attached to the function keys, here's a solution found on
http://www-xray.ast.cam.ac.uk/~gmorris/dotemacs.html (slightly
modified):

--8<---------------cut here---------------start------------->8---
;; print the key bindings in a tabular form
    (defun my-keytable (arg)
      "Print the key bindings in a tabular form."
      (interactive "sEnter a modifier string:")
      (with-output-to-temp-buffer "*Key table*"
        (let* ((i 0)
               (keys (list "a" "b" "c" "d" "e" "f" "g" "h" "i" "j" "k" "l" "m" "n"
                           "o" "p" "q" "r" "s" "t" "u" "v" "w" "x" "y" "z"
                           "<return>" "<down>" "<up>" "<right>" "<left>"
                           "<home>" "<end>" "<f1>" "<f2>" "<f3>" "<f4>" "<f5>"
                           "<f6>" "<f7>" "<f8>" "<f9>" "<f10>" "<f11>" "<f12>"
                           "1" "2" "3" "4" "5" "6" "7" "8" "9" "0"
                           "`" "~" "!" "@" "#" "$" "%" "^" "&" "*" "(" ")" "-" "_"
                           "=" "+" "\\" "|" "{" "[" "]" "}" ";" "'" ":" "\""
                           "<" ">" "," "." "/" "?"))
               (n (length keys))
               (modifiers (list "" "S-" "C-" "M-" "M-C-"))
               (k))
          (or (string= arg "") (setq modifiers (list arg)))
          (setq k (length modifiers))
          (princ (format " %-10.10s |" "Key"))
          (let ((j 0))
            (while (< j k)
              (princ (format " %-28.28s |" (nth j modifiers)))
              (setq j (1+ j))))
          (princ "\n")
          (princ (format "_%-10.10s_|" "__________"))
          (let ((j 0))
            (while (< j k)
              (princ (format "_%-28.28s_|"
                             "_______________________________"))
              (setq j (1+ j))))
          (princ "\n")
          (while (< i n)
            (princ (format " %-10.10s |" (nth i keys)))
            (let ((j 0))
              (while (< j k)
                (let* ((binding
                        (key-binding (read-kbd-macro (concat (nth j modifiers)
                                                             (nth i keys)))))
                       (binding-string "_"))
                  (when binding
                    (if (eq binding 'self-insert-command)
                        (setq binding-string (concat "'" (nth i keys) "'"))
                      (setq binding-string (format "%s" binding))))
                  (setq binding-string
                        (substring binding-string 0 (min (length
                                                          binding-string) 28)))
                  (princ (format " %-28.28s |" binding-string))
                  (setq j (1+ j)))))
            (princ "\n")
            (setq i (1+ i)))
          (princ (format "_%-10.10s_|" "__________"))
          (let ((j 0))
            (while (< j k)
              (princ (format "_%-28.28s_|"
                             "_______________________________"))
              (setq j (1+ j))))))
      (delete-window)
      (hscroll-mode)
      (setq truncate-lines t))
--8<---------------cut here---------------end--------------->8---

Seb

-- 
Sébastien Vauban


  reply	other threads:[~2008-04-04  7:34 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <mailman.9964.1207277776.18990.help-gnu-emacs@gnu.org>
2008-04-04  3:26 ` Find all commands bound to key prefix rustom
2008-04-04  4:28   ` Drew Adams
     [not found]   ` <mailman.9967.1207283328.18990.help-gnu-emacs@gnu.org>
2008-04-04  5:45     ` Pascal Bourguignon
2008-04-04  7:34       ` Sébastien Vauban [this message]
2008-04-04  6:41   ` Jens Teich
2008-04-03 19:37 Seung Jun
2008-04-04  9:55 ` Peter Dyballa
2008-04-04 13:05   ` Tassilo Horn
2008-04-04 15:19     ` Peter Dyballa
2008-04-04 17:26       ` Tassilo Horn
2008-04-04 18:27         ` Peter Dyballa
     [not found]         ` <mailman.9997.1207333651.18990.help-gnu-emacs@gnu.org>
2008-04-07  2:20           ` Alan
2008-04-07  4:42             ` Drew Adams
     [not found]     ` <mailman.9987.1207322388.18990.help-gnu-emacs@gnu.org>
2008-04-04 16:52       ` rustom
2008-04-04 18:22         ` Drew Adams
     [not found]         ` <mailman.9996.1207333434.18990.help-gnu-emacs@gnu.org>
2008-05-04  1:16           ` David Combs
2008-05-04  1:53             ` 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=87ve2yaxak.fsf@mundaneum.com \
    --to=zthjwsqqafhv@spammotel.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.