History

Consistency and correct(erer)ness

malc committed 4 years ago

Commit cef17441 parent 4e21d744 files · +8 −9Browse files

Unified · Split

4 files
  1. config.ml +1 −1
  2. main.ml +7 −6
  3. utils.ml +0 −1
  4. utils.mli +0 −1
config.ml+1−1
@@ -1465,7 +1465,7 @@ let gc () = · 1464 unmodified lines
14651465 let cref = ref defconf in
14661466 let push (h, dc) =
14671467 let f path v =
1468− if Sys.file_exists path then Some v else (dolog1 "-%S" path; None)
1468+ if Sys.file_exists path then Some v else (dolog "removing %S" path; None)
14691469 in
14701470 Hashtbl.filter_map_inplace f h;
14711471 href := h;
main.ml+7−6
@@ -1006,12 +1006,12 @@ let pgoto opaque pageno x y = · 1005 unmodified lines
10061006 gotopagexy pageno x y
10071007
10081008 let act cmds =
1009− (* dolog1 "%S" cmds; *)
1009+ (* dolog "%S" cmds; *)
10101010 let spl = splitatchar cmds ' ' in
10111011 let scan s fmt f =
10121012 try Scanf.sscanf s fmt f
10131013 with exn ->
1014− dolog1 "error scanning %S: %s" cmds @@ exntos exn;
1014+ dolog "error scanning %S: %s" cmds @@ exntos exn;
10151015 exit 1
10161016 in
10171017 let addoutline outline =
@@ -1019,7 +1019,7 @@ let act cmds = · 1 unmodified line
10191019 | Outlining outlines -> S.currently := Outlining (outline :: outlines)
10201020 | Idle -> S.currently := Outlining [outline]
10211021 | Loading _ | Tiling _ ->
1022− dolog1 "invalid outlining state";
1022+ dolog "Invalid outlining state";
10231023 logcurrently !S.currently
10241024 in
10251025 match spl with
@@ -1168,7 +1168,7 @@ let act cmds = · 142 unmodified lines
11681168 )
11691169
11701170 | Idle | Tiling _ | Outlining _ ->
1171− dolog1 "Inconsistent loading state";
1171+ dolog "Inconsistent loading state";
11721172 logcurrently !S.currently;
11731173 exit 1
11741174 end
@@ -1212,7 +1212,7 @@ let act cmds = · 37 unmodified lines
12121212 )
12131213
12141214 | Idle | Loading _ | Outlining _ ->
1215− dolog1 "Inconsistent tiling state";
1215+ dolog "Inconsistent tiling state";
12161216 logcurrently !S.currently;
12171217 exit 1
12181218 end
@@ -4747,7 +4747,8 @@ let () = · 3528 unmodified lines
47474747 let optrfd =
47484748 ref (if nonemptystr !rcmdpath then remoteopen !rcmdpath else None)
47494749 in
4750− dologf := (adderrfmt "stderr" "%s\n");
4750+ if !S.redirstderr
4751+ then dologf := (adderrfmt "stderr" "%s\n");
47514752
47524753 let fdl =
47534754 let l = [!S.ss; !S.wsfd] in if !S.redirstderr then !S.stderr :: l else l
utils.ml+0−1
@@ -18,7 +18,6 @@ external hasdata : Unix.file_descr -> bool = "ml_hasdata" · 17 unmodified lines
1818 let now = Unix.gettimeofday
1919 let dologf = ref prerr_endline
2020 let dolog fmt = Printf.ksprintf !dologf fmt
21−let dolog1 fmt = Printf.ksprintf (fun s -> print_endline s; flush stdout) fmt
2221
2322 let exntos = function
2423 | Unix.Unix_error (e, s, a) ->
utils.mli+0−1
@@ -12,7 +12,6 @@ external hasdata : Unix.file_descr -> bool = "ml_hasdata" · 11 unmodified lines
1212 val now : unit -> float
1313 val dologf : (string -> unit) ref
1414 val dolog : ('a, unit, string, unit) format4 -> 'a
15−val dolog1 : ('a, unit, string, unit) format4 -> 'a
1615 val exntos : exn -> string
1716 val onoffs : bool -> string
1817 val error : ('a, unit, string, 'b) format4 -> 'a

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t