From: Xah Lee
Subject: Re: elisp: isn't default-directory always the dir of current file??
Date: 
Message-ID: <ac475d7b-a502-4965-bb37-250936a0bd6a@k36g2000pri.googlegroups.com>
Mike Mattie wrote:
> I am not sure if it is 100% on target to your goals but there is a uniform system. It is Tromney's ELPA
> ...
> http://tromey.com/elpa/
> GRAIL: http://www.emacswiki.org/emacs/Grail

Thanks. Gosh, more hours to be spend. I'll try to digest them and
maybe use them and submit my elisp packages in elpa form.

Wouldn't it be nice if it's all build-in in emacs? But then there's
the paper signing, endless philosophies, “emacs way” debate, FSF
politics ... egads.

----------------
PS improved on my tutorial on emacs add-on installation a bit... hope
its useful to someone:

• How To Install Emacs Packages
  http://xahlee.org/emacs/emacs_installing_packages.html

Excerpt:
--------------------

What's Library, Package, Feature?

Here's a bit technical detail about some elisp issues related to
library. Knowing it helps you a bit when installing packages.

No Namespace

Emacs lisp the language does not have name spaces. Everything is
global, with dynamic scope, with some shadowing mechanism. So, don't
expect library or module to be language defined name space constructs
that somewhat enforce name space and file name relation, as in Perl,
Python, Java.

Package And Library Are Not Managed

The terms “package” and “library”, are used losely in emacs/elisp
manual to refer to any useful elisp file. They are not technical
definitions in elisp. A “library” is just some elisp files that do
something useful. A “package” usually refers to a particular one. The
term “module” is not used by emacs.

Emacs's Concept of “Feature”

The term “feature” has some meaning in elisp, but is not mechanical. A
“feature” is a elisp symbol, that is intended to represent the
functionality provided by a emacs package. This elisp symbol, can be
placed on the predefined global variable named “features”, which is a
list of symbols. For example, here's part of the value of “features”
when i do “Ctrl+h v Enter features”:

ibuffer etags ring cc-mode cc-fonts cc-menus cc-cmds cc-styles
cc-align cc-engine cc-vars cc-defs xlsl-mode encoded-kb speck
sgml-mode dired info newcomment desktop recentf tree-widget wid-edit
advice help-fns ...

A elisp file can call “(provide ‹some symbol›)” near the end, which
adds that symbol to the “features” list. The purpose of features and
the “features” variable is to provide a way for emacs to know if
something is already loaded.

There is no absolute relation between any concept of package/library/
module/feature/autoload facilities and the file name. By convention,
if a elisp file name is “xyz-mode.el”, it usually provides a lisp
symbol “xyz-mode” as emacs feature, and the function is often “xyz-
mode”. Sometimes the “mode” part is dropped in the file name, feature
symbol, or function name. This is only a lose convention. There are a
lot exceptions in many bundled emacs packages. For example, the file
“lisp-mode.el” provides the symbol “lisp-mode” as feature, and is
invoked by emacs-lisp-mode. The “cua-base.el” file provides symbols
“cua-base” and “cua” as features, and is invoked by cua-mode. The
“text-mode.el” file does not provide any symbol for feature, but is a
quite useful mode invoked by text-mode. The file “desktop.el” provides
“desktop” as feature, and is invoked by desktop-save-mode.

Summary

Emacs's library/module/package is a primitive system, centered on
loading file, with some slightly high level things such as its
“features” to determine if something is already loaded, and “autoload”
to search thru file name variations in different paths.

All the above means, you could have a file named “xyz.el”, which
provides a feature named “abc”, while it really just provide a mode to
user with the command name “opq-mode” or sometimes just “opq”, and it
might be displayed in mode line as “OPQ”, “OPQ helper”, or anything
else. And, this file can be considered as a package as well as
library.

  Xah
∑ http://xahlee.org/

☄