package chamo
A kind of emacs-like editor, using OCaml instead of lisp
Install
Dune Dependency
Authors
Maintainers
Sources
chamo-4.2.0.tar.bz2
md5=e2e9a58e6cd4f406f3ad10881fd3f1dc
sha512=9a52178ab25ad20dae4f7162475bd2ae9eec02cf75a10ddf3680f778850fa7c1117aa831adaa834c4b3b20c7e6aa44cfc9c51918ddb94276b32b200a446ad246
doc/src/chamo.main/chamo_main.ml.html
Source file chamo_main.ml
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 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123
(*********************************************************************************) (* Chamo *) (* *) (* Copyright (C) 2003-2021 Institut National de Recherche en Informatique *) (* et en Automatique. All rights reserved. *) (* *) (* This program is free software; you can redistribute it and/or modify *) (* it under the terms of the GNU Lesser General Public License version *) (* 3 as published by the Free Software Foundation. *) (* *) (* This program is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU General Public License for more details. *) (* *) (* You should have received a copy of the GNU General Public License *) (* along with this program; if not, write to the Free Software *) (* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA *) (* 02111-1307 USA *) (* *) (* Contact: Maxence.Guesdon@inria.fr *) (* *) (*********************************************************************************) (** Main module of the editor. *) open Chamo open Stk.Misc let _ = Args.parse () (* let () = Logs.Src.set_level Stk.Texture.src (Some Logs.Warning) let () = Logs.Src.set_level Stk.Log.src (Some Logs.Warning) let () = Logs.Src.set_level Stk.Textbuffer.src (Some Logs.Warning) let () = Logs.Src.set_level Stk.Textview.src (Some Logs.Warning) let () = Logs.Src.set_level Stk.Render.src (Some Logs.Warning) *) open Stk.Misc let () = let> () = Tsdl.Sdl.(init Init.(video+events)) in () let () = Lwt_main.run (Stk.App.init (*~sdl_events_mode:`Detached*) (*~event_delay:10*) ()) let main () = let logwin = Log.get_log_window () in Logs.set_reporter (Stk.Textlog.reporter logwin#textlog); let () = let css = {css| #minibuffer {} .keystate { bg_color: blue; fill: true; fg_color: white; } #minibuffer_vp { border_width: 2; border_color_focused: green; textview { border_width: 0; } } |css} in Stk.Theme.add_css_to_extension ~body:css Constant.stk_theme_extension in let waiter, wakener = Lwt.wait () in Gui.on_last_window_close := (Lwt.wakeup wakener) ; (* ignore(Log.get_log_window());*) Lwt.async_exception_hook := (fun e -> Log.err (fun m -> m "%s" (Printexc.to_string e))); List.iter Commands.async_command (!Args.init_commands @ !Args.commands); View.iter_factories (fun f -> Misc.catch_print_exceptions (fun () -> f#on_start) ()); begin try if Sys.file_exists !Layout.layout_file then try let layout = Layout.load_layout !Layout.layout_file in Layout.create_windows_of_layout layout with Failure s | Sys_error s -> prerr_endline s; raise Not_found else raise Not_found with Not_found -> match !Gui.gui_windows with [] -> ignore(Gui.create_window()) | _ -> () end; begin match !Gui.active_window, !Gui.gui_windows with None, w :: _ -> Gui.active_window := Some w | _ -> () end; let on_file file = Commands.async_launch_command "open_file" [| file |] in List.iter on_file !Args.remaining; let lw = Log.get_log_window () in lw#window#move ~x: 10 ~y:10; (*Log.show_log_window ();*) let%lwt () = Lwt.pick [Stk.App.run(); waiter] in View.iter_factories (fun f -> Misc.catch_print_exceptions (fun () -> f#on_exit) ()); Commands.async_command Constant.com_on_exit; Lwt.return_unit let () = try Lwt_main.run (main ()) with Unix.Unix_error (e,s1,s2) -> prerr_endline (Printf.sprintf "%s: %s %s" s1 (Unix.error_message e) s2); exit 1
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>