unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: "Tom Breton (Tehom)" <tehom@panix.com>
To: emacs-devel@gnu.org
Subject: Proposal: directory-slash in library names
Date: Wed, 6 Jan 2010 18:08:15 -0500	[thread overview]
Message-ID: <656355bd369f9ef7dc6cb176159ac6eb.squirrel@mail.panix.com> (raw)


***** Rationale

Emacs library names are restricted to a flat-level namespace.  There
is no explicit support of submodules.

This limitation is usually worked around by using the format
COMMONPREFIX-LIBRARY.  This is used by packages such as org, calc, cl,
and sometimes by non-package arrangements such as pcomplete, which
standardizes the prefix "pcmpl-" for its clients.  Compare it to
Perl's easy deployment of constructions like
"AI::ExpertSystem::Advanced::KnowledgeDB::Base"

This workaround has disadvantages, including:
 * It's effectively limited to 2 components, since names must not
   clash on filesystems that limit filenames to 8.3 format.
 * Those components have to be fairly short.
 * Being short, those components are less readable than they could
   be.
 * Because they have so few characters to work with, library authors
   have to unduly concern themselves with possible nameclashes.
 * It lacks a natural way of naming support files (such as tests) in
   relation to the libraries they support.
 * Module names contain less information about the module's role than
   they could.

***** Proposal

This is real easy, almost a no-op.  I'm not proposing any new code.
I'm not proposing that any existing libraries be rewritten or renamed.

I'm only proposing:

 * to give the official OK to directory-slash in library names, for
   example:

   : dir1/dir2/feature

 * for the directory-slash to be treated as it is in filenames
   (specifically, internally canonized filenames).  Eg the example
   would mean to look for "dir1" anywhere in load-path, for "dir2"
   within that, and for "feature.elc" or "feature.el" there, using the
   first successful match.


***** It already seems to work

I experimented and it already does the right thing on GNU/Linux.  One
can write:

: (require 'dir1/dir2/feature)

and emacs will load-file "feature.el" from "dir1/dir2" beneath any
directory in load-path.

I cannot test it on other systems, but from the C source, it seems as
though it will work on any system that `expand-file-name' works on.
That apparently translates dir separators, eg it calls
CORRECT_DIR_SEPS for WIN_NT.


	Tom Breton (Tehom)






             reply	other threads:[~2010-01-06 23:08 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-01-06 23:08 Tom Breton (Tehom) [this message]
2010-01-07  4:12 ` Proposal: directory-slash in library names Eli Zaretskii
2010-01-07 22:50 ` Richard Stallman
2010-01-08  0:42   ` Tom Breton (Tehom)
  -- strict thread matches above, loose matches on Subject: below --
2010-01-10  1:37 MON KEY

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=656355bd369f9ef7dc6cb176159ac6eb.squirrel@mail.panix.com \
    --to=tehom@panix.com \
    --cc=emacs-devel@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).