From xemacs-m  Fri Aug 29 06:25:43 1997
Received: from kurims.kurims.kyoto-u.ac.jp (kurims.kurims.kyoto-u.ac.jp [130.54.16.1])
	by xemacs.org (8.8.5/8.8.5) with ESMTP id GAA25222
	for <xemacs-beta@xemacs.org>; Fri, 29 Aug 1997 06:25:39 -0500 (CDT)
Received: from orion.kurims.kyoto-u.ac.jp (orion.kurims.kyoto-u.ac.jp [130.54.16.5]) by kurims.kurims.kyoto-u.ac.jp (8.8.5/3.4W2) with SMTP id UAA18368; Fri, 29 Aug 1997 20:25:36 +0900 (JST)
Received: (from petersen@localhost) by orion.kurims.kyoto-u.ac.jp (SMI-8.6/3.5Wbeta) id UAA24514; Fri, 29 Aug 1997 20:25:36 +0900
To: David Bakhash <cadet@MIT.EDU>
Cc: XEmacs Beta List <xemacs-beta@xemacs.org>
Subject: Re: find-function.el and hyper-apropos
References: <199708030606.CAA27669@rattlesnake> 	<lb67sryt7p.fsf@orion.kurims.kyoto-u.ac.jp> <199708281357.JAA05251@department-of-alchemy.MIT.EDU>
X-Emacs: 20.3 "Bratislava" XEmacs  Lucid (beta18) with mule
Mime-Version: 1.0 (generated by SEMI MIME-Edit 0.86 "Naka-Tsurugi")
Content-Type: text/plain; charset=US-ASCII
From: Jens-Ulrik Holger Petersen <petersen@kurims.kyoto-u.ac.jp>
Date: 29 Aug 1997 20:25:35 +0900
In-Reply-To: David Bakhash's message of "Thu, 28 Aug 1997 09:57:14 -0400 (EDT)"
Message-ID: <lb3entkz80.fsf@orion.kurims.kyoto-u.ac.jp>
Lines: 116
X-Mailer: Gnus v5.4.65 + SEMI patch (r2.1)/XEmacs 20.3(beta18) - "Bratislava"

>>>>> "David" == David Bakhash <cadet@MIT.EDU> writes:

    David> Jens-Ulrik Holger Petersen writes:
    David> now that we have find-function, can this be a (menu) option in
    David> hyper-apropos?  sorry if someone's already made this
    David> suggestion.  it seems logical.

    >> Sorry I don't understand what you mean exactly.

    David> well, here's what I mean.  In XEmacs 20.* (and AFAIK 19.1* where * >13)
    David> if you do:

    David> C-h a  regexp

    David> (when running with X-window support) then you'll find that
    David> button-3 gives you a little menu.  It's got options like

    David> 1) display documentation
    David> 2) set variable
    David> 3) show keys for
    David> 4) disassemble function

    David> etc.  One of them should be `find-function'.  Give it a
    David> shot.  Look at it.  Hyper-apropos rules.

How about the patch below?  Does it satisfy your needs?

Jens


1997-08-29  Jens-Ulrik Holger Petersen  <petersen@kurims.kyoto-u.ac.jp>

	* packages/hyper-apropos.el (hyper-apropos-help-map): add
	keybinding to `hyper-apropos-find-function'.
	(hyper-apropos-map): removed unnecessary double binding to
	`hyper-apropos-set-variable'.
	(hyper-apropos-find-function): new function.
	(hyper-apropos-popup-menu): if in the help mode, look for symbol
	at top of the buffer if necessary.  Added menu entry for
	`hyper-apropos-find-function'.


diff -u /home/petersen/src/xemacs/solaris/lisp/packages/hyper-apropos.el.orig /home/petersen/src/xemacs/solaris/lisp/packages/hyper-apropos.el
--- /home/petersen/src/xemacs/solaris/lisp/packages/hyper-apropos.el.orig	Fri Aug 29 20:12:55 1997
+++ /home/petersen/src/xemacs/solaris/lisp/packages/hyper-apropos.el	Fri Aug 29 20:12:55 1997
@@ -167,6 +167,7 @@
     (define-key map "t"     'hyper-apropos-find-tag)
     (define-key map "l"     'hyper-apropos-last-help)
     (define-key map "c"     'hyper-apropos-customize-variable)
+    (define-key map "f"     'hyper-apropos-find-function)
     (define-key map [button2] 'hyper-apropos-mouse-get-doc)
     (define-key map [button3] 'hyper-apropos-popup-menu)
     ;; for the totally hardcore...
@@ -192,7 +193,8 @@
     ;; act on the current line...
     (define-key map "w"     'hyper-apropos-where-is)
     (define-key map "i"     'hyper-apropos-invoke-fn)
-    (define-key map "s"     'hyper-apropos-set-variable)
+;; this is already defined in the parent-keymap above, isn't it?
+;;     (define-key map "s"     'hyper-apropos-set-variable)
     ;; more administrativa...
     (define-key map "P"     'hyper-apropos-toggle-programming-flag)
     (define-key map "k"     'hyper-apropos-add-keyword)
@@ -1203,6 +1205,24 @@
 
 ;; ---------------------------------------------------------------------- ;;
 
+(defun hyper-apropos-find-function (fn)
+  "Find the function for the symbol on the current line in other
+window.  (See also `find-function'.)"
+  (interactive
+   (let ((fn (hyper-apropos-this-symbol)))
+     (or (fboundp fn)
+	 (and (setq fn (and (eq major-mode 'hyper-apropos-help-mode)
+			    (save-excursion
+			      (goto-char (point-min))
+			      (hyper-apropos-this-symbol))))
+	      (fboundp fn))
+	 (setq fn nil))
+     (list fn)))
+  (if fn
+      (find-function-other-window fn)))
+
+;; ---------------------------------------------------------------------- ;;
+
 (defun hyper-apropos-disassemble (sym)
   "Disassemble FUN if it is byte-coded.  If it's a lambda, prettyprint it."
   (interactive (list (hyper-apropos-this-symbol)))
@@ -1251,7 +1271,11 @@
 (defun hyper-apropos-popup-menu (event)
   (interactive "e")
   (mouse-set-point event)
-  (let* ((sym (hyper-apropos-this-symbol))
+  (let* ((sym (or (hyper-apropos-this-symbol)
+		  (and (eq major-mode 'hyper-apropos-help-mode)
+		       (save-excursion
+			 (goto-char (point-min))
+			 (hyper-apropos-this-symbol)))))
 	 (notjunk (not (null sym)))
 	 (command-p (if (commandp sym) t))
 	 (variable-p (and sym (boundp sym)))
@@ -1268,11 +1292,12 @@
 	   nil
 	   (list (concat "Hyper-Help: " name)
 	    (vector "Display documentation" 'hyper-apropos-get-doc   notjunk)
-	    (vector "Set variable"	'hyper-apropos-set-variable	variable-p)
+	    (vector "Set variable"	'hyper-apropos-set-variable variable-p)
 	    (vector "Customize variable" 'hyper-apropos-customize-variable
 		    customizable-p)
 	    (vector "Show keys for"     'hyper-apropos-where-is      command-p)
-	    (vector "Invoke command"	'hyper-apropos-invoke-fn	command-p)
+	    (vector "Invoke command"	'hyper-apropos-invoke-fn     command-p)
+	    (vector "Find function"    'hyper-apropos-find-function function-p)
 	    (vector "Find tag"		'hyper-apropos-find-tag	notjunk)
 	    (and apropos-p
 		 ["Add keyword..." hyper-apropos-add-keyword	t])

