From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Tom Breton (Tehom)" Newsgroups: gmane.emacs.devel Subject: Proposal: directory-slash in library names Date: Wed, 6 Jan 2010 18:08:15 -0500 Message-ID: <656355bd369f9ef7dc6cb176159ac6eb.squirrel@mail.panix.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain;charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1262830996 26190 80.91.229.12 (7 Jan 2010 02:23:16 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 7 Jan 2010 02:23:16 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Jan 07 03:23:09 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 1NSi1j-0002Lz-KQ for ged-emacs-devel@m.gmane.org; Thu, 07 Jan 2010 03:23:07 +0100 Original-Received: from localhost ([127.0.0.1]:39026 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NSi1k-0004cP-5h for ged-emacs-devel@m.gmane.org; Wed, 06 Jan 2010 21:23:08 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NSezF-0006HL-5n for emacs-devel@gnu.org; Wed, 06 Jan 2010 18:08:21 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NSezB-0006A2-4A for emacs-devel@gnu.org; Wed, 06 Jan 2010 18:08:20 -0500 Original-Received: from [199.232.76.173] (port=41530 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NSezA-00069r-Iw for emacs-devel@gnu.org; Wed, 06 Jan 2010 18:08:16 -0500 Original-Received: from mail1.panix.com ([166.84.1.72]:53487) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NSezA-00036S-85 for emacs-devel@gnu.org; Wed, 06 Jan 2010 18:08:16 -0500 Original-Received: from mailbackend.panix.com (mailbackend.panix.com [166.84.1.89]) by mail1.panix.com (Postfix) with ESMTP id 57E141F08C for ; Wed, 6 Jan 2010 18:08:15 -0500 (EST) Original-Received: from mail.panix.com (localhost [127.0.0.1]) by mailbackend.panix.com (Postfix) with ESMTP id 5E5BC2F149 for ; Wed, 6 Jan 2010 18:08:15 -0500 (EST) X-Panix-Received: from 96.252.49.112 (SquirrelMail authenticated user tehom@panix.com) by mail.panix.com with HTTP; Wed, 6 Jan 2010 18:08:15 -0500 User-Agent: SquirrelMail/1.4.19 X-Priority: 3 (Normal) Importance: Normal X-detected-operating-system: by monty-python.gnu.org: Genre and OS details not recognized. X-Mailman-Approved-At: Wed, 06 Jan 2010 21:22:49 -0500 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:119553 Archived-At: ***** 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)