On Thu, Jun 19, 2003 at 02:02:08AM +0100, Colin Watson wrote: > I haven't thought very much about Colin Walters' [1] points about > editors as embeddable components yet, but if we had a distinct XEDITOR > then we could probably support that quite sensibly by just using them > when XEDITOR isn't set, since people whose only X applications are > GNOMEish with an integrated editor component (for example) will have > little reason to set it, even if they set EDITOR for terminal programs. > I do take the point that nano in an xterm isn't the prettiest of > defaults, but conversely I want a way to be able to tell all X > applications that I want, say, gvim - or even 'pterm -e vi' - as my > graphical editor without having to jump through hoops to do this for > each desktop environment and each miscellaneous X application > separately. > We would also need a /usr/bin/x-editor alternative, with some scheme for > agreeing priorities, and a sensible-x-editor program in debianutils. The > other approach to the latter would be to modify sensible-editor to look > at $DISPLAY � la sensible-browser, but I think that would be unwise; you > want the condition to be whether an X application is calling the editor, > not whether you happen to be in X, since it's frequent for a user to > want terminal-based programs to spawn terminal-based editors even if > they happen to be running in X (say, mutt in an xterm). > sensible-x-editor keys the decision on the nature of the caller, which > is more appropriate. It seems to me that it could be integrated into sensible-editor, provided that the controlling factor is the presence of a controlling tty rather than the value of the $DISPLAY variable. I definitely don't want xterms spawning xterms on my system just because mutt invoked my editor while running under X... > Thus, the policy for spawning an X editor could be: (1) check XEDITOR, > (2) use integrated editor if available, (3) run sensible-x-editor (which > might have 'xterm -e $EDITOR' as one of its fallback choices). Would > this keep everyone happy? This seems like a good solution, as well. I still suspect that with a tty check it could be integrated into sensible-editor, but otherwise I think this is a winner. -- Steve Langasek postmodern programmer
Attachment:
pgpX22QnZaZyC.pgp
Description: PGP signature