Path: utzoo!mnetor!uunet!seismo!sundc!pitstop!sun!amdcad!ames!ll-xn!husc6!bloom-beacon!ptt.lcs.mit.edu!markl From: markl@PTT.LCS.MIT.EDU Newsgroups: comp.emacs Subject: Re: load-path code Message-ID: <8802111252.AA18432@PTT.LCS.MIT.EDU> Date: 11 Feb 88 12:52:30 GMT Sender: daemon@bloom-beacon.MIT.EDU Reply-To: markl@PTT.LCS.MIT.EDU Lines: 68 To: nntp-poster@PTT.LCS.MIT.EDU Repository: PTT Originating-Client: thyme [Uck -- mailer burp. Let's get it right this time...] From: msb@ho5cad.ATT.COM Date: 8 Feb 88 14:59:34 GMT Sender: nuucp@ho7cad.ATT.COM [...] (setq load-path (cons (expand-file-name "~/lib/emacs") load-path)) [...] My first question: Why is this a "better solution"? "Better" is not the right word in the sense that it is faster or more efficient; I think "more elegant" is a better choice. There is a minimum amount of complexity in the expression, which makes it easy to understand. My second question: I am just starting to learn some of this GNU .el stuff -- I'd looked a bit into the UniPress .ml stuff. Since there is not a 'tutorial' on the language, I'd be interested to hear from some experienced .el-programmers. All of the following were proposed as solutions to the original problem. Are any of the following good/bad, correct/incorrect, efficient/inefficient, etc? (setq load-path (cons (format "%s/.emacs" (getenv "HOME")) load-path)) This is simply broken. ".emacs" is a file, not a directory. The code's appearance is not bad, just overly complex when compared to the versions that follow. (setq load-path (concat (getenv "HOME") "/elisp-library") load-path) This is a bit better, but also more complex than necessary. (setq load-path (cons (substitute-in-file-name "$HOME/emacs") load-path)) (setq load-path (cons (expand-file-name "~/lib/emacs") load-path)) These are your best choices: the pathname is built by one form--very easy to read. My third question: Is it true that there is no 'tutorial' on the elisp language? "Real Soon Now" has been the anthem I've heard for months now; your only current option is to look at emacs-lisp code until you are blue in the face and hope something sinks in. That is the problem with all the code you listed above. There are so many utility functions available that without a manual, people are forced to pick the ones they have seen before even if there are simpler ones that will do the job. While writing my mail system, I found over and over that I could reduce 20 lines of emacs-lisp code to 5 lines simply by using an obscure function I hadn't come across before... Cheers, markl Internet: markl@ptt.lcs.mit.edu Mark L. Lambert MIT Laboratory for Computer Science Distributed Systems Group ----------