1 |
Seemant Kulleen <seemant@g.o> writes: |
2 |
|
3 |
> On Wed, 2003-09-10 at 01:38, Matthew Kennedy wrote: |
4 |
>> I know we have virtual/editor etc. but do we have a mechanism to |
5 |
>> invoke the users choice in editor? |
6 |
>> |
7 |
>> Not all stuff I've encountered cares about $EDITOR etc., and I ask |
8 |
>> because of a recent change in dev-lisp/clisp where i needed to set a |
9 |
>> specific editor. |
10 |
>> |
11 |
>> Any volunteers to implement the Debian "alternatives" system? Or |
12 |
>> maybe we just want a /usr/bin/generic-editor... |
13 |
>> |
14 |
>> Matt |
15 |
> |
16 |
> For the slightly clueless, of which I am one, can you explain both |
17 |
> methods? The /usr/bin/generic-editor in particular piques my |
18 |
> interest. |
19 |
|
20 |
Really they are the same thing in the general sense. IIRC, Debian's |
21 |
alternative system works like this (arrows are symlinks) |
22 |
|
23 |
/usr/bin/editor --> /etc/alternatives/editor |
24 |
|
25 |
/etc/alternatives/editor --> /usr/bin/emacs |
26 |
|
27 |
Just a simple indirection, really. |
28 |
|
29 |
The cool part is the Debian update-alternatives program. You run it |
30 |
like this: |
31 |
|
32 |
# update-alternatives --config editor |
33 |
|
34 |
There are 3 programs which provide `editor'. |
35 |
|
36 |
Selection Command |
37 |
----------------------------------------------- |
38 |
*+ 1 /usr/bin/nano |
39 |
2 /bin/ed |
40 |
3 /usr/bin/nvi |
41 |
|
42 |
Enter to keep the default[*], or type selection number: |
43 |
|
44 |
The "+" indicates the currently selected program. Selecting a new |
45 |
choice adjusts what that symlink from /etc/alternatives/editor points |
46 |
to. This works system-wide of course. |
47 |
|
48 |
Debian really have got this well integrated into their distro. The |
49 |
have alternatives arranged for editors, awks, ftps, infobrowsers, |
50 |
pagers, telnet clients, java runtimes and sdks, etc. |
51 |
|
52 |
I think if we really want to continue with our mantra of |
53 |
customizability, we really need something like this respected portage |
54 |
wide. |
55 |
|
56 |
Matt |
57 |
-- |
58 |
Matthew Kennedy |
59 |
Gentoo Linux Developer |
60 |
|
61 |
-- |
62 |
gentoo-dev@g.o mailing list |