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

Re: update-alternatives problem



On Tue, 6 Aug 2002 06:28:16 +0800 csj <csj@mindgate.net> wrote:

> Running "update-alternatives --config editor", I select jmacs. jmacs
> isn't actually a program but a link to joe:
> 
> $ file /usr/bin/jmacs 
> /usr/bin/jmacs: symbolic link to joe
> 
> Runnin joe as "jmacs" gives it emacs-like keybindings. But when I run
> the program as "editor" I get plain joe (with WordStar keybindings). I
> suspect that this is because the Debian alternatives system itself
> uses symlinks to do its magic. So joe isn't being called as jmacs.
> This behavior also happens with e3em, an emacs keybindings symlink to
> e3.

joe is being called as "editor", and I suppose it falls back to its
standard behaviour. The end of a symlink chain gets the first name used
to start the chain.

> I can think of several workarounds. But is there a "general" solution
> to the problem, something that I can apply to other symlinked
> programs?

I can't think of anything that wouldn't mess up future package upgrades,
as you'd have to insert an explicit call to the jemacs link somewhere in
the chain. Perhaps the easiest (less troublesome to maintain) way would
be to manually change the /etc/alternatives/editor link to point to a
scrip where you'd call jemacs:

   editor --(ln)--> script ---> jemacs --(ln)--> joe.

Just tested this, it works. joe would get "jemacs" as its $0

Just remember not to use the alternatives mechanism to change editors
again... :)

-- 
Carlos Sousa
http://vbc.dyndns.org/



Reply to: