1. Yaron Minsky
  2. js-elisp


Peter Szilagyi  committed 5cb9114

Don't accumulate default values in the configuration.
Only save explicit user settings.

  • Participants
  • Parent commits d98e9b3
  • Branches default

Comments (0)

Files changed (1)

File ocaml/omake/config.ml

View file
  • Ignore whitespace
 let lookup t ~key ~default =
   let key = String.lowercase key in
   let default = String.lowercase default in
-  Hashtbl.find_or_add t key ~default:(fun () -> default)
+  Hashtbl.find t key |! Option.value ~default
 let read_file file =
     let s = Sexp.load_sexp file in
+    (* CR pszilagyi: Why is this downcased?  Won't that mangle shell commands with
+       uppercase letters in them? *)
     let sexp_of_string s = String.lowercase (String.t_of_sexp s) in
     Ok (T.t_of_sexp sexp_of_string s)
   with exn -> Error exn
 let update t ~key ~value =
   let key = String.lowercase key in
+  (* CR pszilagyi: Why downcase the value? *)
   let value = String.lowercase value in
   T.replace t ~key ~data:value