changeset: 4333:4ba890988caa681f3dfc4cf8fbe23b25df9ec8dc
tag: tip
user: Aidan Kehoe <kehoea(a)parhasard.net>
date: Tue Dec 18 21:28:12 2007 +0100
files: lisp/ChangeLog lisp/help.el
description:
Within #'describe-function, say what commands are bound to.
2007-12-18 Aidan Kehoe <kehoea(a)parhasard.net>
* help.el (describe-function-1):
Give details of bindings for commands, taking into account
global-window-system-map and global-tty-map when bindings differ
compared to the global map.
diff -r 234b2c136e4dcaccf2ac88a827c3bc6b82d314c1 -r
4ba890988caa681f3dfc4cf8fbe23b25df9ec8dc lisp/ChangeLog
--- a/lisp/ChangeLog Tue Dec 18 19:44:28 2007 +0100
+++ b/lisp/ChangeLog Tue Dec 18 21:28:12 2007 +0100
@@ -1,3 +1,10 @@ 2007-12-17 Aidan Kehoe <kehoea@parhasa
+2007-12-18 Aidan Kehoe <kehoea(a)parhasard.net>
+
+ * help.el (describe-function-1):
+ Give details of bindings for commands, taking into account
+ global-window-system-map and global-tty-map when bindings differ
+ compared to the global map.
+
2007-12-17 Aidan Kehoe <kehoea(a)parhasard.net>
* subr.el (integer-to-bit-vector): New.
diff -r 234b2c136e4dcaccf2ac88a827c3bc6b82d314c1 -r
4ba890988caa681f3dfc4cf8fbe23b25df9ec8dc lisp/help.el
--- a/lisp/help.el Tue Dec 18 19:44:28 2007 +0100
+++ b/lisp/help.el Tue Dec 18 21:28:12 2007 +0100
@@ -1484,7 +1484,53 @@ part of the documentation of internal su
(goto-char newp standard-output))
(unless (or (equal doc "")
(eq ?\n (aref doc (1- (length doc)))))
- (terpri)))))))))
+ (terpri)))
+ (when (commandp function)
+ (princ "\nInvoked with:\n")
+ (let ((global-binding
+ (where-is-internal function global-map))
+ (global-tty-binding
+ (where-is-internal function global-tty-map))
+ (global-window-system-binding
+ (where-is-internal function global-window-system-map)))
+ (if (or global-binding global-tty-binding
+ global-window-system-binding)
+ (if (and (equal global-binding
+ global-tty-binding)
+ (equal global-binding
+ global-window-system-binding))
+ (princ
+ (substitute-command-keys
+ (format "\n\\[%s]" function)))
+ (when (and global-window-system-binding
+ (not (equal global-window-system-binding
+ global-binding)))
+ (princ
+ (format
+ "\n%s\n -- under window systems\n"
+ (mapconcat #'key-description
+ global-window-system-binding
+ ", "))))
+ (when (and global-tty-binding
+ (not (equal global-tty-binding
+ global-binding)))
+ (princ
+ (format
+ "\n%s\n -- under TTYs\n"
+ (mapconcat #'key-description
+ global-tty-binding
+ ", "))))
+ (when global-binding
+ (princ
+ (format
+ "\n%s\n -- generally (that is, unless\
+ overridden by TTY- or
+ window-system-specific mappings)\n"
+ (mapconcat #'key-description
+ global-binding
+ ", ")))))
+ (princ (substitute-command-keys
+ (format "\n\\[%s]" function))))))))))))
;;; [Obnoxious, whining people who complain very LOUDLY on Usenet
;;; are binding this to keys.]
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://calypso.tux.org/cgi-bin/mailman/listinfo/xemacs-patches