From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: locate-library, the NOSUFFIX arg and a [PATCH] Date: Wed, 27 Jan 2010 21:46:41 -0500 Message-ID: References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1264646818 4050 80.91.229.12 (28 Jan 2010 02:46:58 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 28 Jan 2010 02:46:58 +0000 (UTC) Cc: emacs-devel@gnu.org To: MON KEY Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Jan 28 03:46:56 2010 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1NaKPF-0005Na-NI for ged-emacs-devel@m.gmane.org; Thu, 28 Jan 2010 03:46:54 +0100 Original-Received: from localhost ([127.0.0.1]:44532 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NaKPF-0000TB-0v for ged-emacs-devel@m.gmane.org; Wed, 27 Jan 2010 21:46:53 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NaKPB-0000Si-E2 for emacs-devel@gnu.org; Wed, 27 Jan 2010 21:46:49 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NaKP4-0000Nv-S4 for emacs-devel@gnu.org; Wed, 27 Jan 2010 21:46:48 -0500 Original-Received: from [199.232.76.173] (port=56921 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NaKP4-0000Nq-OI for emacs-devel@gnu.org; Wed, 27 Jan 2010 21:46:42 -0500 Original-Received: from ironport2-out.teksavvy.com ([206.248.154.183]:61612 helo=ironport2-out.pppoe.ca) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NaKP4-0007B9-Ao for emacs-devel@gnu.org; Wed, 27 Jan 2010 21:46:42 -0500 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AvYEAMiIYEtFpaAe/2dsb2JhbACBNNcGhDkEilE X-IronPort-AV: E=Sophos;i="4.49,357,1262581200"; d="scan'208";a="54721179" Original-Received: from 69-165-160-30.dsl.teksavvy.com (HELO pastel.home) ([69.165.160.30]) by ironport2-out.pppoe.ca with ESMTP; 27 Jan 2010 21:46:41 -0500 Original-Received: by pastel.home (Postfix, from userid 20848) id 60AD588D6; Wed, 27 Jan 2010 21:46:41 -0500 (EST) In-Reply-To: (MON KEY's message of "Wed, 27 Jan 2010 20:09:31 -0500") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.91 (gnu/linux) X-detected-operating-system: by monty-python.gnu.org: Genre and OS details not recognized. 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:120537 Archived-At: >>> It would be really great to ask with: >>> (locate-library "libary" t '("/home/mon/fnd-lib") t) >> >>> and get: >>> => "/home/mon/fnd-lib/library.el.gz" >> >> I don't follow you. If you want that, then why do you specify a non-nil >> value for NOSUFFIX?? > Look closely. The fourth arg of the second example is using the proposed > SHOW-COMPRESSED. That was definitely too subtle for me: Emacs-CVS's locate-library already has a 4th argument, used for a completely different purpose. > Which says, "Show me the file name sans extension unless library name > is a compressed file in which case let me know by showing me > the extension. This said, I'm really lost as to why/when you'd want this kind of behavior. > How exactly should one specify a library name for the LIBRARY arg to > locate-library if this is not the same object(s) as a file name? The argument provided to locate-library is the library name, so the difference is pretty clear: "subr" is a library name and "/bar/subr.el" is a file name. >>> I asked to kill a library, >> No, you didn't. Check the docstring of locate-library: >> "Show the precise file name of Emacs library LIBRARY." >> I.e. it returns a file name, so you asked to "kill" a file name. > Hrmmm. Precisely what is, "the precise file name of an Emacs library"? You lost me here. >> I have no idea what kind of "specification" you'd expect other than the >> one you currently get from locate-library's docstring. > Agreed. Hence the conundrum. Even more lost. >> although I'm not 100% positive it's the case because I don't really >> know what it is you want (kill-new (locate-library "subr")) to do. > This was provided as an example where I found the expected > behavior surprising. Unless you explain what other behavior you expect, that doesn't help us. > A better example use-case for the proposed patch might be where one would > like to generate a list from which one could inform/extend/override > `emacs-lisp-file-regexp', `byte-compile-dest-file', `declare-function', > `check-declare-directory', `byte-compiler-base-file-name', etc. to > select/operate on a library per case based conditionals of the list elements. I have no idea how you suggested change would help do any of this. >> Depending on this question, we may be able to determine things like >> whether you'd like (your-locate-library "foo.el" t) to return "/bar/foo" >> or "/bar/foo.el". > Exactly. Now that was helpful. I'm just wasting my time here. Stefan