Author:         Trent W. Buck <trentbuck@gmail.com>
Forwarded:      not-needed
Bug-Debian:     http://www.debian.org/doc/debian-policy/ch-customized-programs.html#s11.4
Description:    use editor(1) and pager(1) instead of specific editors/pagers.
 Follow Debian Policy §11.4 - honour VISUAL, EDITOR and PAGER, but fall back on
 editor and pager respectively.  This allows the sysadmin to define site-local
 editor/pager defaults.  It also means things work when less and vi/emacs/nano
 aren't installed -- which is the case on a new Debian installation if you
 uncheck the "standard" tasksel task.
 .
 Not forwarded because editor(1) and pager(1) are Debian-specific.
Index: darcs-experimental/src/Darcs/Utils.hs
===================================================================
--- darcs-experimental.orig/src/Darcs/Utils.hs	2012-04-01 10:29:45.000000000 +0100
+++ darcs-experimental/src/Darcs/Utils.hs	2012-04-02 19:42:31.288740993 +0100
@@ -319,19 +319,12 @@
 runEditor f = do
     ed <- getEditor
     execInteractive ed f
-         `ortryrunning` execInteractive "emacs" f
-         `ortryrunning` execInteractive "emacs -nw" f
-         `ortryrunning` execInteractive "nano" f
-#ifdef WIN32
-         `ortryrunning` execInteractive "edit" f
-#endif
-
 
 getEditor :: IO String
 getEditor = getEnv "DARCS_EDITOR" `catchall`
              getEnv "DARCSEDITOR" `catchall`
              getEnv "VISUAL" `catchall`
-             getEnv "EDITOR" `catchall` return "vi"
+             getEnv "EDITOR" `catchall` return "editor"
 
 
 environmentHelpEditor :: ([String], [String])
@@ -339,20 +332,17 @@
  "To edit a patch description of email comment, Darcs will invoke an",
  "external editor.  Your preferred editor can be set as any of the",
  "environment variables $DARCS_EDITOR, $DARCSEDITOR, $VISUAL or $EDITOR.",
- "If none of these are set, vi(1) is used.  If vi crashes or is not",
- "found in your PATH, emacs, emacs -nw, nano and (on Windows) edit are",
- "each tried in turn."])
-
+ "If none of these are set, editor(1) is used."])
 
 getViewer :: IO String
 getViewer = getEnv "DARCS_PAGER" `catchall`
-             getEnv "PAGER" `catchall` return "less"
+             getEnv "PAGER" `catchall` return "pager"
 
 environmentHelpPager :: ([String], [String])
 environmentHelpPager = (["DARCS_PAGER", "PAGER"],[
  "Darcs will sometimes invoke a pager if it deems output to be too long",
  "to fit onscreen.  Darcs will use the pager specified by $DARCS_PAGER",
- "or $PAGER.  If neither are set, `less' will be used."])
+ "or $PAGER.  If neither are set, pager(1) will be used."])
 
 data PromptConfig = PromptConfig { pPrompt :: String
                                  , pBasicCharacters :: [Char]
