I am using Emacs on Gentoo and I have added the following lines to my ~/.emacs as per the package installation instructions: ;; Load Gentoo Emacs add-ons. (load "/usr/share/emacs/site-lisp/site-gentoo.el") I have also installed the aspell package. It would be a nice enhancement to have the site-gentoo.el contain the following line when aspell is installed. ;; Use aspell instead of ispell. (setq-default ispell-program-name "aspell") I am filing this bug under app-editors/emacs however this may not be the right place. An equery belongs shows that the site-gentoo.el file is not owned by any packages. lb9566@think site-lisp % ls 50zenirc-gentoo.el site-gentoo.el zenirc lb9566@think site-lisp % equery belongs site-gentoo.el [ Searching for file(s) site-gentoo.el in *... ]
Created attachment 104595 [details] The output of emerge --info from my machine.
app-dicts, what do you think about introducing an emacs USE flag which installs a file containing the line proposed above and is installed by elisp-site-file-install "${FILESDIR}/${SITEFILE}" You need to inherit elisp.eclass and give the variable SITEFILE (I propose something as "58aspell.el").
I think such a file should be installed by the emacs ebuild, since the site file /usr/share/emacs/site-lisp/site-gentoo.el comes from and is for emacs. I think it's a bad idea for app-text/aspell to be doing that. Consider what would happen if emacs changes its site file format - such a change would depend on the version of emacs, not the version of aspell. Clearly site files are part of the emacs install, not part of the aspell install. After all, it's the default behaviour of emacs you want to change, not the behaviour of aspell. IMO the sensible approach would be to add an 'aspell' USE flag to the emacs ebuild, which would activate an RDEPEND on app-text/aspell and setup the site file accordingly. use.local.desc: app-editors/emacs:aspell - configure site to use aspell as default spelling utility emacs ebuild: RDEPEND="... aspell? ( app-text/aspell ) ...." src_install() { ... use aspell && <configure/install site file to use aspell> ... }
(In reply to comment #3) > I think such a file should be installed by the emacs ebuild, since the site > file /usr/share/emacs/site-lisp/site-gentoo.el comes from and is for emacs. A lot of other packages (dev-lang/erlang, sci-visualization/gnuplot) handle it by USE=emacs, so we should keep it consistent. You may always cc us when problems occur with that. > IMO the sensible approach would be to add an 'aspell' USE flag to the emacs > ebuild, which would activate an RDEPEND on app-text/aspell and setup the site > file accordingly. Then emacs would have more USE flags than PHP. Bad idea IMO.
(In reply to comment #4) > (In reply to comment #3) > > I think such a file should be installed by the emacs ebuild, since the site > > file /usr/share/emacs/site-lisp/site-gentoo.el comes from and is for emacs. > > A lot of other packages (dev-lang/erlang, sci-visualization/gnuplot) handle it > by USE=emacs, so we should keep it consistent. You may always cc us when > problems occur with that. Your two examples are completely different from what you're proposing for Aspell. Erlang and gnuplot supply emacs modes for their respective languages. Aspell does not provide an emacs mode; you're asking us to change the default spell checker for emacs - that should clearly be a function of the emacs ebuild (or implemented as a separate utility, an eselect module for example). The problems exist before you start - basically you're inverting the dependency relationship - emacs can depend on aspell, aspell absolutely has no dependency on emacs. As I said before, for example if emacs changes the way its internal configuration is done, we would end up having to do nasty version checks on emacs to figure out what to do, and worse than that, such changes won't get managed properly when emacs itself is upgraded (because it won't force a re-install of the other packages). Compare with the erlang & gnuplot examples you can see the difference - if the ABI for emacs modes changes between versions of emacs, this would be managed via DEPENDencies in the emacs and erlang/gnuplot ebuilds. This is how plugins are managed across the tree. The equivalent if we follow your proposal would be to have different versions of the aspell ebuild to support different emacs versions - clearly that's ridiculous. > > IMO the sensible approach would be to add an 'aspell' USE flag to the emacs > > ebuild, which would activate an RDEPEND on app-text/aspell and setup the site > > file accordingly. > > Then emacs would have more USE flags than PHP. Bad idea IMO. Stop worrying about adding a USE flag to emacs, and think what your proposal would do to aspell - and note that there are probably many packages that can use ispell or aspell as their default spellchecker. Your approach would have us add a USE flag for every such package. Then we'd have to create separate versions whenever one of those packages changes how it configures its default (to provide versions to be used in DEPENDencies) Now think about other emacs internal configuration that you might want to deal with. Say you had a default font option. Would you consider adding an emacs USE flag to the font package, telling it to reconfigure the installed emacs to use that font? Of course not. So why do you think that would be a good idea for aspell? Think about the definition of the USE flags we're discussing: aspell: Use Aspell as the default dictionary (for use in emacs ebuild, and any other package that can choose which spell checker to depend on) and for what you're proposing: emacs: Modify the system emacs installation to use this package as the default for the behaviour it supplies. The first is sensible, and in line with behaviour elsewhere in the tree (a big example being kde vs gnome). Clearly the second is not; not only is it completely different from the existing definition, 'Adds support for GNU emacs', but it's broken anyway - for example it doesn't deal with aspell being uninstalled, doesn't provide a mechanism for dealing with changes to the way emacs is configured. Aspell does not make use of emacs at all, it's the other way around - emacs can make use of aspell. This is completely different from providing emacs modes. If we follow your approach, then emerge -C aspell, things get broken hard - emerge world won't fix things, nor will revdep-rebuild. If you follow my suggestion, anyone doing emerge -C aspell will see it either being flagged for merging again when they emerge world (since emacs is still installed, and will pull aspell in as a dependency because the aspell USE flags would still be set), or will see emacs scheduled for rebuild if 'aspell' is removed from USE in make.conf (which is what someone doing emerge -C aspell is likely to do) on emerge -N world.
kevquinn, you are right. My apologies, I just mixed two things...
There will be no aspell USE flag, as we have spell already, which takes one out of aspell and ispell. The ebuild now checks if aspell is installed and sets the option accordingly. This solution existed in app-editors/emacs-cvs so I just copied it over now...just did forget about it. emacs-21-r5 has this.
This is great. Christian Faulhammer, thank you for the analysis and implementation. Kevin Quinn, thanks for the detailed explaination of the dependency scenarios.