all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Lennart Borgman <lennart.borgman.073@student.lu.se>
Cc: rms@gnu.org, emacs-devel@gnu.org
Subject: Re: Should autoloaded functions show LIB.el for its location?
Date: Sun, 18 Dec 2005 18:23:33 +0100	[thread overview]
Message-ID: <43A59B15.7000103@student.lu.se> (raw)
In-Reply-To: <871x0apji1.fsf-monnier+emacs@gnu.org>

[-- Attachment #1: Type: text/plain, Size: 1036 bytes --]

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?

[-- Attachment #2: help-fns.el.autolfix2 --]
[-- Type: text/plain, Size: 852 bytes --]

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"

[-- Attachment #3: Type: text/plain, Size: 142 bytes --]

_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-devel

  reply	other threads:[~2005-12-18 17:23 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-12-17 13:27 Should autoloaded functions show LIB.el for its location? Lennart Borgman
2005-12-17 13:28 ` Lennart Borgman
2005-12-18  0:00   ` Richard M. Stallman
2005-12-18  9:47     ` Lennart Borgman
2005-12-18 14:31       ` Stefan Monnier
2005-12-18 17:23         ` Lennart Borgman [this message]
2005-12-18 18:04           ` Stefan Monnier
2005-12-19  4:38         ` Richard M. Stallman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=43A59B15.7000103@student.lu.se \
    --to=lennart.borgman.073@student.lu.se \
    --cc=emacs-devel@gnu.org \
    --cc=rms@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.