all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Issue with .emacs, files not loading
@ 2008-06-03 14:59 Chris Poole
  2008-06-03 21:40 ` Colin S. Miller
  0 siblings, 1 reply; 7+ messages in thread
From: Chris Poole @ 2008-06-03 14:59 UTC (permalink / raw)
  To: help-gnu-emacs

I used to have everything in one .emacs file.

Now I've split it up into various files for different systems (I use
Mac OS X and GNU/Linux).

This is my .emacs file:

;; Check to see if running on Mac OS X or some GNU/Linux distro
(defvar macosx-p (string-match "darwin" (symbol-name system-type)))
(defvar linux-p (string-match "gnu/linux" (symbol-name system-type)))

;; Load stuff for GNU/Linux systems only
(when linux-p
  (setq load-path (append load-path (list "~/emacs/lisp/linux"))))

;; Load stuff for Mac OS X only
(when macosx-p
  (setq load-path (append load-path (list "~/emacs/lisp/macosx"))))

;; Load OS-independant stuff
(setq load-path (append load-path (list "~/emacs/lisp/generic")))

;; Load extra major modes (to top of load-path so loads first)
(setq load-path (cons "~/emacs/lisp/generic/org" load-path))

Inside ~/emacs/lisp/generic, I have all my settings in my-custom-
generic.el. (Not byte-compiled yet.) I also have several other files.
None of them load. Similar situation with the macosx directory, etc.

The final loading of org-mode does load though, replacing the version
that came with Emacs.

I can't see what I'm doing wrong -- can anyone tell me my stupid
mistake?

Thanks.


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Issue with .emacs, files not loading
  2008-06-03 14:59 Issue with .emacs, files not loading Chris Poole
@ 2008-06-03 21:40 ` Colin S. Miller
  2008-06-04  7:16   ` Sven Joachim
  0 siblings, 1 reply; 7+ messages in thread
From: Colin S. Miller @ 2008-06-03 21:40 UTC (permalink / raw)
  To: help-gnu-emacs

Chris Poole wrote:
> I used to have everything in one .emacs file.
> 
> Now I've split it up into various files for different systems (I use
> Mac OS X and GNU/Linux).
> 
> This is my .emacs file:
> 
> ;; Check to see if running on Mac OS X or some GNU/Linux distro
> (defvar macosx-p (string-match "darwin" (symbol-name system-type)))
> (defvar linux-p (string-match "gnu/linux" (symbol-name system-type)))
> 
> ;; Load stuff for GNU/Linux systems only
> (when linux-p
>   (setq load-path (append load-path (list "~/emacs/lisp/linux"))))
> 
> ;; Load stuff for Mac OS X only
> (when macosx-p
>   (setq load-path (append load-path (list "~/emacs/lisp/macosx"))))
> 
> ;; Load OS-independant stuff
> (setq load-path (append load-path (list "~/emacs/lisp/generic")))
> 
> ;; Load extra major modes (to top of load-path so loads first)
> (setq load-path (cons "~/emacs/lisp/generic/org" load-path))
> 
> Inside ~/emacs/lisp/generic, I have all my settings in my-custom-
> generic.el. (Not byte-compiled yet.) I also have several other files.
> None of them load. Similar situation with the macosx directory, etc.
> 
> The final loading of org-mode does load though, replacing the version
> that came with Emacs.
> 
> I can't see what I'm doing wrong -- can anyone tell me my stupid
> mistake?
> 
> Thanks.

Chris,
 From the variable's documentation

   *List of directories to search for files to load.
   Each element is a string (directory name) or nil (try default directory).

   Note that the elements of this list *may not* begin with "~", so you must
   call `expand-file-name' on them before adding them to this list.


You need to expand your paths before adding them to load-path.
I can't see where you are calling (load-library) to load
my-custom-generic.el.

HTH,
Colin S. Miller


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Issue with .emacs, files not loading
  2008-06-03 21:40 ` Colin S. Miller
@ 2008-06-04  7:16   ` Sven Joachim
  2008-06-04  8:47     ` Peter Dyballa
  2008-06-04 12:00     ` Chris Poole
  0 siblings, 2 replies; 7+ messages in thread
From: Sven Joachim @ 2008-06-04  7:16 UTC (permalink / raw)
  To: help-gnu-emacs

On 2008-06-03 23:40 +0200, Colin S. Miller wrote:

> From the variable's documentation
>
>   *List of directories to search for files to load.
>   Each element is a string (directory name) or nil (try default directory).
>
>   Note that the elements of this list *may not* begin with "~", so you must
>   call `expand-file-name' on them before adding them to this list.

Where did you get that?  Here it says:

,----
| *List of directories to search for files to load.
| Each element is a string (directory name) or nil (try default directory).
| Initialized based on EMACSLOADPATH environment variable, if any,
| otherwise to default specified by file `epaths.h' when Emacs was built.
`----

No mention of expand-file-name.

> You need to expand your paths before adding them to load-path.

Huh?  I have

(setq load-path (append (list "~/elisp") load-path))

in my .emacs since ages, and that has always worked.

> I can't see where you are calling (load-library) to load
> my-custom-generic.el.

That's a valid point, at last.

Sven


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Issue with .emacs, files not loading
  2008-06-04  7:16   ` Sven Joachim
