From xemacs-m  Mon Jun 23 04:40:12 1997
Received: from jagor.srce.hr (hniksic@jagor.srce.hr [161.53.2.130])
	by xemacs.org (8.8.5/8.8.5) with ESMTP id EAA28123
	for <xemacs-beta@xemacs.org>; Mon, 23 Jun 1997 04:40:10 -0500 (CDT)
Received: (from hniksic@localhost)
          by jagor.srce.hr (8.8.5/8.8.4)
	  id LAA27334; Mon, 23 Jun 1997 11:40:08 +0200 (MET DST)
To: XEmacs Developers <xemacs-beta@xemacs.org>
Subject: [PATCH] teach-extended-commands-p change
X-Attribution: Hrv
X-Face: Mie8:rOV<\c/~z{s.X4A{!?vY7{drJ([U]0O=W/<W*SMo/Mv:58:*_y~ki>xDi&N7XG
        KV^$k0m3Oe/)'e%3=$PCR&3ITUXH,cK>]bci&<qQ>Ff%x_>1`T(+M2Gg/fgndU%k*ft
        [(7._6e0n-V%|%'[c|q:;}td$#INd+;?!-V=c8Pqf}3J
From: Hrvoje Niksic <hniksic@srce.hr>
Date: 23 Jun 1997 11:40:06 +0200
Message-ID: <kiglo41mzd5.fsf@jagor.srce.hr>
Lines: 79
X-Mailer: Gnus v5.4.59/XEmacs 20.3(beta8) - "Copenhagen"

Ever since reading the following entry in Emacs 20.1 NEWS, I wished we 
had it:

** The feature to suggest key bindings when you use M-x now operates
after the command finishes.  The message suggesting key bindings
appears temporarily in the echo area.  The previous echo area contents
come back after a few seconds, in case they contain useful information.


Here is the patch that implements the same change in XEmacs.  I must
say I like this feature a *lot*.  It makes command-teaching really
useful, for the first time.

1997-06-23  Hrvoje Niksic  <hniksic@srce.hr>

	* prim/cmdloop.el (execute-extended-command): Print message after
	the command finishes, and restore old echo-area contents.


--- lisp/prim/cmdloop.el.orig	Mon Jun 23 08:43:38 1997
+++ lisp/prim/cmdloop.el	Mon Jun 23 11:13:53 1997
@@ -279,20 +279,23 @@
                               (t
                                "M-x ")))))
 
-  (if (and teach-extended-commands-p (interactive-p))
-      (let ((keys (where-is-internal this-command)))
-	(if keys
-	    (progn
-	      (message "M-x %s (bound to key%s: %s)"
-		       this-command
-		       (if (cdr keys) "s" "")
-		       (mapconcat 'key-description
-				  (sort keys #'(lambda (x y)
-						 (< (length x) (length y))))
-				  ", "))
-	      (sit-for teach-extended-commands-timeout)))))
+  (command-execute this-command t)
 
-  (command-execute this-command t))
+  (and teach-extended-commands-p
+       (interactive-p)
+       (let ((keys (where-is-internal this-command)))
+	 (when keys
+	   (display-message
+	    'no-log
+	    (format "M-x %s (bound to key%s: %s)"
+		    this-command
+		    (if (cdr keys) "s" "")
+		    (mapconcat 'key-description
+			       (sort keys #'(lambda (x y)
+					      (< (length x) (length y))))
+			       ", ")))
+	   (sit-for teach-extended-commands-timeout)
+	   (clear-message 'no-log)))))
 
 
 ;;; C code calls this; the underscores in the variable names are to avoid
--- etc/NEWS.orig	Mon Jun 23 11:33:07 1997
+++ etc/NEWS	Mon Jun 23 11:34:23 1997
@@ -146,6 +146,11 @@
 current buffer and deletes the selected window.  It asks for
 confirmation first.
 
+** The feature to teach the key bindings of extended commands after
+the command finishes.  The message suggesting key bindings appears
+temporarily in the echo area.  The previous echo area contents come
+back after a few seconds, in case they contain useful information.
+
 ** XEmacs can now save the minibuffer histories from various
 minibuffers.  To use this feature, add the line:
 


-- 
Hrvoje Niksic <hniksic@srce.hr> | Student at FER Zagreb, Croatia
--------------------------------+--------------------------------
Thou Who might be our Father Who perhaps may be in Heaven...
                                                -- Roger Zelazny

