all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Xah Lee <xahlee@gmail.com>
To: help-gnu-emacs@gnu.org
Subject: Re: elisp: isn't default-directory always the dir of current file??
Date: Tue, 3 Mar 2009 14:49:56 -0800 (PST)	[thread overview]
Message-ID: <ac475d7b-a502-4965-bb37-250936a0bd6a@k36g2000pri.googlegroups.com> (raw)
In-Reply-To: mailman.2298.1236115585.31690.help-gnu-emacs@gnu.org

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/

  parent reply	other threads:[~2009-03-03 22:49 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-03-02  6:54 elisp: isn't default-directory always the dir of current file?? Xah Lee
2009-03-02  7:27 ` Xah Lee
2009-03-02  7:46   ` Xah Lee
2009-03-02 10:32     ` Lennart Borgman
     [not found]     ` <mailman.2198.1235989932.31690.help-gnu-emacs@gnu.org>
2009-03-02 20:32       ` Xah Lee
2009-03-03 16:45         ` Mike Mattie
     [not found]         ` <mailman.2298.1236115585.31690.help-gnu-emacs@gnu.org>
2009-03-03 22:49           ` Xah Lee [this message]
2009-03-02 13:12 ` Alan Mackenzie
2009-03-02 20:38   ` Xah Lee
2009-03-03  4:06     ` Kevin Rodgers

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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ac475d7b-a502-4965-bb37-250936a0bd6a@k36g2000pri.googlegroups.com \
    --to=xahlee@gmail.com \
    --cc=help-gnu-emacs@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 external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.