From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Lennart Borgman Newsgroups: gmane.emacs.devel Subject: Re: Should autoloaded functions show LIB.el for its location? Date: Sun, 18 Dec 2005 18:23:33 +0100 Message-ID: <43A59B15.7000103@student.lu.se> References: <43A41242.9070709@student.lu.se> <43A4128B.9090203@student.lu.se> <43A53016.1030904@student.lu.se> <871x0apji1.fsf-monnier+emacs@gnu.org> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------050108030808010204030305" X-Trace: sea.gmane.org 1134926742 17898 80.91.229.2 (18 Dec 2005 17:25:42 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sun, 18 Dec 2005 17:25:42 +0000 (UTC) Cc: rms@gnu.org, emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Dec 18 18:25:27 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1Eo2GO-0004Nx-0f for ged-emacs-devel@m.gmane.org; Sun, 18 Dec 2005 18:24:00 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Eo2HB-00034V-PR for ged-emacs-devel@m.gmane.org; Sun, 18 Dec 2005 12:24:49 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Eo2H2-00034P-IT for emacs-devel@gnu.org; Sun, 18 Dec 2005 12:24:40 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Eo2H2-00034D-3v for emacs-devel@gnu.org; Sun, 18 Dec 2005 12:24:40 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Eo2H1-00034A-Tt for emacs-devel@gnu.org; Sun, 18 Dec 2005 12:24:40 -0500 Original-Received: from [81.228.8.83] (helo=pne-smtpout1-sn2.hy.skanova.net) by monty-python.gnu.org with esmtp (Exim 4.34) id 1Eo2Jo-0003vR-RB; Sun, 18 Dec 2005 12:27:33 -0500 Original-Received: from [192.168.123.121] (83.249.218.244) by pne-smtpout1-sn2.hy.skanova.net (7.2.069.1) id 43A2BA4D00073724; Sun, 18 Dec 2005 18:23:38 +0100 User-Agent: Mozilla Thunderbird 1.0.7 (Windows/20050923) X-Accept-Language: en-us, en Original-To: Stefan Monnier In-Reply-To: <871x0apji1.fsf-monnier+emacs@gnu.org> X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:48003 Archived-At: This is a multi-part message in MIME format. --------------050108030808010204030305 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Stefan Monnier wrote: >>>>I just noticed that for an autoloaded function like >>>> >>>> >>>apropos-variable' > the location is shown as "apropos", not >>>"apropos.el". Is that > intentional? >>> >>> >>>In describe-function of course. Sorry. >>> >>>Since the file's name is `apropos.el', it would be clearer (all else >>>being equal) to show `apropos.el'. >>> >>> >>> >>Does the attached small fix do the right thing? >> >> > >No, because the autoload entry may say "foo.el" or "foo.elc" instead of >"foo", in which case adding a ".el" doesn't make much sense. I think it's >better to leave it as it is: after all, maybe you only have a "foo" file and >no "foo.el" or "foo.elc" file. > >The only good alternative I can think of otherwise is to do a locate-library >to find the file that would be used if the function were to be loaded. > > I think it would be good to be consistent, because this is much less confusing for beginners. I tried locate-library as you suggested. Attached. Is this better? --------------050108030808010204030305 Content-Type: text/plain; name="help-fns.el.autolfix2" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="help-fns.el.autolfix2" Index: help-fns.el =================================================================== RCS file: /cvsroot/emacs/emacs/lisp/help-fns.el,v retrieving revision 1.82 diff -c -r1.82 help-fns.el *** help-fns.el 30 Nov 2005 15:52:49 -0000 1.82 --- help-fns.el 18 Dec 2005 17:17:56 -0000 *************** *** 323,328 **** --- 323,333 ---- "a Lisp macro") ((eq (car-safe def) 'autoload) (setq file-name (nth 1 def)) + (unless (file-name-extension file-name) + (let ((ext (file-name-extension + (locate-library file-name)))) + (when (equal ext "elc") (setq ext "el")) + (setq file-name (concat file-name "." ext)))) (format "%s autoloaded %s" (if (commandp def) "an interactive" "an") (if (eq (nth 4 def) 'keymap) "keymap" --------------050108030808010204030305 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Emacs-devel mailing list Emacs-devel@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-devel --------------050108030808010204030305--