From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Xah Lee Newsgroups: gmane.emacs.help Subject: Re: elisp: isn't default-directory always the dir of current file?? Date: Tue, 3 Mar 2009 14:49:56 -0800 (PST) Organization: http://groups.google.com Message-ID: References: <19d2e227-6275-4b23-90f3-98c914a95156@o8g2000pre.googlegroups.com> <015bc5de-e438-4f92-b647-717776e51dc7@e1g2000pra.googlegroups.com> <070cfb3c-7d5c-444f-91fa-2948024b1ef7@n33g2000pri.googlegroups.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1236245777 16522 80.91.229.12 (5 Mar 2009 09:36:17 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 5 Mar 2009 09:36:17 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Mar 05 10:37:33 2009 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1LfA1C-0005On-7c for geh-help-gnu-emacs@m.gmane.org; Thu, 05 Mar 2009 10:37:31 +0100 Original-Received: from localhost ([127.0.0.1]:46441 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Lf9zq-00049p-S4 for geh-help-gnu-emacs@m.gmane.org; Thu, 05 Mar 2009 04:36:06 -0500 Original-Path: news.stanford.edu!newsfeed.stanford.edu!postnews.google.com!k36g2000pri.googlegroups.com!not-for-mail Original-Newsgroups: gnu.emacs.help,comp.emacs,comp.lang.lisp Original-Lines: 120 Original-NNTP-Posting-Host: 24.6.175.142 Original-X-Trace: posting.google.com 1236120597 6508 127.0.0.1 (3 Mar 2009 22:49:57 GMT) Original-X-Complaints-To: groups-abuse@google.com Original-NNTP-Posting-Date: Tue, 3 Mar 2009 22:49:57 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: k36g2000pri.googlegroups.com; posting-host=24.6.175.142; posting-account=bRPKjQoAAACxZsR8_VPXCX27T2YcsyMA User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Macintosh; U; PPC Mac OS X 10_4_11; en) AppleWebKit/525.27.1 (KHTML, like Gecko) Version/3.2.1 Safari/525.27.1, gzip(gfe), gzip(gfe) Original-Xref: news.stanford.edu gnu.emacs.help:167268 comp.emacs:97914 comp.lang.lisp:262165 X-Mailman-Approved-At: Thu, 05 Mar 2009 04:33:56 -0500 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:62610 Archived-At: Mike Mattie wrote: > I am not sure if it is 100% on target to your goals but there is a unifor= m 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, =E2=80=9Cemacs way=E2=80=9D debate= , FSF politics ... egads. ---------------- PS improved on my tutorial on emacs add-on installation a bit... hope its useful to someone: =E2=80=A2 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 =E2=80=9Cpackage=E2=80=9D and =E2=80=9Clibrary=E2=80=9D, are used= losely in emacs/elisp manual to refer to any useful elisp file. They are not technical definitions in elisp. A =E2=80=9Clibrary=E2=80=9D is just some elisp files = that do something useful. A =E2=80=9Cpackage=E2=80=9D usually refers to a particula= r one. The term =E2=80=9Cmodule=E2=80=9D is not used by emacs. Emacs's Concept of =E2=80=9CFeature=E2=80=9D The term =E2=80=9Cfeature=E2=80=9D has some meaning in elisp, but is not me= chanical. A =E2=80=9Cfeature=E2=80=9D 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 =E2=80=9Cfeatures=E2=80=9D, = which is a list of symbols. For example, here's part of the value of =E2=80=9Cfeatures= =E2=80=9D when i do =E2=80=9CCtrl+h v Enter features=E2=80=9D: 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 =E2=80=9C(provide =E2=80=B9some symbol=E2=80=BA)=E2= =80=9D near the end, which adds that symbol to the =E2=80=9Cfeatures=E2=80=9D list. The purpose of fea= tures and the =E2=80=9Cfeatures=E2=80=9D variable is to provide a way for emacs to kn= ow 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 =E2=80=9Cxyz-mode.el=E2=80=9D, it usually provides = a lisp symbol =E2=80=9Cxyz-mode=E2=80=9D as emacs feature, and the function is oft= en =E2=80=9Cxyz- mode=E2=80=9D. Sometimes the =E2=80=9Cmode=E2=80=9D 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 =E2=80=9Clisp-mode.el=E2=80=9D provides the symbol =E2=80=9Clisp-mode=E2=80= =9D as feature, and is invoked by emacs-lisp-mode. The =E2=80=9Ccua-base.el=E2=80=9D file provides= symbols =E2=80=9Ccua-base=E2=80=9D and =E2=80=9Ccua=E2=80=9D as features, and is in= voked by cua-mode. The =E2=80=9Ctext-mode.el=E2=80=9D file does not provide any symbol for feature= , but is a quite useful mode invoked by text-mode. The file =E2=80=9Cdesktop.el=E2=80= =9D provides =E2=80=9Cdesktop=E2=80=9D 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 =E2=80=9Cfeatures=E2=80=9D to determine if something is already loaded, and= =E2=80=9Cautoload=E2=80=9D to search thru file name variations in different paths. All the above means, you could have a file named =E2=80=9Cxyz.el=E2=80=9D, = which provides a feature named =E2=80=9Cabc=E2=80=9D, while it really just provid= e a mode to user with the command name =E2=80=9Copq-mode=E2=80=9D or sometimes just =E2= =80=9Copq=E2=80=9D, and it might be displayed in mode line as =E2=80=9COPQ=E2=80=9D, =E2=80=9COPQ help= er=E2=80=9D, or anything else. And, this file can be considered as a package as well as library. Xah =E2=88=91 http://xahlee.org/ =E2=98=84