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

Re: weekly policy summary



On Fri, Dec 03, 1999 at 08:36:51PM -0800, Joseph Carter wrote:
> On Fri, Dec 03, 1999 at 07:29:20PM -0800, Joey Hess wrote:
> > Editor and sensible-editor
> >   * Old.
> >   * Proposed on 2 Jun 1999 by Goswin Brederlow.
> >   * Instead of having programs use $EDITOR and fall back to editor,
> >     just use sensible-editor.
> Since sensible-editor just uses $EDITOR if present, seconded.

There's no bug number for this proposal?

This doesn't seem particularly useful. On any other distribution on the
planet, sensible-editor won't exist, so it doesn't make it easier for
upstream, and as far as the user is concerned it's not much better than,
ummm,
	
	char *pch, buf[1000];
	if ((pch = getenv("EDITOR"))) {
		sprintf(buf, "%s filename.txt", pch);
	} else {
		sprintf(buf, "vi filename.txt", pch);
	}
	system(buf);

. So this seems to be extra work for absolutely no benefit to anyone.

OTOH, the above code fragment doesn't conform to policy, which demands:

     Thus, every program that launches an editor or pager has to use the
     EDITOR or PAGER environment variables to determine the editor/pager
     the user wants to get started. If these variables are not set, the
     programs `/usr/bin/editor' and `/usr/bin/pager' have to be used,
     respectively.

On the other hand, sensible-editor doesn't look at /usr/bin/editor either,
which conflicts with what policy says a couple of paragraphs later:

     If it is very hard to adapt a program to make us of the EDITOR and
     PAGER variable, that program should be configured to use
     `/usr/bin/sensible-editor' and `/usr/bin/sensible-pager' as editor or
     pager program, respectively. These are two scripts provided in the
     Debian base system that check the EDITOR and PAGER variables and
     launches the appropriate program or falls back to `/usr/bin/editor'
     and `/usr/bin/pager', automatically.

.

I wonder if:

	* EDITOR and PAGER are set in /etc/environment or /etc/profile
	  or somewhere to /usr/bin/editor and /usr/bin/pager respectively,
	  by default.

	* Programs should check $EDITOR and $PAGER if they need to fork
	  an editor or a pager, and try some other reasonable defaults if
	  those variables aren't set. /usr/bin/editor and /usr/bin/pager
	  being recommended, but /usr/bin/vi, /bin/vi, /usr/bin/less, etc
	  being allowed, since that's what happens on other systems.

	* If they can't do this, they should call
	  /usr/bin/sensible-{editor,pager} which will do it for them.

mightn't be a better way of managing this.

Cheers,
aj

-- 
Anthony Towns <aj@humbug.org.au> <http://azure.humbug.org.au/~aj/>
I don't speak for anyone save myself. GPG encrypted mail preferred.

 ``The thing is: trying to be too generic is EVIL. It's stupid, it 
        results in slower code, and it results in more bugs.''
                                        -- Linus Torvalds

Attachment: pgpaEClqJYbdL.pgp
Description: PGP signature


Reply to: