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

Re: sensible-editor - let the user decied



Edward Betts <edward@debian.org> writes:

> > However, I forsee a long battle about which editors make into sensible
> > editor, and all kinds of fall-back issues. And is it really that big a
> > deal if a console editor gets brought up during an X session -- because
> > most uses of $EDITOR occur while using console programs anyway (crontab,
> > MUAs, News readers, etc.).

sensible-editor starts whatever root set /etc/alternatives/editor to,
unless the user wants differently.

> The solution to that battle is to ask the user.

Maybe /home/user/.alternatives/ could be created.

> At the moment, the alternatives system, the packaging system, the virtual
> package names, the sensible-* scripts, the default X server, the kernel image
> and the default window manager settings are all seperate entities. I think
> they could all be more tightly intergrated.
> 
> The default choice for the alternatives system is pre-deceided, the sensible
> scripts are similar, except they look at enviroment instead, while the default
> kernel, X server and windows manager are all decieded from questions in
> postinst scripts.

For the kernel, the X server thats needed, otherwise users can destroy 
the hardware. The windowmanager can be overridden, but thats to
difficult at the moment. ~/.alternatives would be a good solution.

> Function
> ---------
> Debian has a lot of programs that do the same thing. These functions could be
> descriped with a functions tag, in the package file. For each package there
> could be more than one function. This tag would be slightly similar to the
> virtual packages idea, but more advanced.
> 
> My basic example would be GNU Emacs. The functions tag could look like this:
> 
> Functions: editor, emacs, info-browser, mua, calendar

I thought about that for my proposal about how to better configure a
debian system and decided to leef it out for the moment. What I would
like is that when an editor is installed, I can make it the default
editor or put it at any place in a list of editors, of which the first 
one that works gets executed (just like the windowmanager file).
Also I want to have a look at possible values for
/etc/alternatives/foo and change its setting. I think that could be
achived via dpkg-hook extensions, but give me some time to think about 
it.

> I am sure it does more, but I can not think of any. Here is a list of possible
> functions:
> 
> editor  - Any editor.         examples: gnu emacs, vim, ed, nvi, jed, jove
>   emacs - A version of emacs. How strict are we here? do these qualify?:
>           jove - Jonathan's Own Version of Emacs qualify?
>           zile - Zile is a lossy emacs
>     examples: gnu emacs, gnu emacs, xemacs, xemacs, jove ??, zile ??

There should be some distinguishing between replacements like xemacs
and similar like zile.

> xserver                       examples: xggi, xserver-*
> kernel                        examples: linux, hurd, bsd

Thats hardware and dangerous to be wrong. I rather wouldn't let those
be handled that way. To easy to go wrong. And you don't realy have
choises there. There is normaly only one xserver that will fit.

> I am sure there are more `functions', for examples there are loads more

functions should be everything that has an /etc/alternatives, so
adding an /etc/alternatives adds a function and providing a function
will create an /etc/alternative.

> servers (irc, nfs, ftp, web, etc). The main suggestion of this system
> for them to have priorites that can be adjusted by the user, and the
> system administrator. So as a user I could run a dselect or apt like program
> with a list of packages and instead of selecting which to install, and which
> to hold, select priorites for the functions listed above. I might select emacs

In my mind I see a dialog interface with a list of possible
editors. You select one with the cursor keys and press return, then
you move it until you press return again. Or some similar bindings.

> as my main editor, gnu emacs 20 as my main emacs, and vim as my main vi. But I

If I have emacs installed and xemacs gets installed and provides emacs 
functinality, I don't want to be bothered about which one I want as
emacs. Some mechanism must be though of to prevent to many questions.

> could still have the others installed. It would be possible to have multiple
> ftp servers installed and the selected one gains the ftpd link and becomes the
> server that is run by inetd. I think most of the priorites would be useful on
> a per machine and per user basis, so that as a power user I could select a

~/.alternatives/ would be the solution. Maybe that should be suggested 
in a formal proposal.

> heavy weight editor, and other users could select an easier to use one. It
> would be a handy tool for changing window managers. It could use a similar
> symlink system to the alternatives system, have cc as a symlink the the
> current C compiler and vi a link to the current vi clone. The selected
> linux-kernel-image could be made the default in lilo.
> 
> There are some more questions though, what of the interface? I tend to use
> lynx on the console and netscape in X11, there should be some way of handling
> this.

May you can rewrite sensible-editor to a general form that takes $0 to 
detect the function, e.g. editor for sensible-editor, checkt for
$function to be set. If not, check for ~/.alternatives/function-$INTERFACE, 
where $INTERFACE is the current interface used. Then check for
~/.alternatives/function and then do the same in /etc/alternatives.

May the Source be with you.
			Goswin


Reply to: