From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: =?iso-8859-1?Q?S=E9bastien_Vauban?= Newsgroups: gmane.emacs.help Subject: Re: Find all commands bound to key prefix Date: Fri, 04 Apr 2008 09:34:11 +0200 Organization: Sebastien Vauban Message-ID: <87ve2yaxak.fsf@mundaneum.com> References: <87abkakwae.fsf@thalassa.informatimago.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1207298446 29115 80.91.229.12 (4 Apr 2008 08:40:46 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 4 Apr 2008 08:40:46 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Apr 04 10:41:18 2008 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1JhhTz-0004IS-54 for geh-help-gnu-emacs@m.gmane.org; Fri, 04 Apr 2008 10:41:11 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JhhTM-0006mU-7O for geh-help-gnu-emacs@m.gmane.org; Fri, 04 Apr 2008 04:40:32 -0400 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!news.tele.dk!news.tele.dk!small.news.tele.dk!proxad.net!feeder1-2.proxad.net!nerim.net!feed1.news.be.easynet.net!reader0.news.be.easynet.net!not-for-mail Original-Newsgroups: gnu.emacs.help X-Www-site: Under construction... User-Agent: Gnus/5.110007 (No Gnus v0.7) Emacs/23.0.60 (gnu/linux) Cancel-Lock: sha1:E1B/pxpopuMOuDpj3od95VIUXiQ= Original-Lines: 83 Original-NNTP-Posting-Date: 04 Apr 2008 07:33:45 GMT Original-NNTP-Posting-Host: 81.188.7.152 Original-X-Trace: 1207294425 reader0.news.be.easynet.net 1585 [::ffff:81.188.7.152]:41568 Original-X-Complaints-To: abuse@be.easynet.net Original-Xref: shelby.stanford.edu gnu.emacs.help:157667 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:53037 Archived-At: 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" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "1" "2" "3" "4" "5" "6" "7" "8" "9" "0" "`" "~" "!" "@" "#" "$" "%" "^" "&" "*" "(" ")" = "-" "_" "=3D" "+" "\\" "|" "{" "[" "]" "}" ";" "'" ":" "= \"" "<" ">" "," "." "/" "?")) (n (length keys)) (modifiers (list "" "S-" "C-" "M-" "M-C-")) (k)) (or (string=3D 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 modifie= rs) (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) 2= 8))) (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 --=20 S=E9bastien=A0Vauban