From: MON KEY <monkey@sandpframing.com>
To: emacs-devel@gnu.org
Cc: rms@gnu.org
Subject: Re: Proposal: directory-slash in library names
Date: Sat, 9 Jan 2010 20:37:32 -0500 [thread overview]
Message-ID: <d2afcfda1001091737s54fedecepab37f8aab9a4abc6@mail.gmail.com> (raw)
> 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))
next reply other threads:[~2010-01-10 1:37 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-01-10 1:37 MON KEY [this message]
-- strict thread matches above, loose matches on Subject: below --
2010-01-06 23:08 Proposal: directory-slash in library names Tom Breton (Tehom)
2010-01-07 4:12 ` Eli Zaretskii
2010-01-07 22:50 ` Richard Stallman
2010-01-08 0:42 ` Tom Breton (Tehom)
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
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=d2afcfda1001091737s54fedecepab37f8aab9a4abc6@mail.gmail.com \
--to=monkey@sandpframing.com \
--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 public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).