package ecaml
Library for writing Emacs plugin in OCaml
Install
Dune Dependency
Authors
Maintainers
Sources
v0.17.0.tar.gz
sha256=87e76473915e12d718096100a5c4d15d98aba6f99ecbf21814b7389e8c28bb25
doc/src/ecaml/directory.ml.html
Source file directory.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
open! Core open! Import open! Ecaml_filename let make_directory = Funcall.Wrap.("make-directory" <: Filename.t @-> bool @-> return nil) let create ?(parents = false) dirname = make_directory dirname parents let delete_directory = Funcall.Wrap.("delete-directory" <: Filename.t @-> bool @-> return nil) ;; let delete ?(recursive = false) dirname = delete_directory dirname recursive let directory_files = Funcall.Wrap.( "directory-files" <: Filename.t @-> bool @-> nil_or Regexp.t @-> bool @-> return (list Filename.t)) ;; let files ?(absolute = false) ?(include_dot_and_dotdot = false) ?matching ?(sort = true) dirname = let files = directory_files dirname absolute matching (not sort) in if include_dot_and_dotdot then files else List.filter files ~f:(fun file -> match Filename.nondirectory file with | "." | ".." -> false | _ -> true) ;; let directory_files_recursively = Funcall.Wrap.( "directory-files-recursively" <: Filename.t @-> Regexp.t @-> bool @-> bool @-> return (list Filename.t)) ;; let files_recursively ?(include_directories = false) ?(ignore_unreadable_dirs = false) ?(matching = Regexp.match_anything) dirname = directory_files_recursively dirname matching include_directories ignore_unreadable_dirs ;; let make_temp_file = Funcall.Wrap.("make-temp-file" <: string @-> bool @-> string @-> return Filename.t) ;; let make_temp_dir ~prefix ~suffix = make_temp_file prefix true suffix let with_temp_dir sync_or_async ~f ~prefix ~suffix = let filename = make_temp_dir ~prefix ~suffix in Sync_or_async.protect [%here] ~allow_in_background:true sync_or_async ~f:(fun () -> f filename) ~finally:(fun () -> delete filename ~recursive:true) ;; let for_temp_files_customization = Customization.Wrap.("temporary-file-directory" <: Filename.t) ;; let for_temp_files () = Customization.value for_temp_files_customization let for_temp_files_of_current_buffer = let function_symbol = Symbol.intern "temporary-file-directory" in let funcall = Funcall.Wrap.("temporary-file-directory" <: nullary @-> return Filename.t) in fun () -> if Symbol.function_is_defined function_symbol then funcall () else for_temp_files () ;;
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>