From xemacs-m  Sun Sep 28 20:50:24 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 UAA10242
	for <xemacs-beta@xemacs.org>; Sun, 28 Sep 1997 20:50:17 -0500 (CDT)
Received: from boron.kurims.kyoto-u.ac.jp (boron.kurims.kyoto-u.ac.jp [130.54.16.65]) by kurims.kurims.kyoto-u.ac.jp (8.8.5/3.4W2) with SMTP id KAA29613 for <xemacs-beta@xemacs.org>; Mon, 29 Sep 1997 10:49:56 +0900 (JST)
Received: (from petersen@localhost) by boron.kurims.kyoto-u.ac.jp (SMI-8.6/3.5Wbeta) id KAA04612; Mon, 29 Sep 1997 10:49:58 +0900
To: xemacs-beta@xemacs.org
Subject: Re: [patch] help: "loads from" and "loaded from"
References: <lbafh0nsx7.fsf@boron.kurims.kyoto-u.ac.jp> <kig4t78jgb1.fsf@jagor.srce.hr> <m2bu1fewm5.fsf@altair.xemacs.org>
X-Face: fOOYdM>Ct-+jZ!MfKWRl?5e=(j4]xHE~<%D)$=FuN"@nP]"fi8stnK9>1fW>1HR[fj\=i%q0'l2G]0[H'R*m(fm^Og;iG>lBmr{anp!LG[)PD}g^XbG.(@oIi8;y)8+C"HV5}8NQ`HR7~P{+$AEEPo,N>,IwIbd:Dq6\"Bi#Aq\^lJ~dmwnUkc-Xb{k3\dZnF7j,$enH=Ybr<9v,Kzi-T|urefU:c{$pC)T5yvnRO0T+D&Z9{B8ulAd5X#c?Z|}vv^qhBjEj
X-Emacs: 20.3 "Sarajevo" XEmacs  Lucid (beta23) with mule
Mime-Version: 1.0 (generated by SEMI MIME-Edit 0.86 "Naka-Tsurugi")
Content-Type: multipart/mixed;
 boundary="Multipart_Mon_Sep_29_10:49:57_1997-1"
Content-Transfer-Encoding: 7bit
From: Jens-Ulrik Holger Petersen <petersen@kurims.kyoto-u.ac.jp>
Date: 29 Sep 1997 10:49:58 +0900
In-Reply-To: SL Baur's message of "26 Sep 1997 11:52:18 -0700"
Message-ID: <lbyb4gj3cp.fsf_-_@boron.kurims.kyoto-u.ac.jp>
Lines: 119
X-Mailer: Gnus v5.5/XEmacs 20.3(beta23) - "Sarajevo"

--Multipart_Mon_Sep_29_10:49:57_1997-1
Content-Type: text/plain; charset=US-ASCII

>>>>> "sb" == SL Baur <steve@xemacs.org> writes:

    sb> Hrvoje Niksic <hniksic@srce.hr> writes:
    >> Jens-Ulrik Holger Petersen <petersen@kurims.kyoto-u.ac.jp> writes:
    >>> -    (if file-name
    >>> -	(princ (format "  -- loads from \"%s\"\n" file-name) stream))
    >>> -    (if home
    >>> -	(princ (format "  -- loaded from \"%s\"\n" home)) stream)
    >>> +    (if (or home file-name)
    >>> +	(princ (format "  -- defined in \"%s\"\n" (or home file-name)) stream))

    >> I don't like this change.  There was a distinction between "loads
    >> from" and "loaded from", which is now gone.  For instance:

    sb> ;; I agree with Hrvoje.

That is ok.  I was actually expecting that patch to be rejected! ;-)
However I still think that a change is needed, since the (difference
in) meaning of the 2 lines is not clear enough.

As it stands we get:

        autoload or load-history  =>  "loads from ...."

and
	compiled-function-annot   =>  "loaded from ...."
	
So really it doesn't make good sense.  Since something that is in the
load-history has already been loaded.  I would prefer:

	autoload		  =>  "autoloads from ...."

and
	load-history	    }
			    }     =>  "loaded from ...."
	compiled-func-annot }

which seems more logical to me.
	     
How about the following patch, which implements this and I hope is
more acceptable.


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

	* help.el (describe-function-1): If the function is not yet
	loaded, print the autoload file-name.  If function is loaded,
	print the library name in `load-history' or from
	`compiled-function-annotation'.


--Multipart_Mon_Sep_29_10:49:57_1997-1
Content-Type: application/octet-stream; type=emacs-lisp
Content-Disposition: attachment; filename="patch-help.el"
Content-Transfer-Encoding: 7bit

--- lisp/prim/help.el.orig	Mon Sep 29 10:38:58 1997
+++ lisp/prim/help.el		Mon Sep 29 10:38:58 1997
@@ -858,12 +887,11 @@
 (defun describe-function-1 (function stream &optional nodoc)
   (princ (format "`%S' is " function) stream)
   (let* ((def function)
-	 file-name
          (doc (condition-case nil
 		  (or (documentation function)
 		      (gettext "not documented"))
 		(void-function "")))
-	 aliases home kbd-macro-p fndef macrop)
+	 aliases file-name autoload-file kbd-macro-p fndef macrop)
     (while (and (symbolp def) (fboundp def))
       (when (not (eq def function))
 	(setq aliases
@@ -876,7 +904,7 @@
 		(format "an alias for `%s', " (symbol-name def)))))
       (setq def (symbol-function def)))
     (if (compiled-function-p def)
-	(setq home (compiled-function-annotation def)))
+	(setq file-name (compiled-function-annotation def)))
     (if (eq 'macro (car-safe def))
 	(setq fndef (cdr def)
 	      macrop t)
@@ -909,19 +937,19 @@
             ((eq (car-safe fndef) 'mocklisp)
              (funcall int "mocklisp" nil macrop))
             ((eq (car-safe def) 'autoload)
-	     (setq file-name (elt def 1))
+	     (setq autoload-file (elt def 1))
 	     (funcall int "autoloaded Lisp" t (elt def 4)))
 	    ((and (symbolp def) (not (fboundp def)))
 	     (princ "a symbol with a void (unbound) function definition." stream))
             (t
              nil)))
     (princ "\n")
+    (if autoload-file
+	(princ (format "  -- autoloads from \"%s\"\n" autoload-file) stream))
     (or file-name
 	(setq file-name (describe-function-find-file function)))
     (if file-name
-	(princ (format "  -- loads from \"%s\"\n" file-name) stream))
-    (if home
-	(princ (format "  -- loaded from \"%s\"\n" home)) stream)
+	(princ (format "  -- loaded from \"%s\"\n" file-name)) stream)
 ;;     (terpri stream)
     (if describe-function-show-arglist
         (let ((arglist

--Multipart_Mon_Sep_29_10:49:57_1997-1
Content-Type: text/plain; charset=US-ASCII


-- 
Jens
---
You can only live once, but if you do it right, once is enough.

--Multipart_Mon_Sep_29_10:49:57_1997-1--