@ 2008-06-04  8:47     ` Peter Dyballa
  2008-06-04 17:26       ` Eli Zaretskii
  2008-06-04 12:00     ` Chris Poole
  1 sibling, 1 reply; 7+ messages in thread
From: Peter Dyballa @ 2008-06-04  8:47 UTC (permalink / raw)
  To: Sven Joachim; +Cc: help-gnu-emacs


Am 04.06.2008 um 09:16 schrieb Sven Joachim:

>> You need to expand your paths before adding them to load-path.
>
> Huh?  I have
>
> (setq load-path (append (list "~/elisp") load-path))
>
> in my .emacs since ages, and that has always worked.

"~" is an acronym that UNIX shells understand. It's not part of a  
path specification. GNU Emacs seems to do the right thing in some  
instances. Using the expand-file-name function, let's say ten times  
in ~/.emacs, wastes after a few thousand launches a measurable amount  
of time and energy – and conserves far more when you don't protect/ 
expand ~. What is ~ meaning in Losedos? What is C:\ meaning in UNIX?  
Or classic Mac OS 8 or 9?

--
Mit friedvollen Grüßen

   Pete

Windows, c'est un peu comme le beaujolais nouveau: à chaque nouvelle  
cuvée on sait que ce sera dégueulasse, mais on en prend quand même,  
par masochisme.






^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Issue with .emacs, files not loading
  2008-06-04  7:16   ` Sven Joachim
  2008-06-04  8:47     ` Peter Dyballa
@ 2008-06-04 12:00     ` Chris Poole
  2008-06-04 12:49       ` Chris Poole
  1 sibling, 1 reply; 7+ messages in thread
From: Chris Poole @ 2008-06-04 12:00 UTC (permalink / raw)
  To: help-gnu-emacs

On Jun 4, 8:16 am, Sven Joachim <svenj...@gmx.de> wrote:
> On 2008-06-03 23:40 +0200, Colin S. Miller wrote:
>
> > From the variable's documentation
>
> >   *List of directories to search for files to load.
> >   Each element is a string (directory name) or nil (try default directory).
>
> >   Note that the elements of this list *may not* begin with "~", so you must
> >   call `expand-file-name' on them before adding them to this list.
>
> Where did you get that?  Here it says:
>
> ,----
> | *List of directories to search for files to load.
> | Each element is a string (directory name) or nil (try default directory).
> | Initialized based on EMACSLOADPATH environment variable, if any,
> | otherwise to default specified by file `epaths.h' when Emacs was built.
> `----
>
> No mention of expand-file-name.
>
> > You need to expand your paths before adding them to load-path.
>
> Huh?  I have
>
> (setq load-path (append (list "~/elisp") load-path))
>
> in my .emacs since ages, and that has always worked.
>
> > I can't see where you are calling (load-library) to load
> > my-custom-generic.el.
>
> That's a valid point, at last.
>
> Sven

Thanks.

I have the same definition for load-path as you do (not mention of
having to expand the path). And anyway, it works fine to load org-mode
without expanding the path.

But I'm afraid I'm new to elisp. I was under the impression that by
adding ~/.../generic to my load path, it would read all elisp files in
that directory, executing everything.

What do I have to do with load-library?


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Issue with .emacs, files not loading
  2008-06-04 12:00     ` Chris Poole
@ 2008-06-04 12:49       ` Chris Poole
  0 siblings, 0 replies; 7+ messages in thread
From: Chris Poole @ 2008-06-04 12:49 UTC (permalink / raw)
  To: help-gnu-emacs

OK, sorted it.

I didn't realise I had to manually load all the files in my load path
directories with load-library.

Added these commands, and now it works great.

Thanks.


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Issue with .emacs, files not loading
  2008-06-04  8:47     ` Peter Dyballa
@ 2008-06-04 17:26       ` Eli Zaretskii
  0 siblings, 0 replies; 7+ messages in thread
From: Eli Zaretskii @ 2008-06-04 17:26 UTC (permalink / raw)
  To: help-gnu-emacs

> From: Peter Dyballa <Peter_Dyballa@Web.DE>
> Date: Wed, 4 Jun 2008 10:47:41 +0200
> Cc: help-gnu-emacs@gnu.org
> 
> "~" is an acronym that UNIX shells understand.

Emacs understands it as well.

> Using the expand-file-name function, let's say ten times  
> in ~/.emacs, wastes after a few thousand launches a measurable amount  
> of time and energy

What exactly does it waste?

> What is ~ meaning in Losedos?

Same as on Unix: the home directory.

> What is C:\ meaning in UNIX?  

A file named "C:\".




^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2008-06-04 17:26 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-06-03 14:59 Issue with .emacs, files not loading Chris Poole
2008-06-03 21:40 ` Colin S. Miller
2008-06-04  7:16   ` Sven Joachim
2008-06-04  8:47     ` Peter Dyballa
2008-06-04 17:26       ` Eli Zaretskii
2008-06-04 12:00     ` Chris Poole
2008-06-04 12:49       ` Chris Poole

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.