Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 169107 - app-editors/emacs, app-editors/emacs-cvs: user-installed subdirs.el is overridden
Summary: app-editors/emacs, app-editors/emacs-cvs: user-installed subdirs.el is overri...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Emacs project
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-03-03 11:01 UTC by Ulrich Müller
Modified: 2007-03-07 04:35 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
Proposed patch for emacs-cvs-22.0.9999-r4.ebuild (diff,872 bytes, patch)
2007-03-03 11:03 UTC, Ulrich Müller
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ulrich Müller gentoo-dev 2007-03-03 11:01:44 UTC
app-editors/emacs and emacs-cvs (all versions >= 21) override the file /usr/share/emacs/site-lisp/subdirs.el which is part of the site installation. Especially it is not longer possible to exclude subdirectories from the lisp load-path.

Let me first explain the behaviour of vanilla Emacs. It installs two identical files called "subdirs.el" in /usr/share/emacs/site-lisp and in /usr/share/emacs/${PV}/site-lisp. Their default action is to scan all subdirectories. However, an already installed subdirs.el will not be overwritten.

With the introduction of SLOT support the Gentoo way of doing things was changed. The file in the former directory is no longer installed (to avoid collisions between slots), but the file in ${PV}/site-lisp has been modified to scan the subdirectories of /usr/share/emacs/site-lisp, too. (This modification is done by the patch emacs-subdirs-el-gentoo.diff.)

The result is that it is now no longer (at least not easily) possible for a user/site supplied subdirs.el to exclude some subdirectories from scanning.

Attached patch will bring the behaviour closer to the vanilla version by moving the subdirs.el installation to pkg_postinst().
Comment 1 Ulrich Müller gentoo-dev 2007-03-03 11:03:29 UTC
Created attachment 111898 [details, diff]
Proposed patch for emacs-cvs-22.0.9999-r4.ebuild

