home *** CD-ROM | disk | FTP | other *** search
- x-gateway: rodan.UU.NET from help-lucid-emacs to alt.lucid-emacs.help; Mon, 9 Nov 1992 13:50:51 EST
- Date: Mon, 9 Nov 1992 10:50:30 PST
- Message-ID: <9211091850.AA06511@thalidomide.lucid>
- X-Windows: Putting new limits on productivity.
- From: jwz@lucid.com (Jamie Zawinski)
- Sender: jwz%thalidomide@lucid.com
- Subject: Re: display global-map table
- References: <1992Nov09.155317.7939@bmerh85.bnr.ca>
- <9211070325.AA04417@thurber.Mathcom.com>
- Newsgroups: alt.lucid-emacs.help
- Path: sparky!uunet!wendy-fate.uu.net!help-lucid-emacs
- Lines: 25
-
- Here's a kludge I use occasionally. You can get a prettier description of
- a keymap with
-
- (insert (substitute-command-keys "\\{mail-mode-map}"))
-
- (defun show-keymap (map &optional pkey)
- (let ((print-escape-newlines t))
- (map-keymap map
- '(lambda (key binding)
- (insert (format "\n "))
- (if pkey (insert (make-string (* 2 (length pkey)) 32)))
- (if pkey
- (mapcar '(lambda (x) (insert (format "%s " x))) pkey))
- (insert (format "%s" key))
- (indent-to 32)
- (insert (prin1-to-string binding))
- (if (keymapp binding)
- (show-keymap binding (if pkey
- (append pkey (list key))
- (list key)))))
- t))
- (if (keymap-parent map)
- (progn
- (insert (format "\n--\nParent map: %s" (keymap-parent map)))
- (show-keymap (keymap-parent map)))))
-