emacs and /etc/alternatives

Toshio Kuratomi a.badger at gmail.com
Thu Mar 8 20:00:05 UTC 2007


On Thu, 2007-03-08 at 13:40 -0500, Chip Coldwell wrote:
> On Thu, 8 Mar 2007, Chip Coldwell wrote:
> > 
> > But in both cases, you expect to be able to run "emacs foo.c" from the
> > bash prompt and it will DTRT.  So /usr/bin/emacs *must* be either a
> > symlink or a wrapper script (currently, it's a symlink to a wrapper
> > script).
> 
> Let me clarify this -- /usr/bin/emacs must be either a symlink or a
> wrapper script unless the emacs and emacs-nox packages conflict.
> 
> Given that, it seems to me like /etc/alternatives is the preferred
> solution -- at least it's a standard way to set up a symlink.  It is
> definitely the right thing to do on Debian systems.
> 
No.  alternatives is definitely suitable for specific implementations of
servers which are drop in replacements for other specific
implementations.  With anything else, you have to ask these questions:

* Does it support the same command line options?
* Does it make sense for the system administrator to set this or is it
really an end-user preference?

Having alternatives manage a generic /usr/bin/editor that can be
switched between /usr/bin/vim and /usr/bin/emacs (and /bin/ed for that
matter) is clearly a violation of both these guidelines so its easy to
see why they are unsupported.

emacs-x vs emacs-nox does not (apparently) violate the first guideline
so one might think that alternatives is an okay place for it.  However,
it does violate the second guideline.  If both versions of emacs are
installed, it's really up to the end user to decide which version should
be "emacs".  Perhaps they always run in a terminal and feel that
starting the X version is bloat.  Perhaps they're a KDE user on a
multiuser system.  Perhaps they have an automated emacs script that they
run as a cron job to grab their mail, check for rss updates, and then
popup a notification via dbus before exiting.

None of these are unworkable with /usr/bin/emacs defined via
alternatives (you can use aliases, explicitly calling emacs-nox, etc)
but none of them are really speaking to alternatives' strong points.
IMHO, a /usr/bin/emacs script which does autodetection and looks in an
ENV variable for a user defined preference is a cleaner interface for
the user.

-Toshio
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
URL: <http://listman.redhat.com/archives/fedora-maintainers/attachments/20070308/85517190/attachment.sig>


More information about the Fedora-maintainers mailing list