For the other CVS and non-CVS versions, the changes are essentially identical.
Comment 2 Christian Faulhammer (RETIRED) gentoo-dev 2007-03-04 12:06:23 UTC
(In reply to comment #1)
> For the other CVS and non-CVS versions, the changes are essentially identical.
 I changed 22.0.95 and 22.0.9999 (new revisions).  23's ebuild needs a great deal of rework.  For 21 I will wait if any problems occur in cvs versions.
Comment 3 Tassilo Horn 2007-03-06 10:49:12 UTC
Hi, it seems your change broke some stuff like CEDET.

app-emacs/cedet-1.0_pre3-r2 installs its lisp files under

    /usr/share/emacs/site-lisp/cedet/ 

with various subdirs. The 60cedet-gentoo.el loads /usr/share/emacs/site-lisp/cedet/common/cedet.el which seems to add the paths to the individual tools included in cedet to the emacs load-path. These are all the messages in the *Messages* buffer:

Warning: no fonts matching `-*-fixed-medium-r-normal-*-16-*-*-*-*-*-iso8859-1' available [2 times]
(emacs)
Loading /usr/share/emacs/site-lisp/site-gentoo.el (source)...
Loading /usr/share/emacs/site-lisp/haskell-mode/haskell-site-file.el (source)...done
Loading /usr/share/emacs/site-lisp/tex-site.el (source)...done
Loading /usr/share/emacs/site-lisp/cedet/common/cedet...
"/usr/share/emacs/site-lisp/cedet/common/" added to `load-path'
"/usr/share/emacs/site-lisp/cedet/cogre" added to `load-path'
"/usr/share/emacs/site-lisp/cedet/ede" added to `load-path'
"/usr/share/emacs/site-lisp/cedet/eieio" added to `load-path'
"/usr/share/emacs/site-lisp/cedet/semantic" added to `load-path'
"/usr/share/emacs/site-lisp/cedet/speedbar" added to `load-path'
"/usr/share/emacs/site-lisp/cedet/contrib" added to `load-path'
Setting up cedet...done
Setting up cogre...done
Setting up ede...done
Setting up eieio...done
Setting up semantic...
Loading derived...done
Loading advice...done
Loading semantic-idle...
Loading easymenu...done
Loading semantic-idle...done
Loading semanticdb...done
Loading semanticdb-system...done
Mark set [112 times]
Loading senator...
Loading ring...done
Loading senator...done
Setting up semantic...done
Setting up speedbar...done
Setting up cedet-contrib...done
Loading /usr/share/emacs/site-lisp/cedet/common/cedet...done
ECB 2.32 uses loaded semantic 2.0pre3, eieio 1.0pre3 and speedbar 1.0pre3.
Loading edmacro...done
Loading easy-mmode...done
Loading cl-seq...done
Loading byte-opt...done
Loading /usr/share/emacs/site-lisp/nxml-mode/rng-auto.el (source)...done
Loading /usr/share/emacs/site-lisp/site-gentoo.el (source)...done
Loading paren...done
Loading subst-ksc...done
Loading subst-gb2312...done
Loading subst-big5...done
Loading subst-jis...done
Loading disp-table...done
Loading desktop...done
Loading rx...done
Loading regexp-opt...done
EMMS Last.fm plugin activated
Loading windmove...done
Loading winner...done
Loading ido...done
Loading recentf...done
Loading /home/heimdall/.recentf...done
Cleaning up the recentf list...done (0 removed)
Loading gnuserv-compat...done
==> ~/.emacs successfully loaded. <==
Loading /home/heimdall/.emms-cache...done
Desktop: 0 buffers restored.
Loading eldoc...done
run-hooks: Cannot open load file: semantic-el

The last line errors because loading cedet.el by the 60cedet-gentoo.el added only the path listed at the beginning of the *Messages* buffer to the load-path. The language-dependend files like semantic-el.el, semantic-c.el, semantic-java.el and so on are in the directory

    /usr/share/emacs/site-lisp/cedet/bovine/

which is not in the load path. If I add

    (add-to-list 'load-path "/usr/share/emacs/site-lisp/cedet/bovine")

to my ~/.emacs the problem is fixed, but I think this has to be fixed somewhere else, not in the user's config files.
Comment 4 Ulrich Müller gentoo-dev 2007-03-06 11:02:04 UTC
OK, I shall look into that (for me cedet seems to work...).
Can you post your /usr/share/emacs/site-lisp/subdirs.el here?
Comment 5 Ulrich Müller gentoo-dev 2007-03-06 13:48:37 UTC
(In reply to comment #3)
> Hi, it seems your change broke some stuff like CEDET.
> [...]
> The language-dependend files like semantic-el.el, semantic-c.el,
> semantic-java.el and so on are in the directory
> 
>     /usr/share/emacs/site-lisp/cedet/bovine/
> 
> which is not in the load path.

Cedet expects them in /usr/share/emacs/site-lisp/cedet/semantic/bovine (which it adds to the load-path). This appears to be a cedet issue, so I have opened bug #169617 for this.
Comment 6 Tassilo Horn 2007-03-06 14:17:40 UTC
> Can you post your /usr/share/emacs/site-lisp/subdirs.el here?

There's no such file, but I have a /usr/share/emacs/22.0.95/site-lisp/subdirs.el containing

(if (fboundp 'normal-top-level-add-subdirs-to-load-path)
    (normal-top-level-add-subdirs-to-load-path))

and /usr/share/emacs/22.0.95/lisp/subdirs.el containing

;; -*- no-byte-compile: t -*-
;; In load-path, after this directory should come
;; certain of its subdirectories.  Here we specify them.
(normal-top-level-add-to-load-path '("url" "textmodes" "progmodes" "play" "obsolete" "net" "mh-e" "mail" "language" "international" "gnus" "eshell" "erc" 
"emulation" "emacs-lisp" "calendar" "calc" ))
;; Local Variables:
;; version-control: never
;; no-byte-compile: t
;; End:
Comment 7 Ulrich Müller gentoo-dev 2007-03-06 14:49:06 UTC
(In reply to comment #6)
> > Can you post your /usr/share/emacs/site-lisp/subdirs.el here?
> There's no such file [...]

There should be. It should be created when emergeing Emacs (during the post-install phase).

Did you get any error messages during emerge (they should appear immediately before the "Linking /usr/bin/emacs..." einfo messages)?
Comment 8 Tassilo Horn 2007-03-06 15:47:34 UTC
Indeed, there's an error:

>>> Original instance of package unmerged safely.
cp: cannot stat `//usr/share/emacs/22.0.9999/site-lisp/subdirs.el': No such file or directory
 * Linking /usr/bin/emacs.emacs-22.0.95 to /usr/bin/emacs (relative)
Comment 9 Christian Faulhammer (RETIRED) gentoo-dev 2007-03-06 16:01:40 UTC
(In reply to comment #8)
> Indeed, there's an error:
> 
> >>> Original instance of package unmerged safely.
> cp: cannot stat `//usr/share/emacs/22.0.9999/site-lisp/subdirs.el': No such

 I suppose in the ebuild ${SLOT} should be used instead of ${PV} when copying the file.
Comment 10 Ulrich Müller gentoo-dev 2007-03-06 17:31:42 UTC
(In reply to comment #9)
> I suppose in the ebuild ${SLOT} should be used instead of ${PV} when copying
> the file.

Yep, for the live CVS ebuild. (For emacs-21.* ${PV} should be used.)
Comment 11 Christian Faulhammer (RETIRED) gentoo-dev 2007-03-07 04:35:56 UTC
Ok, I changed the commands in cvs ebuild, and adjusted the normal emacs to not include subdirs patch.