emacs load-path (was: Re: [Nix-dev] notmuch fails to configure)

Florian Friesdorf flo at chaoflow.net
Sun Feb 13 03:52:31 CET 2011


In short:
emacs load-path without manual work does not include system, default and
user profile installed emacs add-ons.

Proposed solution:
patch of compile time load path (epaths.h) for all emacsen included in
nixos.

If consensus, I'd create and include the necessary patches.

For details see below:

On Sun, Feb 13, 2011 at 02:59:05AM +0100, Florian Friesdorf wrote:
> (..)
> emacs is not yet able to find notmuch...

$ nix-env -q --installed --out-path org
org-7.4  /nix/store/9wpf3ha6snvacy1xdhvyw5h3y90h2nxl-org-7.4

All elisp files from
/nix/store/9wpf3ha6snvacy1xdhvyw5h3y90h2nxl-org-7.4/share/emacs/site-lisp/
are linked to ~/.nix-profile/share/emacs/site-lisp

in case of the default profile it would be:
/nix/var/nix/profiles/default/share/emacs/site-lisp/

and in case of system profile they would be linked to:
/nix/var/nix/profiles/system/sw/share/emacs/site-lisp/

All of these are not in my current load-path (see below). I think they
should be in the above order at the position marked with XXX. This would
result in the following search order (first one found is taken):
1. user home (.emacs.d or equiv)
2. user profile (~/.nix-profile/share/emacs/site-lisp)
3. default profile
(/nix/var/nix/profiles/default/share/emacs/site-lisp/)
4. system profile
(/nix/var/nix/profiles/system/sw/share/emacs/site-lisp/)
5. shipped with emacs

emacs load-path:
("/home/cfl/.emacs.d/cfl"
"/home/cfl/.emacs.d/vendor"
"/home/cfl/.emacs.d/elpa/find-file-in-project-2.0"
"/home/cfl/.emacs.d/elpa/gist-0.5"
"/home/cfl/.emacs.d/elpa/idle-highlight-1.0"
"/home/cfl/.emacs.d/elpa/inf-ruby-2.1"
"/home/cfl/.emacs.d/elpa/magit-0.8.1"
"/home/cfl/.emacs.d/elpa/project-local-variables-0.2"
"/home/cfl/.emacs.d/elpa/ruby-mode-1.1"
"/home/cfl/.emacs.d/elpa/yaml-mode-0.0.5"
"/home/cfl/.emacs.d//elpa-to-submit"
"/home/cfl/.emacs.d/"
XXX
"/nix/store/mpc7xxrjdrp8sfb3rjdiggwnrls91y0f-emacs-23.2/share/emacs/23.2/site-lisp"
"/nix/store/mpc7xxrjdrp8sfb3rjdiggwnrls91y0f-emacs-23.2/share/emacs/site-lisp"
"/nix/store/mpc7xxrjdrp8sfb3rjdiggwnrls91y0f-emacs-23.2/share/emacs/23.2/lisp"
"/nix/store/mpc7xxrjdrp8sfb3rjdiggwnrls91y0f-emacs-23.2/share/emacs/23.2/lisp/url"
"/nix/store/mpc7xxrjdrp8sfb3rjdiggwnrls91y0f-emacs-23.2/share/emacs/23.2/lisp/textmodes"
"/nix/store/mpc7xxrjdrp8sfb3rjdiggwnrls91y0f-emacs-23.2/share/emacs/23.2/lisp/progmodes"
"/nix/store/mpc7xxrjdrp8sfb3rjdiggwnrls91y0f-emacs-23.2/share/emacs/23.2/lisp/play"
"/nix/store/mpc7xxrjdrp8sfb3rjdiggwnrls91y0f-emacs-23.2/share/emacs/23.2/lisp/org"
"/nix/store/mpc7xxrjdrp8sfb3rjdiggwnrls91y0f-emacs-23.2/share/emacs/23.2/lisp/nxml"
"/nix/store/mpc7xxrjdrp8sfb3rjdiggwnrls91y0f-emacs-23.2/share/emacs/23.2/lisp/net"
"/nix/store/mpc7xxrjdrp8sfb3rjdiggwnrls91y0f-emacs-23.2/share/emacs/23.2/lisp/mh-e"
"/nix/store/mpc7xxrjdrp8sfb3rjdiggwnrls91y0f-emacs-23.2/share/emacs/23.2/lisp/mail"
"/nix/store/mpc7xxrjdrp8sfb3rjdiggwnrls91y0f-emacs-23.2/share/emacs/23.2/lisp/language"
"/nix/store/mpc7xxrjdrp8sfb3rjdiggwnrls91y0f-emacs-23.2/share/emacs/23.2/lisp/international"
"/nix/store/mpc7xxrjdrp8sfb3rjdiggwnrls91y0f-emacs-23.2/share/emacs/23.2/lisp/gnus"
"/nix/store/mpc7xxrjdrp8sfb3rjdiggwnrls91y0f-emacs-23.2/share/emacs/23.2/lisp/eshell"
"/nix/store/mpc7xxrjdrp8sfb3rjdiggwnrls91y0f-emacs-23.2/share/emacs/23.2/lisp/erc"
"/nix/store/mpc7xxrjdrp8sfb3rjdiggwnrls91y0f-emacs-23.2/share/emacs/23.2/lisp/emulation"
"/nix/store/mpc7xxrjdrp8sfb3rjdiggwnrls91y0f-emacs-23.2/share/emacs/23.2/lisp/emacs-lisp"
"/nix/store/mpc7xxrjdrp8sfb3rjdiggwnrls91y0f-emacs-23.2/share/emacs/23.2/lisp/cedet"
"/nix/store/mpc7xxrjdrp8sfb3rjdiggwnrls91y0f-emacs-23.2/share/emacs/23.2/lisp/calendar"
"/nix/store/mpc7xxrjdrp8sfb3rjdiggwnrls91y0f-emacs-23.2/share/emacs/23.2/lisp/calc"
"/nix/store/mpc7xxrjdrp8sfb3rjdiggwnrls91y0f-emacs-23.2/share/emacs/23.2/lisp/obsolete"
"/nix/store/mpc7xxrjdrp8sfb3rjdiggwnrls91y0f-emacs-23.2/share/emacs/23.2/leim")

If its the user's responsibility, at least the user should know about
it. But I think we should patch emacs' compile time load-path (epaths.h)
to include:
- ~/.nix-profile/share/emacs/site-lisp
- /nix/var/nix/profiles/default/share/emacs/site-lisp/
- /nix/var/nix/profiles/system/sw/share/emacs/site-lisp/

If you agree, I would create and include the patches for the emacsen.

-- 
Florian Friesdorf <flo at chaoflow.net>
  GPG FPR: 7A13 5EEE 1421 9FC2 108D  BAAF 38F8 99A3 0C45 F083
Jabber/XMPP: flo at chaoflow.net
IRC: chaoflow on freenode,ircnet,blafasel,OFTC



More information about the nix-dev mailing list