Index: /trunk/cli/dune
===================================================================
--- /trunk/cli/dune	(revision 24)
+++ /trunk/cli/dune	(revision 25)
@@ -2,4 +2,4 @@
  (name txt)
  (public_name txt)
- (modules txt authors convert conversion file index last listing new topics html atom gemini publish pull read recent)
+ (modules txt authors convert conversion edit file index last listing new topics html atom gemini publish pull read recent)
  (libraries text_parse.converter text_parse.parsers logarion msgpck curl str cmdliner))
Index: /trunk/cli/edit.ml
===================================================================
--- /trunk/cli/edit.ml	(revision 25)
+++ /trunk/cli/edit.ml	(revision 25)
@@ -0,0 +1,16 @@
+open Cmdliner
+let term =
+	let id = Arg.(value & pos 0 string "" & info [] ~docv:"text ID") in
+	let recurse = Arg.(value & flag & info ["R"] ~doc:"recurse, include subdirs") in
+	let reverse = Arg.(value & flag & info ["r"] ~doc:"reverse order") in
+	let time   = Arg.(value & flag & info ["t"] ~doc:"sort by time, newest first") in
+	let number = Arg.(value & opt (some int) None & info ["n"]
+		~docv:"number" ~doc:"number of entries to list") in
+	let authed = Arg.(value & opt (some string) None & info ["authored"]
+		~docv:"comma-separated names" ~doc:"texts by authors") in
+	let topics = Arg.(value & opt (some string) None & info ["topics"]
+		~docv:"comma-separated topics" ~doc:"texts with topics") in
+	Term.(const (Logarion.Archive.apply_sys_util "EDITOR" "nano") $ recurse $ time $ reverse $ number $ authed $ topics $ id),
+	Term.info "edit" ~doc: "edit a text" ~man:[ `S "DESCRIPTION";
+		`P "Launches $EDITOR with text path as parameter. If -R is used, the ID search space
+		includes texts found in subdirectories too" ]
Index: /trunk/cli/read.ml
===================================================================
--- /trunk/cli/read.ml	(revision 24)
+++ /trunk/cli/read.ml	(revision 25)
@@ -1,23 +1,3 @@
 open Logarion
-module FS = File_store
-module A = Archive
-
-let print r order_opt reverse_opt number_opt authors_opt topics_opt id_opt =
-	let predicates = if id_opt <> "" then [ A.ided id_opt ] else []
-		@ A.predicate A.authored authors_opt
-		@ A.predicate A.topics topics_opt in
-	let predicate text = List.fold_left (fun a e -> a && e text) true predicates in
-	let pager = try Sys.getenv "PAGER" with Not_found -> "less" in
-	let print_text acc (_t, fnames) = Printf.sprintf "%s %s" acc (List.hd fnames) in
-	let paths = match order_opt with
-	| false -> FS.fold ~r ~predicate print_text ""
-	| true ->
-		let order = match reverse_opt with true -> FS.newest | false -> FS.oldest in
-		match number_opt with
-		| Some number -> FS.fold ~r ~predicate ~order ~number print_text ""
-		| None -> FS.fold ~r ~predicate ~order print_text ""
-	in if paths = "" then ()
-	else (ignore @@ Sys.command @@ Printf.sprintf "%s %s" pager paths)
-	
 
 open Cmdliner
@@ -33,5 +13,5 @@
 	let topics = Arg.(value & opt (some string) None & info ["topics"]
 		~docv:"comma-separated topics" ~doc:"texts with topics") in
-	Term.(const print $ recurse $ time $ reverse $ number $ authed $ topics $ id),
+	Term.(const (Archive.apply_sys_util "PAGER" "less") $ recurse $ time $ reverse $ number $ authed $ topics $ id),
 	Term.info "read" ~doc: "read a text" ~man:[ `S "DESCRIPTION";
 		`P "List header information for current directory. If -R is used, list header
Index: /trunk/cli/txt.ml
===================================================================
--- /trunk/cli/txt.ml	(revision 24)
+++ /trunk/cli/txt.ml	(revision 25)
@@ -4,5 +4,5 @@
 let default_cmd =
 	let doc = "Discover, collect & exchange texts" in
-	let man = [ `S "Contact"; `P "<mailto:fox@orbitalfox.eu?subject=Logarion>" ] in
+	let man = [ `S "Contact"; `P "<mailto:logarion@lists.tildeverse.org?subject=Logarion>" ] in
 	Term.(ret (const (`Help (`Pager, None)))), Term.info "txt" ~version ~doc ~man
 
@@ -10,4 +10,5 @@
 	Authors.term;
 	Convert.term;
+	Edit.term;
 	File.term; File.unfile_term;
 	Index.term;
Index: /trunk/lib/archive.ml
===================================================================
--- /trunk/lib/archive.ml	(revision 24)
+++ /trunk/lib/archive.ml	(revision 25)
@@ -15,2 +15,19 @@
   let q = String_set.query query_string in
   fun n -> String_set.(predicate q (Text.set "Topics" n))
+
+let apply_sys_util env def_env r order_opt reverse_opt number_opt authors_opt topics_opt id_opt =
+	let predicates = if id_opt <> "" then [ ided id_opt ] else []
+		@ predicate authored authors_opt
+		@ predicate topics topics_opt in
+	let predicate text = List.fold_left (fun a e -> a && e text) true predicates in
+	let util = try Sys.getenv env with Not_found -> def_env in
+	let print_text acc (_t, fnames) = Printf.sprintf "%s %s" acc (List.hd fnames) in
+	let paths = match order_opt with
+	| false -> File_store.fold ~r ~predicate print_text ""
+	| true ->
+		let order = match reverse_opt with true -> File_store.newest | false -> File_store.oldest in
+		match number_opt with
+		| Some number -> File_store.fold ~r ~predicate ~order ~number print_text ""
+		| None -> File_store.fold ~r ~predicate ~order print_text ""
+	in if paths = "" then ()
+	else (ignore @@ Sys.command @@ Printf.sprintf "%s %s" util paths)
Index: unk/readme
===================================================================
--- /trunk/readme	(revision 24)
+++ 	(revision )
@@ -1,10 +1,0 @@
-Logarion
-	discover, collect & exchange plain text files
-
-Guide: <http://texts.orbitalfox.eu/11bcd8e9.htm>
-Header format: <http://git.disroot.org/orbifx/logarion/raw/branch/master/header>
-
-Source: <http://git.disroot.org/orbifx/logarion>
-Licence: EUPL <http://joinup.ec.europa.eu/software/page/eupl>
-
-IRC: <irc://tilde.chat/#logarion>
Index: /trunk/readme.txt
===================================================================
--- /trunk/readme.txt	(revision 25)
+++ /trunk/readme.txt	(revision 25)
@@ -0,0 +1,25 @@
+ID: ka4wtj
+Title: Logarion
+
+## Guides
+
+Exploring & pulling texts from Logarion repositories.
+<3sqd84.html>
+
+Creating texts & publishing on the net.
+<hvhhwf.html>
+
+
+## Contacts
+
+* Mailing list (anonymous) <https://lists.tildeverse.org/postorius/lists/logarion.lists.tildeverse.org/>
+* <irc://tilde.chat/#logarion>
+
+
+## References
+
+### Header format
+<http://git.disroot.org/orbifx/logarion/raw/branch/master/header>
+
+### Source
+<http://git.disroot.org/orbifx/logarion>
