[xmonad] darcs patch: Shell.hs: +getBrowser, getEditor, helper... (and 5 more)

Spencer Janssen sjanssen at cse.unl.edu
Thu Apr 3 18:26:39 EDT 2008

On Thu, Apr 03, 2008 at 05:16:01PM -0400, gwern0 at gmail.com wrote:
> On 2008.04.03 15:20:22 -0500, Spencer Janssen <sjanssen at cse.unl.edu> scribbled 1.8K characters:
> > I think this $EDITOR business is a bit silly, for several reasons.  $EDITOR by
> > default is set to a terminal based program, like vi or nano.  This means that
> > the raiseEditor function, for many users (essentially everyone that doesn't use
> > emacs), is totally useless.  What is the advantage of raiseEditor over
> > runOrRaise "emacs"?
> >
> > Also, I'm morally opposed to the default of "emacs" in getEditor, but we can
> > leave religion out of this.
> >
> > Cheers,
> > Spencer Janssen
> Well, my idea of adding another slot in the default config (and a useful binding) was rejected.

Your previous proposal was to add browser to the configuration, which we
decided against.  I'm perfectly okay with the $BROWSER use in the search module
and other places.

> The state has to live *somewhere*, and Roundy's idea was the only viable one mooted. It's also the more Unixy solution of configuring the default editor. Hence using $EDITOR.
> Now, I suspect this could be improved. For example, I was unsure whether to default to 'emacs' or 'emacsclient'; the problem with the latter is that sometimes it's invisible, when the buffer pops up in some emacs far far away or maybe pretty inaccessible (a forgotten Emacs in a screen session?), and I was also unsure whether emacsclient would do the right thing if no Emacs was running.
> Another suggestion I saw is to use VISUAL, since apparently that's also used sometimes (but surely even less than EDITOR - even my extensive config files just define VISUAL=$EDITOR).
> So I'll send a patch for those two changes.

The problem with $EDITOR is that you're, more than likely, using it wrong.
What happens when $EDITOR is set to vi, as it is on most systems by default?
The raiseEditor binding will simply not work, because vi is a terminal
application and not an X11 application.  raiseEditor is pretending to be more
general than it really is -- it will only work for emacs users (or for the
other rare cases where an X11 editor is set).  Because of this, I'm in favor of
removing the editor bindings.

> But why have this in general? Because it was a repeated pattern in my config file; because it could be useful to others; because it's an interesting extension of RunOrRaise. And so on. If you don't see the appeal, I'm not sure I can explain it better than that.

Do you really use the editor in multiple places in your config?  getEditor is
only used by raiseEditor in contrib, which isn't flexible enough to have more
than one keybinding to it anyway.

Spencer Janssen

More information about the xmonad mailing list