home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #26 / NN_1992_26.iso / spool / alt / lucidem / help / 665 < prev    next >
Encoding:
Text File  |  1992-11-09  |  1.3 KB  |  39 lines

  1. x-gateway: rodan.UU.NET from help-lucid-emacs to alt.lucid-emacs.help; Mon, 9 Nov 1992 13:50:51 EST
  2. Date: Mon, 9 Nov 1992 10:50:30 PST
  3. Message-ID: <9211091850.AA06511@thalidomide.lucid>
  4. X-Windows: Putting new limits on productivity.
  5. From: jwz@lucid.com (Jamie Zawinski)
  6. Sender: jwz%thalidomide@lucid.com
  7. Subject: Re: display global-map table
  8. References: <1992Nov09.155317.7939@bmerh85.bnr.ca>
  9.     <9211070325.AA04417@thurber.Mathcom.com>
  10. Newsgroups: alt.lucid-emacs.help
  11. Path: sparky!uunet!wendy-fate.uu.net!help-lucid-emacs
  12. Lines: 25
  13.  
  14. Here's a kludge I use occasionally.  You can get a prettier description of
  15. a keymap with
  16.  
  17. (insert (substitute-command-keys "\\{mail-mode-map}"))
  18.  
  19. (defun show-keymap (map &optional pkey)
  20.   (let ((print-escape-newlines t))
  21.     (map-keymap map
  22.         '(lambda (key binding)
  23.            (insert (format "\n  "))
  24.            (if pkey (insert (make-string (* 2 (length pkey)) 32)))
  25.            (if pkey
  26.                (mapcar '(lambda (x) (insert (format "%s " x))) pkey))
  27.            (insert (format "%s" key))
  28.            (indent-to 32)
  29.            (insert (prin1-to-string binding))
  30.            (if (keymapp binding)
  31.                (show-keymap binding (if pkey
  32.                         (append pkey (list key))
  33.                           (list key)))))
  34.         t))
  35.   (if (keymap-parent map)
  36.       (progn
  37.     (insert (format "\n--\nParent map: %s" (keymap-parent map)))
  38.     (show-keymap (keymap-parent map)))))
  39.