1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
|
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.
--- a/src/Darcs/UI/External.hs
+++ b/src/Darcs/UI/External.hs
@@ -432,6 +432,7 @@ viewDocWith pr mode msg = do
Nothing -> return $ ExitFailure 127 -- No such command
-- TEMPORARY passing the -K option should be removed as soon as
-- we can use the delegate_ctrl_c feature in process
+ `ortryrunning` pipeDocToPager "pager" [] pr mode msg
`ortryrunning` pipeDocToPager "less" ["-RK"] pr mode msg
`ortryrunning` pipeDocToPager "more" [] pr mode msg
#ifdef WIN32
@@ -512,19 +513,13 @@ runEditor :: FilePath
runEditor f = do
ed <- getEditor
execInteractive ed f
- `ortryrunning` execInteractive "vi" f
- `ortryrunning` execInteractive "emacs" f
- `ortryrunning` execInteractive "emacs -nw" 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 "nano"
+ getEnv "EDITOR" `catchall` return "editor"
catchall :: IO a
-> IO a
--- a/src/Darcs/UI/Commands/Help.hs
+++ b/src/Darcs/UI/Commands/Help.hs
@@ -400,15 +400,13 @@ environmentHelpEditor = (["DARCS_EDITOR"
"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."])
environmentHelpPager :: ([String], [String])
environmentHelpPager = (["DARCS_PAGER", "PAGER"],[
"Darcs will invoke a pager if the output of some command is longer",
"than 20 lines. 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."])
environmentHelpTimeout :: ([String], [String])
environmentHelpTimeout = (["DARCS_CONNECTION_TIMEOUT"],[
|