[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Questions about emacs-snapshot (and also a small patch)

I wrote:

> Do `<f1> v load-path RET C-x o C-s local' and see if there's any match
> for you.  There isn't for me, and Trent Buck reported the same thing
> on IRC a while ago.
> As you'll know, Debian Emacs Policy[1] requires that every Emacs
> flavor have the following entries in `load-path' (in this order):
>     /usr/local/share/emacs/<upstream-version>/site-lisp
>     /usr/local/share/emacs/site-lisp
> This part of Policy is enforced, in a way, by the function
> `debian-pkg-add-load-path-item' (in `debian-startup.el'):
>     (if (not last-local-pos)
>         (error "No /usr/local/ prefixed paths in load-path"))
> This error is normally not very loud, even if the condition occurs,
> because of how the package initialization files (which are the ones
> that will call `debian-pkg-add-load-path-item') are loaded by the
> function `debian-run-directories' in the same file:
>          (condition-case ()
>              (load file nil)
>            (message "Error while loading %s" file))
> (That is, all errors are suppressed and messages are printed instead.)
> While the errors aren't loud, they do prevent packages from
> being loaded.

I think I've managed to work around this by adding a file called
`00ensure-policy-conforming-load-path.el' to
/etc/emacs-snapshot/site-start.d, with the following contents:

    (add-to-list 'load-path "/usr/share/emacs/site-lisp")
    (add-to-list 'load-path "/usr/share/emacs/emacs-snapshot/site-lisp")
    (add-to-list 'load-path "/usr/local/share/emacs/site-lisp")
    (add-to-list 'load-path "/usr/local/share/emacs/22.1/site-lisp")
    (add-to-list 'load-path "/etc/emacs")
    (add-to-list 'load-path "/etc/emacs-snapshot")

I'd probably be better if these were added a bit more automatically on
a bit lower level; in a word, they should be hardcoded.  As far as I
can tell, they are somewhat hardcoded in the Debian emacs21 package,
but I can't figure out why they aren't for emacs-snapshot.

This might still be a problem with my system, so I'd appreciate if
someone else could confirm/deny that `load-path' lacks these entries.

> What is a good way to find out why a package is failing to load?
> The ``Error while loading 50foo'' messages are not in themselves
> helpful.  For example,
> Loading 50w3m-el (source)...
> Error while loading 50w3m-el
> Loading 50wget-el (source)...done
> Loading 50whizzytex (source)...done
> Loading 51debian-el (source)...
> Error while loading 51debian-el
> Loading 51planner-el (source)...
> Error while loading 51planner-el
> How do you know what needs to be done to fix the w3m-el, debian-el,
> and planner-el packages?

It turned out that most of these problems were caused by a weird
situation that I do not fully understand, although I know the core
issue was byte compilation.  At one point, I was completely unable to
install emacs-snapshot.

The way out was to remove the troublemaking Emacs applications one by
one until emacs-snapshot could install cleanly, and then reinstall the
applications with emacs-snapshot in place.  This gave them a chance to
byte-compile themselves for emacs-snapshot.

God, I'm not sure why I'm writing this.  Hopefully the vague shreds of
information can be of value to someone.

Anyway, I'm learning a lot from this.  I'm now a *huge* step closer to
a healthy, Debian-integrated, bleeding-edge Emacs!  In fact, I think
all the pieces may just have fallen into place, because so far this
installation is *smooth*.  Thanks again Jérôme and everyone else who
helped make this happen! :-)

Daniel Brockman <daniel@brockman.se>

Reply to: