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

Re: Should directory of unvompiled elisp file be added to load-path



Simon Josefsson <jas@extundo.com> wrote:

> Peter S Galbraith <p.galbraith@globetrotter.net> writes:
> 
> > Hi all,
> >
> > I wondering about load-path bloat and whether it matters.
> >
> > http://bugs.debian.org/189754 said that when help was listed about a
> > function of mine, the user couldn't click on the function name to move
> > point to the source code.
> >
> > That's because I add the compiled lisp directory to to load-path, but
> > not the directory of the sources themselves.
> >
> > e.g.
> >   (debian-pkg-add-load-path-item
> >    (concat "/usr/share/" (symbol-name flavor) "/site-lisp/dpkg-dev-el"))
> > but not
> >   (debian-pkg-add-load-path-item "/usr/share/emacs/site-lisp/dpkg-dev-el")
> >
> > Is it worth adding it for that purpose?
> > Or it it bloat?
> 
> In theory, you could ship the *.el in a dpkg-dev-el-doc package, but I
> assume it isn't a large file so it would be bloat.
> 
> IMHO documentation is important.  Only installing *.elc is like
> installing software without info manual or man pages.

The *.el files are of course shipped.  How else could I byte-compile
them! :-)
 
> Perhaps you don't need to byte compile the package?  Few elisp
> packages really need it, and doing things this way would fix the
> problem.  Compare the 'idn' package, it simply put files in
> /usr/share/emacs/site-lisp/.  It also make Emacs generate better
> debugging information, should users ever encounter a bug.  And it
> doesn't bloat load-path.

Right.  I think the files are large enough to warrant byte-compilation.
Although, they probably don't do tasks that take very long. 

> You could also consider using autoload instead of bloating load-path
> at all, although I'm not sure if Emacs is smart enough to locate
> documentation this way.  If not, it should probably be regarded as a
> bug, and reported.  If you need to byte compile the file, this is
> probably the best solution.

I'm sorry.  I don't follow.  The byte-compiled library is already loaded
by then, so how is autoload supposed to work?  Documentation is
available from the .elc files.  What doesn't work is the clickable link
to the source code, e.g. the `debian-bts-control' string below is
clickable after doing `C-h f debian-bts-control':

: debian-bts-control is an interactive autoloaded Lisp function in `debian-bts-control'.
: [Arg list not available until function definition is loaded.]
: 
: Contruct a message with initial ACTION command for control@bugs.debian.org.
: Contructs a new control command line if called from within the message
: being constructed.

I think the only way to make this work if to have the .el file in the
load-path.   But is it worth it?

> Thanks for thinking about this issue, it appears to me that if more
> emacs debian packages was modified in a similar spirit, the debian
> emacs startup time wouldn't be prohibiting.

It's not an issue for me personally, but I suppose it's an issue for
certain people.

Thanks!

Peter



Reply to: