From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: MON KEY Newsgroups: gmane.emacs.devel Subject: Re: Proposal: directory-slash in library names Date: Sat, 9 Jan 2010 20:37:32 -0500 Message-ID: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Trace: ger.gmane.org 1263087478 24683 80.91.229.12 (10 Jan 2010 01:37:58 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 10 Jan 2010 01:37:58 +0000 (UTC) Cc: rms@gnu.org To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Jan 10 02:37:51 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.50) id 1NTmkZ-0003iY-2e for ged-emacs-devel@m.gmane.org; Sun, 10 Jan 2010 02:37:51 +0100 Original-Received: from localhost ([127.0.0.1]:42645 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NTmkZ-0008HE-HQ for ged-emacs-devel@m.gmane.org; Sat, 09 Jan 2010 20:37:51 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NTmkU-0008Gt-5a for emacs-devel@gnu.org; Sat, 09 Jan 2010 20:37:46 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NTmkO-0008F3-Jd for emacs-devel@gnu.org; Sat, 09 Jan 2010 20:37:44 -0500 Original-Received: from [199.232.76.173] (port=37584 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NTmkO-0008F0-DN for emacs-devel@gnu.org; Sat, 09 Jan 2010 20:37:40 -0500 Original-Received: from mail-yw0-f177.google.com ([209.85.211.177]:64808) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NTmkJ-0004uj-Kd; Sat, 09 Jan 2010 20:37:36 -0500 Original-Received: by ywh7 with SMTP id 7so12417039ywh.24 for ; Sat, 09 Jan 2010 17:37:32 -0800 (PST) Original-Received: by 10.150.17.37 with SMTP id 37mr5527969ybq.285.1263087452820; Sat, 09 Jan 2010 17:37:32 -0800 (PST) X-Google-Sender-Auth: d8eff887f8922643 X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) 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:119770 Archived-At: > If we do this, we might want to set up a systematic way to explicitly > label those directories that should be in the search path. > In a case like, this, you wouldn't want (load "foo") > to searchfor dir1/foo or dir1/dir2/foo. In lieu of the other recent discussions of a `package' system for Emacs, please consider the use of `.' with `qualified' domains at the root of any such feature e.g. "org.gnu.feature" as opposed "dir/foo/feature" strip the domain accordingly: (defun get-the-right-feature (good-feature &optional good-source &rest bag-o-sources) (let (pkg) (mapc #'(lambda (bos) (let ((myb-good (split-string-and-unquote bos "\\.")) is-good) (when (memq good-feature (progn (while myb-good (push (read (pop myb-good)) is-good)) is-good)) (push (nreverse is-good) pkg)))) bag-o-sources) (let (the-sauce) (when good-source (mapc #'(lambda (sauce) (let ((is-sauce (memq good-source sauce))) (when is-sauce (setq the-sauce sauce)))) pkg)) (cond (the-sauce (memq good-source the-sauce)) ((= (length pkg) 1) (cdar pkg)) (t pkg))))) (get-the-right-feature 'feature 'gnu "org.gnu.feature" "org.emacsmirror.bubba" "com.tromey.feature") ;=> (gnu feature) (get-the-right-feature 'bubba nil "org.gnu.feature" "org.emacsmirror.bubba" "com.tromey.feature") ;=> (emacsmirror bubba) (get-the-right-feature 'feature nil "org.gnu.feature" "org.emacsmirror.bubba" "com.tromey.feature") ;=> ((com tromey feature) (org gnu feature)) (get-the-right-feature 'feature nil "org.gnu.feature" "org.emacsmirror.feature" "com.tromey.feature") ;=> ((com tromey feature) (org emacsmirror feature) (org gnu feature)) (get-the-right-feature 'bubba 'gnu "org.gnu.feature" "org.emacsmirror.feature" "com.tromey.feature") ;=> nil (get-the-right-feature 'feature nil "org.gnu.feature" "org.emacsmirror.feature/funky" "com.tromey.feature") ;=> ((com tromey feature) (org gnu feature))