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
1465 let cref = ref defconf in1465 let cref = ref defconf in
1466 let push (h, dc) =1466 let push (h, dc) =
1467 let f path v =1467 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)
1469 in1469 in
1470 Hashtbl.filter_map_inplace f h;1470 Hashtbl.filter_map_inplace f h;
1471 href := h;1471 href := h;
main.ml+7−6
@@ -1006,12 +1006,12 @@ let pgoto opaque pageno x y = · 1005 unmodified lines
1006 gotopagexy pageno x y1006 gotopagexy pageno x y
1007 1007
1008let act cmds =1008let act cmds =
1009 (* dolog1 "%S" cmds; *)1009 (* dolog "%S" cmds; *)
1010 let spl = splitatchar cmds ' ' in1010 let spl = splitatchar cmds ' ' in
1011 let scan s fmt f =1011 let scan s fmt f =
1012 try Scanf.sscanf s fmt f1012 try Scanf.sscanf s fmt f
1013 with exn ->1013 with exn ->
1014 dolog1 "error scanning %S: %s" cmds @@ exntos exn;1014 dolog "error scanning %S: %s" cmds @@ exntos exn;
1015 exit 11015 exit 1
1016 in1016 in
1017 let addoutline outline =1017 let addoutline outline =
@@ -1019,7 +1019,7 @@ let act cmds = · 1 unmodified line
1019 | Outlining outlines -> S.currently := Outlining (outline :: outlines)1019 | Outlining outlines -> S.currently := Outlining (outline :: outlines)
1020 | Idle -> S.currently := Outlining [outline]1020 | Idle -> S.currently := Outlining [outline]
1021 | Loading _ | Tiling _ ->1021 | Loading _ | Tiling _ ->
1022 dolog1 "invalid outlining state";1022 dolog "Invalid outlining state";
1023 logcurrently !S.currently1023 logcurrently !S.currently
1024 in1024 in
1025 match spl with1025 match spl with
@@ -1168,7 +1168,7 @@ let act cmds = · 142 unmodified lines
1168 )1168 )
1169 1169
1170 | Idle | Tiling _ | Outlining _ ->1170 | Idle | Tiling _ | Outlining _ ->
1171 dolog1 "Inconsistent loading state";1171 dolog "Inconsistent loading state";
1172 logcurrently !S.currently;1172 logcurrently !S.currently;
1173 exit 11173 exit 1
1174 end1174 end
@@ -1212,7 +1212,7 @@ let act cmds = · 37 unmodified lines
1212 )1212 )
1213 1213
1214 | Idle | Loading _ | Outlining _ ->1214 | Idle | Loading _ | Outlining _ ->
1215 dolog1 "Inconsistent tiling state";1215 dolog "Inconsistent tiling state";
1216 logcurrently !S.currently;1216 logcurrently !S.currently;
1217 exit 11217 exit 1
1218 end1218 end
@@ -4747,7 +4747,8 @@ let () = · 3528 unmodified lines
4747 let optrfd =4747 let optrfd =
4748 ref (if nonemptystr !rcmdpath then remoteopen !rcmdpath else None)4748 ref (if nonemptystr !rcmdpath then remoteopen !rcmdpath else None)
4749 in4749 in
4750 dologf := (adderrfmt "stderr" "%s\n");4750 if !S.redirstderr
4751 then dologf := (adderrfmt "stderr" "%s\n");
4751 4752
4752 let fdl =4753 let fdl =
4753 let l = [!S.ss; !S.wsfd] in if !S.redirstderr then !S.stderr :: l else l4754 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
18let now = Unix.gettimeofday18let now = Unix.gettimeofday
19let dologf = ref prerr_endline19let dologf = ref prerr_endline
20let dolog fmt = Printf.ksprintf !dologf fmt20let dolog fmt = Printf.ksprintf !dologf fmt
21let dolog1 fmt = Printf.ksprintf (fun s -> print_endline s; flush stdout) fmt
22 21
23let exntos = function22let exntos = function
24 | Unix.Unix_error (e, s, a) ->23 | 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
12val now : unit -> float12val now : unit -> float
13val dologf : (string -> unit) ref13val dologf : (string -> unit) ref
14val dolog : ('a, unit, string, unit) format4 -> 'a14val dolog : ('a, unit, string, unit) format4 -> 'a
15val dolog1 : ('a, unit, string, unit) format4 -> 'a
16val exntos : exn -> string15val exntos : exn -> string
17val onoffs : bool -> string16val onoffs : bool -> string
18val error : ('a, unit, string, 'b) format4 -> 'a17val 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