From xemacs-m  Fri Apr 11 11:30:28 1997
Received: from elc1.dina.kvl.dk (elc1.dina.kvl.dk [130.225.40.228])
	by xemacs.org (8.8.5/8.8.5) with SMTP id LAA10382
	for <xemacs-beta@xemacs.org>; Fri, 11 Apr 1997 11:30:27 -0500 (CDT)
Received: from zuse.dina.kvl.dk (zuse.dina.kvl.dk [130.225.40.245]) by elc1.dina.kvl.dk (8.6.12/8.6.4) with ESMTP id SAA10757; Fri, 11 Apr 1997 18:30:20 +0200
Received: (abraham@localhost) by zuse.dina.kvl.dk (8.6.12/8.6.4) id SAA02245; Fri, 11 Apr 1997 18:30:25 +0200
Sender: abraham@dina.kvl.dk
To: xemacs-beta@xemacs.org
Subject: Patch to let apropos recognize faces, widgets, and user options.
Organization: The Church of Emacs
X-Face: +kRV2]2q}lixHkE{U)mY#+6]{AH=yN~S9@IFiOa@X6?GM<U{B+4e{k79.Ya{~':DblFPCg$
 @60,BfLv2@SKZ19cMWK0/C'v;tM:|6B'R}U1rp6CL&kN({9<zF/V{:JCg27yC)9oZjeqcQawzKfiNL
 t9}`vjmK["dRQC/qGFQq"%u|Q`:6{"Rz}b(dnl_"3$Jtqimi>|8MBp/
From: Per Abrahamsen <abraham@dina.kvl.dk>
Date: 11 Apr 1997 18:30:25 +0200
Message-ID: <rjhghdy126.fsf@zuse.dina.kvl.dk>
Lines: 59
X-Mailer: Gnus v5.4.37/Emacs 19.34
Mime-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit


This patch makes apropos recognize faces, widgets, and user options.
Faces and user options are shown in customize buffers, and widgets in
a special widget browser.

You need custom 1.81 to use it.

Fri Apr 11 17:47:26 1997  Per Abrahamsen  <abraham@dina.kvl.dk>

	* apropos.el (apropos): Add support for faces, widgets, and user
	options.
	(apropos-print): Ditto.

--- apropos.el.orig	Fri Mar 28 03:28:50 1997
+++ apropos.el	Fri Apr 11 18:21:56 1997
@@ -210,6 +210,7 @@
 			       (lambda (symbol)
 				 (or (fboundp symbol)
 				     (boundp symbol)
+				     (find-face symbol)
 				     (symbol-plist symbol))))))
   (apropos-print
    (or do-all apropos-do-all)
@@ -240,7 +241,18 @@
 		    (if (setq doc (symbol-plist symbol))
 			(if (eq (/ (length doc) 2) 1)
 			    (format "1 property (%s)" (car doc))
-			  (concat (/ (length doc) 2) " properties")))))
+			  (concat (/ (length doc) 2) " properties")))
+		    (if (get symbol 'widget-type)
+			(if (setq doc (documentation-property
+				       symbol 'widget-documentation t))
+			    (substring doc 0
+				       (string-match "\n" doc))
+			  "(not documented)"))
+		    (if (find-face symbol)
+			(if (setq doc (face-doc-string symbol))
+			    (substring doc 0
+				       (string-match "\n" doc))
+			  "(not documented)"))))
 	 (setq p (cdr p)))))
    nil))
 
@@ -559,8 +571,13 @@
 				   "Macro"
 				 "Function"))
 			     do-keys)
-	  (apropos-print-doc 'describe-variable 2
-			     "Variable" do-keys)
+	  (if (get symbol 'custom-type)
+	      (apropos-print-doc 'customize-variable-other-window 2
+				 "User Option" do-keys)
+	    (apropos-print-doc 'describe-variable 2
+			       "Variable" do-keys))
+	  (apropos-print-doc 'customize-face-other-window 5 "Face" do-keys)
+	  (apropos-print-doc 'widget-browse-other-window 4 "Widget" do-keys)
 	  (apropos-print-doc 'apropos-describe-plist 3
 			     "Plist" nil)))))
   (prog1 apropos-accumulator

