[nongnu] elpa/proof-general 5169627: Test that the Proof General prelude is correct

2021-08-27 Thread ELPA Syncer
branch: elpa/proof-general
commit 51696277a4dc30acd61e9ebb400d99934955e450
Author: Hendrik Tews 
Commit: Pierre Courtieu 

Test that the Proof General prelude is correct

Add a test that checks that the commands that Proof General sends
to Coq before the first script command do not raise an error. See
also #567.
---
 ci/simple-tests/README.md   | 11 
 ci/simple-tests/test-prelude-correct.el | 92 +
 2 files changed, 103 insertions(+)

diff --git a/ci/simple-tests/README.md b/ci/simple-tests/README.md
index 1a6e8c9..34812cf 100644
--- a/ci/simple-tests/README.md
+++ b/ci/simple-tests/README.md
@@ -10,3 +10,14 @@ test-omit-proofs
 coq-par-job-needs-compilation-quick
 : test coq-par-job-needs-compilation-quick by enumerating all
   possible cases
+test-prelude-correct
+: test that the Proof General prelude is correct
+
+
+# Important conventions
+
+The Makefile runs all ERT tests in all `test-*.el` files.
+Therefore, the test should be written in a file matching this
+pattern.
+
+To run all tests in a single file, do `make test-*.success`.
diff --git a/ci/simple-tests/test-prelude-correct.el 
b/ci/simple-tests/test-prelude-correct.el
new file mode 100644
index 000..84c0625
--- /dev/null
+++ b/ci/simple-tests/test-prelude-correct.el
@@ -0,0 +1,92 @@
+;; This file is part of Proof General.
+;; 
+;; © Copyright 2021  Hendrik Tews
+;; 
+;; Authors: Hendrik Tews
+;; Maintainer: Hendrik Tews 
+;; 
+;; License: GPL (GNU GENERAL PUBLIC LICENSE)
+
+;;; Commentary:
+;;
+;; Test that the Proof General prelude is correct.
+;;
+;; I use Proof General prelude here to refer to the initialization
+;; commands that Proof General sends to Coq before the first command
+;; of the script.
+
+;; This test shows different behaviour before 8.10. When the problem
+;; is fixed, I expect that the version distinction is no longer
+;; necessary and can be deleted.
+;;
+;; Load stuff for `coq--version<'
+(require 'proof-site)
+(proof-ready-for-assistant 'coq)
+(require 'coq-system)
+
+(defconst coq--post-v810 (coq--post-v810)
+  "t if Coq is more recent than 8.9")
+
+(message "goal present tests run with Coq version %s; post-v810: %s"
+ (coq-version t) coq--post-v810)
+
+
+;;; Coq source code for tests 
+
+(defconst coq-src-proof
+  "Check 1."
+  "Coq source code for checking the prelude.")
+
+
+;;; utility functions
+
+(defun record-buffer-content (buf)
+  "Record buffer content of BUF via `message' for debugging.
+BUF should be a string."
+  (with-current-buffer buf
+(let ((content (buffer-substring-no-properties (point-min) (point-max
+  (message "%s buffer contains %d chars: %s" buf (length content) 
content
+
+(defun wait-for-coq ()
+  "Wait until processing is complete."
+  (while (or proof-second-action-list-active
+ (consp proof-action-list))
+;; (message "wait for coq/compilation with %d items queued\n"
+;;  (length proof-action-list))
+;;
+;; accept-process-output without timeout returns rather quickly,
+;; apparently most times without process output or any other event
+;; to process.
+(accept-process-output nil 0.1)))
+
+
+;;; define the test
+
+(ert-deftest prelude-correct ()
+  :expected-result (if coq--post-v810 :passed :failed)
+  "Test that the Proof Genneral prelude is correct.
+Check that all the commands that Proof General sends as
+initialization before the first script command to Coq do not
+yield an error."
+  (message "prelude-correct test: Check the Proof General prelude")
+  (setq proof-three-window-enable nil)
+  (let (buffer)
+(unwind-protect
+(progn
+  (find-file "goals.v")
+  (setq buffer (current-buffer))
+  (insert coq-src-proof)
+  (proof-goto-point)
+  (wait-for-coq)
+  (record-buffer-content "*coq*")
+
+  ;; check that there is no error in *coq*
+  (with-current-buffer "*coq*"
+(goto-char (point-min))
+(should (not (re-search-forward "Error:" nil t)
+
+  ;; clean up
+  (when buffer
+(with-current-buffer buffer
+  (set-buffer-modified-p nil))
+(kill-buffer buffer)



[nongnu] elpa/tuareg updated (d2b38f0 -> f6801c8)

2021-08-27 Thread ELPA Syncer
elpasync pushed a change to branch elpa/tuareg.

  from  d2b38f0   Remove old Travis CI configuration
   new  3e943c3   Tests commenting: move the `should' outside `let'
   new  4e0ff99   Consistently support space-only `comment-continue' on 
Emacs < 28
   new  0fe4473   Improve tuareg.el header
   new  742037b   Update the comment of the code putting 'ocaml error 
regexp first
   new  2c75e58   Makefile: remove SMIE toggle
   new  e98e55d   Add sample OCaml code to test highlighting
   new  c55a9db   Add badges for NonGNU ELPA and Debian
   new  6357f82   Update OPAM file
   new  de7e6c4   Use the default commenting style & explain how to 
customize this
   new  f6801c8   Update Tuareg header


Summary of changes:
 Makefile|   5 +-
 README.md   |  13 +++
 sample_highlight.ml | 313 
 tuareg-compat.el| 198 +
 tuareg-tests.el |  37 ---
 tuareg.el   |  27 ++---
 tuareg.opam |   5 +-
 7 files changed, 564 insertions(+), 34 deletions(-)
 create mode 100644 sample_highlight.ml
 create mode 100644 tuareg-compat.el



[nongnu] elpa/tuareg 2c75e58 05/10: Makefile: remove SMIE toggle

2021-08-27 Thread ELPA Syncer
branch: elpa/tuareg
commit 2c75e580f4309b9191ebefccbb78ad84d93bbb6a
Author: Christophe Troestler 
Commit: Christophe Troestler 

Makefile: remove SMIE toggle
---
 Makefile | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/Makefile b/Makefile
index 244807c..693180a 100644
--- a/Makefile
+++ b/Makefile
@@ -37,7 +37,6 @@ endif
 endif
 EMACS ?= emacs
 
-#ENABLE_SMIE = --eval '(setq tuareg-use-smie t)'
 RM ?= rm -f
 CP ?= cp -f
 LN = ln
@@ -45,7 +44,7 @@ DIFF = diff -u -B
 
 INSTALL_RM_R = $(RM) -r
 INSTALL_MKDIR = mkdir -p
-INSTALL_CP = $(CP)
+INSTALL_CP = cp
 
 all elc : $(ELC) tuareg-site-file.el
 



[nongnu] elpa/tuareg 0fe4473 03/10: Improve tuareg.el header

2021-08-27 Thread ELPA Syncer
branch: elpa/tuareg
commit 0fe44737038f907d57da7fc6a16eb892d12c31a5
Author: Christophe Troestler 
Commit: Christophe Troestler 

Improve tuareg.el header
---
 tuareg.el | 6 --
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/tuareg.el b/tuareg.el
index a877e42..ab186e1 100644
--- a/tuareg.el
+++ b/tuareg.el
@@ -11,11 +11,13 @@
 ;;  Till Varoquaux 
 ;;  Sean McLaughlin 
 ;;  Stefan Monnier 
+;; Maintainer: Christophe Troestler 
+;;  Stefan Monnier 
 ;; Created: 8 Jan 1997
 ;; Version: 2.3.0
-;; Package-Requires: ((caml "3.12.0.1") (emacs "24.4"))
+;; Package-Requires: ((emacs "24.4") (caml "4.8") (cl-lib "0.5"))
 ;; Keywords: ocaml languages
-;; URL: https://github.com/ocaml/tuareg
+;; Homepage: https://github.com/ocaml/tuareg
 ;; EmacsWiki: TuaregMode
 
 ;;; Commentary:



[nongnu] elpa/tuareg e98e55d 06/10: Add sample OCaml code to test highlighting

2021-08-27 Thread ELPA Syncer
branch: elpa/tuareg
commit e98e55debc047f04d7301bcb333a2341d18b96ab
Author: Christophe Troestler 
Commit: Christophe Troestler 

Add sample OCaml code to test highlighting
---
 sample_highlight.ml | 313 
 1 file changed, 313 insertions(+)

diff --git a/sample_highlight.ml b/sample_highlight.ml
new file mode 100644
index 000..c3fd5f4
--- /dev/null
+++ b/sample_highlight.ml
@@ -0,0 +1,313 @@
+type 'a t = Int : int t | String : string t
+let trois : type a . a t -> a = f
+
+type a
+type 'a t
+type 'al t
+type 'al'l t
+type +'b u
+type ('a, 'b) t
+type (+'a, 'b) t
+type t =
+  | A
+type t +=
+   | A
+
+type t =
+  { first: A.t; (* and *)
+second: B.t;
+third: C.t }
+
+(* FAIL sprintf (but if one change the line it get well re-highlighted) *)
+(* Probably an effect of [let ...] *)
+let html_date_of_post p =
+  match p.date with
+  | None -> []
+  | Some d ->
+ let date =
+   let open Syndic.Date in
+   let open! Infix in
+   sprintf "%s %02d, %d" (string_of_month(month d)) (day d) (year d) in
+ [`Data date]
+
+let (x: t) = expr
+let (x:t) = expr
+let (x: t list) = exp
+let (x:t list) = 1
+let x : t = expr
+let x, (yyy: t) = 1
+let (x, y) = A.f ()
+let x, y = A.f ()
+let x, y, z = A.f ()
+let (x, y), z = A.f ()
+let (x: y :> u) = 1
+
+let x as y = 1
+let (x,y) as z = (1,2)
+
+let X x = A.f ()
+let X(x) = A.f ()
+let `X x = A.f ()
+let A.X x, A.Y (y:t) = f()
+let A.X x, (`Y y:t) = f()
+let X(x, y) = A.f ()
+let X (x, y) = A.f ()
+let A.X(x, y, z) = A.f ()
+let A.X x = A.f ()
+let x : ('a, 'b) t = A.f ()
+let x = (x : X.t)
+let x = (val X : X.t)
+let m = __MODULE__
+let typecheck ast = ast_starts_with_as
+
+let _ = (x :: not_a_type)
+let _ = (x : 'a t)
+let _ = (x :> t)
+let _ = (let x : t = 1 in x)   (* not a type *)
+let _ = (1 + let x : t = 1 in x)
+let _ = (1 + 1 : int)
+let _ = (z : Map.t)
+let _ = (z x : Map.t)
+let _ = (z x : _ Map.t)
+let _ = (z x : ('a, int) Map.t)
+let _ = {first = x; second = y; third = z}
+
+let () =
+  printf "(v:t) in strings (expected: %g" n; printf ")"
+
+let x = ref 1
+let f x = ignore(x+1)
+let f ref c = 1
+let f (x, (y, z)) = 1
+let (x, (y, z)) = 1
+let ((x, y): t) = 1
+
+let f () = 1
+let f (type t) x = 1
+let f (module M: T) = M.f
+let _ = f (module M)
+let x = A.b
+let z = (compare (x: int) (1 + y: int) : t)
+let f x = A.B.c
+let f x
+  y = 3
+let f = fun x -> 4
+let f = function x -> 1
+let f x y z : t = 2
+let f (x,y) z : t = 2
+let f (x: t) (y: ('a, (a, int)) t) = 2
+let f ~x y = 3
+let f ~x ?(y=2) = 3
+let f (X x) y = 1
+let f = fun (x: int) u (y,z) -> 4
+let f = fun (x: int) u
+(y,z) -> 1
+let f (x: int) u
+  (y,z) = 1
+let f = fun ?(x=y-1) z -> 1
+let f = fun ?(x=true) z -> 1
+let f = fun ?(x=1=1) z -> "two type of '=' in option 'x'"
+let f x = fun u v (u,c) ?(u=v-1) ~(e: int) -> 1
+let f = fun x u->1
+let f u0 ~s:a s = "s: does not introduce a type"
+let f u0 ~s:(a,b) s = "s: does not introduce a type"
+let f x : ret = body
+let f (x) : ret = body
+let f ?x:(y = 1) ?(y = (x: t)) = body
+let f ?x:(y = 1) ?(y = (x: t)) : ret = body
+let f ?x:(y = expr + 1) (y: t) ~z:u : ret = body
+let f ?x:(y = (expr + 1)) (y: t) ?z:t : ret = body
+let x = call ~l:(fun x -> y = z)
+let f {first; second; third} = body
+let f ({first; second; third} as all) = body
+let f a {first; second; third} b = body
+let f a ({first; second; third} as all) b = body
+let f a ({first = x; second = y; third} as all) b = body
+let f a [x; y; z] u = body
+let f (type a) x (type b) y = body
+let f (A(x:t), B x, {z = s; p = Q e}) = body
+let f' u =
+  (* function *)
+  if u.low >= 0. then f'_pos u.low u.high
+let f' u =
+  (* fun *)
+  if u.low >= 0. then f'_pos u.low u.high
+let rec f (A(x:t), B x, {z = s; p = Q e}) = body
+
+(* Labels, type annotations, and operators *)
+let _ =
+  f ~foo:x;
+  (f ~foo:x);
+  (f ~foo:x y);
+  (grault ~garply:(x));
+  let x = 1 + 3 / 2 in
+  I.(1 +:2);
+  I.(1 +: 2);
+  K.(x |+ y ?: z);
+  (expr ~- expr : ty);
+  (expr ~label : ty)
+
+let andfoo = 1.
+let[@x] andfoo = 1.
+and+ andfoo = 2
+let valfoo = 1
+
+let x = 1 [@@@x rzfhjoi[x]]
+let x = 1 [@@x "payload"]
+let z = [%%foo let x = 2 in x + 1]
+let[@foo] x = 2 in x + 1
+let%m[@foo] x = 2 in x + 1
+let _ = begin[@foo][@bar x] ... end
+module[@foo] M = struct end
+type[@foo] t = T
+type%foo[@foo] nonrec t = t
+
+let x = first ;%x second
+let%xx x = 1
+let%xx f x = 1
+let%x f x = 1
+let%foo x = 2 in x + 1
+let x = begin%foo ... end
+val%foo f : t -> t
+val%foo[@bar] f : t -> t
+module%foo Mo = struct end
+module%foo type Mo = struct%loo[@bah] end
+[%%foo module M = struct end ]
+val%foo f : t -> t
+let f = fun%foo x -> x + 1
+let f = fun%foo[@bar] x -> x + 1
+let f = fun[@bar] x -> x + 1
+let f = function%foo[@bar] x -> x + 1
+
+let content = [%html{|some content|}]
+let svgpath = [%svg{||}]
+
+let my_text =
+  [%html
+  {|This is an HTML formated content.|}]
+
+let my_span = Html.(span ~a:[a_class ["mytext"]] my_

[nongnu] elpa/tuareg 742037b 04/10: Update the comment of the code putting 'ocaml error regexp first

2021-08-27 Thread ELPA Syncer
branch: elpa/tuareg
commit 742037bf67903e8eb53b46a9169dc6a3c223e557
Author: Christophe Troestler 
Commit: Christophe Troestler 

Update the comment of the code putting 'ocaml error regexp first
---
 tuareg.el | 14 +++---
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/tuareg.el b/tuareg.el
index ab186e1..14237b5 100644
--- a/tuareg.el
+++ b/tuareg.el
@@ -3230,13 +3230,13 @@ OCaml uses exclusive end-columns but Emacs wants them 
to be inclusive."
 (delq 'ocaml compilation-error-regexp-alist))
   (push 'ocaml compilation-error-regexp-alist)
 
-  (eval-after-load 'caml
-;; caml-mode also changes `compilation-error-regexp-alist' with a
-;; too simple regexp.  Make sure the one above comes first.
-#'(lambda()
-(setq compilation-error-regexp-alist
-  (delete 'ocaml compilation-error-regexp-alist))
-(push 'ocaml compilation-error-regexp-alist
+  (with-eval-after-load 'caml
+;; Older versions of caml-mode also changes
+;; `compilation-error-regexp-alist' with a too simple regexp.
+;; Make sure the one above comes first.
+(setq compilation-error-regexp-alist
+  (delq 'ocaml compilation-error-regexp-alist))
+(push 'ocaml compilation-error-regexp-alist)))
 
 
 ;; Wrapper around next-error.



[nongnu] elpa/tuareg 3e943c3 01/10: Tests commenting: move the `should' outside `let'

2021-08-27 Thread ELPA Syncer
branch: elpa/tuareg
commit 3e943c3b52519c68b7ffcfe6389297c261c2e844
Author: Christophe Troestler 
Commit: Christophe Troestler 

Tests commenting: move the `should' outside `let'

This makes it easier to spot which test fails.
---
 tuareg-tests.el | 37 +
 1 file changed, 21 insertions(+), 16 deletions(-)

diff --git a/tuareg-tests.el b/tuareg-tests.el
index 6c7c523..7118a4b 100644
--- a/tuareg-tests.el
+++ b/tuareg-tests.el
@@ -578,33 +578,38 @@ Return (FILE TYPE START-LINE END-LINE START-COL END-COL)."
 (ert-deftest tuareg-comment-region-style ()
   "Check that commenting out code works as expected. See issue #216."
   ;; Non-indented code.
-  (let ((comment-style 'indent))
-(should (equal (tuareg-test--comment-region
+  (should (let ((comment-style 'indent))
+(equal (tuareg-test--comment-region
 "let f x =\n  g x\ny\n")
"(* let f x = *)\n(*   g x *)\n(* y *)\n")))
-  (let ((comment-style 'multi-line)
-(comment-continue " * "))
-(should (equal (tuareg-test--comment-region
+  (should (let ((comment-style 'multi-line)
+(comment-continue " * "))
+(equal (tuareg-test--comment-region
 "let f x =\n  g x\ny\n")
"(* let f x =\n *   g x\n * y *)\n")))
-  (let ((comment-style 'multi-line)
-(comment-continue "   "))
-(should (equal (tuareg-test--comment-region
+  (should (let ((comment-style 'multi-line))
+;; `comment-continue' should default to " * "
+(equal (tuareg-test--comment-region
+"let f x =\n  g x\ny\n")
+   "(* let f x =\n *   g x\n * y *)\n")))
+  (should (let ((comment-style 'multi-line)
+(comment-continue "   "))
+(equal (tuareg-test--comment-region
 "let f x =\n  g x\ny\n")
"(* let f x =\n g x\n   y *)\n")))
   ;; Indented code.
-  (let ((comment-style 'indent))
-(should (equal (tuareg-test--comment-region
+  (should (let ((comment-style 'indent))
+(equal (tuareg-test--comment-region
 "  epsilon\ntau\n")
"  (* epsilon *)\n  (*   tau *)\n")))
-  (let ((comment-style 'multi-line)
-(comment-continue " * "))
-(should (equal (tuareg-test--comment-region
+  (should (let ((comment-style 'multi-line)
+(comment-continue " * "))
+(equal (tuareg-test--comment-region
 "  epsilon\ntau\n")
"  (* epsilon\n   *   tau *)\n")))
-  (let ((comment-style 'multi-line)
-(comment-continue "   "))
-(should (equal (tuareg-test--comment-region
+  (should (let ((comment-style 'multi-line)
+(comment-continue "   "))
+(equal (tuareg-test--comment-region
 "  epsilon\ntau\n")
"  (* epsilon\n   tau *)\n"
 



[nongnu] elpa/tuareg c55a9db 07/10: Add badges for NonGNU ELPA and Debian

2021-08-27 Thread ELPA Syncer
branch: elpa/tuareg
commit c55a9db98dcdf886ed7f056a4a152dbd3e482330
Author: Christophe Troestler 
Commit: Christophe Troestler 

Add badges for NonGNU ELPA and Debian
---
 README.md | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/README.md b/README.md
index 66010e6..6af97f0 100644
--- a/README.md
+++ b/README.md
@@ -1,4 +1,6 @@
+[![NonGNU 
ELPA](https://elpa.nongnu.org/nongnu/tuareg.svg)](https://elpa.nongnu.org/nongnu/tuareg.html)
 
[![MELPA](https://melpa.org/packages/tuareg-badge.svg)](https://melpa.org/#/tuareg)
+[![DebianBadge](https://badges.debian.net/badges/debian/stable/elpa-tuareg/version.svg)](https://packages.debian.org/stable/elpa-tuareg)
 [![LGPL v2](https://img.shields.io/badge/licence-lgpl2-blue.svg)](COPYING)
 [![Build 
Status](https://travis-ci.org/ocaml/tuareg.svg?branch=master)](https://travis-ci.org/ocaml/tuareg)
 



[nongnu] elpa/tuareg 6357f82 08/10: Update OPAM file

2021-08-27 Thread ELPA Syncer
branch: elpa/tuareg
commit 6357f82236c0588c61952e7ee68da4b8fd33a3b7
Author: Christophe Troestler 
Commit: Christophe Troestler 

Update OPAM file
---
 tuareg.opam | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/tuareg.opam b/tuareg.opam
index 1448987..4b36cbf 100644
--- a/tuareg.opam
+++ b/tuareg.opam
@@ -6,6 +6,7 @@ authors: [
   "Christophe Troestler "
   "Stefan Monnier "
 ]
+license: "GPL-2.0-or-later"
 homepage: "https://github.com/ocaml/tuareg";
 bug-reports: "https://github.com/ocaml/tuareg/issues";
 dev-repo: "git+https://github.com/ocaml/tuareg.git";
@@ -16,7 +17,7 @@ build: [
 ]
 depends: ["ocaml" "conf-emacs"]
 depopts: [
-  "caml-mode" # {>= "4.05"}
+  "caml-mode" {>= "4.9"}
   "merlin"
 ]
 post-messages: [
@@ -27,7 +28,7 @@ post-messages: [
 or \"caml-mode\" (displaying types).  See https://github.com/ocaml/tuareg
 for customization tips."
 ]
-synopsis: "OCaml mode for GNU Emacs and XEmacs."
+synopsis: "OCaml mode for GNU Emacs"
 description: """
 Tuareg handles automatic indentation of OCaml and Camllight codes.
 Key parts of the code are highlighted using Font-Lock.  Support to run



[nongnu] elpa/tuareg 4e0ff99 02/10: Consistently support space-only `comment-continue' on Emacs < 28

2021-08-27 Thread ELPA Syncer
branch: elpa/tuareg
commit 4e0ff99d1350c0dbd9a5ab17719a66e015c1f981
Author: Christophe Troestler 
Commit: Christophe Troestler 

Consistently support space-only `comment-continue' on Emacs < 28

Fixes https://github.com/ocaml/tuareg/issues/216
---
 Makefile |   2 +-
 tuareg-compat.el | 198 +++
 tuareg.el|   2 +-
 3 files changed, 200 insertions(+), 2 deletions(-)

diff --git a/Makefile b/Makefile
index 27c12ef..244807c 100644
--- a/Makefile
+++ b/Makefile
@@ -9,7 +9,7 @@ TARBALL = $(DIST_NAME).tar.gz
 OPAM_FILE = packages/tuareg/tuareg.$(VERSION)/opam
 
 SOURCES = tuareg.el ocamldebug.el tuareg-opam.el \
-  tuareg-menhir.el
+  tuareg-menhir.el tuareg-compat.el
 ELS = $(SOURCES) tuareg-site-file.el
 ELC = $(ELS:.el=.elc)
 
diff --git a/tuareg-compat.el b/tuareg-compat.el
new file mode 100644
index 000..ad7c62f
--- /dev/null
+++ b/tuareg-compat.el
@@ -0,0 +1,198 @@
+;;; tuareg-compat.el  -*- lexical-binding:t -*-
+
+;; FIX: make sure `comment-region' supports `comment-continue' made
+;; only of spaces (and in a consistent fashion even for older Emacs).
+
+(require 'newcomment)
+
+;; Emacs < 26
+
+(defun tuareg--comment-padright--advice (origfn &rest args)
+  (let ((str (nth 0 args)))
+(unless (and (eq major-mode 'tuareg-mode)
+ (stringp str) (not (string-match "\\S-" str)))
+  (apply origfn args
+
+(when (and (< emacs-major-version 26) (fboundp 'comment-region-default))
+  (advice-add 'comment-padright :around #'tuareg--comment-padright--advice))
+
+;; Emacs < 27
+(defun tuareg--comment-region-default (beg end &optional arg)
+  (let* ((numarg (prefix-numeric-value arg))
+(style (cdr (assoc comment-style comment-styles)))
+(lines (nth 2 style))
+(block (nth 1 style))
+(multi (nth 0 style)))
+
+;; We use `chars' instead of `syntax' because `\n' might be
+;; of end-comment syntax rather than of whitespace syntax.
+;; sanitize BEG and END
+(goto-char beg) (skip-chars-forward " \t\n\r") (beginning-of-line)
+(setq beg (max beg (point)))
+(goto-char end) (skip-chars-backward " \t\n\r") (end-of-line)
+(setq end (min end (point)))
+(if (>= beg end) (error "Nothing to comment"))
+
+;; sanitize LINES
+(setq lines
+ (and
+  lines ;; multi
+  (progn (goto-char beg) (beginning-of-line)
+ (skip-syntax-forward " ")
+ (>= (point) beg))
+  (progn (goto-char end) (end-of-line) (skip-syntax-backward " ")
+ (<= (point) end))
+  (or block (not (string= "" comment-end)))
+   (or block (progn (goto-char beg) (re-search-forward "$" end t)
+
+;; don't add end-markers just because the user asked for `block'
+(unless (or lines (string= "" comment-end)) (setq block nil))
+
+(cond
+ ((consp arg) (uncomment-region beg end))
+ ((< numarg 0) (uncomment-region beg end (- numarg)))
+ (t
+  (let ((multi-char (/= (string-match "[ \t]*\\'" comment-start) 1))
+   indent triple)
+   (if (eq (nth 3 style) 'multi-char)
+   (save-excursion
+ (goto-char beg)
+ (setq indent multi-char
+   ;; Triple if we will put the comment starter at the margin
+   ;; and the first line of the region isn't indented
+   ;; at least two spaces.
+   triple (and (not multi-char) (looking-at "\t\\|  "
+ (setq indent (nth 3 style)))
+
+   ;; In Lisp and similar modes with one-character comment starters,
+   ;; double it by default if `comment-add' says so.
+   ;; If it isn't indented, triple it.
+   (if (and (null arg) (not multi-char))
+   (setq numarg (* comment-add (if triple 2 1)))
+ (setq numarg (1- (prefix-numeric-value arg
+
+   (comment-region-internal
+beg end
+(let ((s (comment-padright comment-start numarg)))
+  (if (string-match comment-start-skip s) s
+(comment-padright comment-start)))
+(let ((s (comment-padleft comment-end numarg)))
+  (and s (if (string-match comment-end-skip s) s
+   (comment-padright comment-end
+(if multi (or (comment-padright comment-continue numarg)
+   (and (stringp comment-continue) comment-continue)))
+(if multi
+(comment-padleft (comment-string-reverse comment-continue) numarg))
+block
+lines
+indent))
+
+(defun tuareg--comment-region-default--advice (origfn &rest args)
+  (apply (if (eq major-mode 'tuareg-mode)
+ 'tuareg--comment-region-default
+   origfn)
+ args))
+
+(when (and (< emacs-major-version 27) (fboundp 'comment-region-default))
+  (advice-add 'comment-region-default :around
+  #'tuareg--comment-region-default--advice))
+
+
+;; Emacs 27
+(defun tuareg--comm

[nongnu] elpa/tuareg de7e6c4 09/10: Use the default commenting style & explain how to customize this

2021-08-27 Thread ELPA Syncer
branch: elpa/tuareg
commit de7e6c43e13bac897b25b89980dda775222b3b0a
Author: Christophe Troestler 
Commit: Christophe Troestler 

Use the default commenting style & explain how to customize this

Fixes https://github.com/ocaml/tuareg/issues/238
---
 README.md | 11 +++
 tuareg.el |  1 -
 2 files changed, 11 insertions(+), 1 deletion(-)

diff --git a/README.md b/README.md
index 6af97f0..392ce8e 100644
--- a/README.md
+++ b/README.md
@@ -128,6 +128,17 @@ Tips & customization
 
   [electric-indent-mode]: 
https://www.gnu.org/software/emacs/manual/html_node/emacs/Indent-Convenience.html
 
+- Tuareg respects you default commenting style.  However, in OCaml,
+  commenting a region is usually done with a single multi-line comment
+  and without leading stars on each line.  You can have that behavior
+  in OCaml buffers by setting:
+
+(add-hook 'tuareg-mode-hook
+  (lambda()
+(setq-local comment-style 'multi-line)
+(setq-local comment-continue "   ")))
+
+
 - Syntax highlighting has 3 levels.  You can select the one you prefer
   by setting [font-lock-maximum-decoration][] from `0` to `2`.  By
   default, [font-lock-maximum-decoration][] is set to `t` which
diff --git a/tuareg.el b/tuareg.el
index 14237b5..f346bdd 100644
--- a/tuareg.el
+++ b/tuareg.el
@@ -3147,7 +3147,6 @@ Short cuts for interactions with the REPL:
 (setq-local comment-start "(* ")
 (setq-local comment-end " *)")
 (setq-local comment-start-skip "(\\*+[ \t]*")
-(setq-local comment-style 'multi-line)
 ;; `ocamlc' counts columns from 0, contrary to other tools which start at 
1.
 (setq-local compilation-first-column 0)
 (setq-local compilation-error-screen-columns nil)



[nongnu] elpa/tuareg f6801c8 10/10: Update Tuareg header

2021-08-27 Thread ELPA Syncer
branch: elpa/tuareg
commit f6801c86e921949a4a1bb9088bf85b36a9cd890d
Author: Christophe Troestler 
Commit: Christophe Troestler 

Update Tuareg header
---
 tuareg.el | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tuareg.el b/tuareg.el
index f346bdd..5e5c39c 100644
--- a/tuareg.el
+++ b/tuareg.el
@@ -21,12 +21,12 @@
 ;; EmacsWiki: TuaregMode
 
 ;;; Commentary:
-;; Description:
 ;; Tuareg helps editing OCaml code, to highlight important parts of
 ;; the code, to run an OCaml REPL, and to run the OCaml debugger
 ;; within Emacs.
+;; See https://github.com/ocaml/tuareg for customization tips.
 
-;; Installation:
+;;; Installation:
 ;; If you have permissions to the local `site-lisp' directory, you
 ;; only have to copy `tuareg.el', `ocamldebug.el'
 ;; and `tuareg-site-file.el'.  Otherwise, copy the previous files



[elpa] main 63a454c: * elpa-packages (taxy): New package

2021-08-27 Thread monnier--- via
branch: main
commit 63a454ca9769048f2a69baaceef8353e6f430e5b
Author: Stefan Monnier 
Commit: Stefan Monnier 

* elpa-packages (taxy): New package
---
 elpa-packages | 5 -
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/elpa-packages b/elpa-packages
index 8eab656..915cce7 100644
--- a/elpa-packages
+++ b/elpa-packages
@@ -106,7 +106,6 @@
  ("cpio-mode"  :url "https://github.com/dlewan/cpio-mode";)
  ("crisp"  :url nil)
  ;; ("crossword"   :url 
"https://github.com/Boruch-Baum/emacs-crossword";)
- ;; ("csharp-mode" :url 
"https://github.com/emacs-csharp/csharp-mode";)
  ("csharp-mode":url 
"https://github.com/emacs-csharp/csharp-mode";
   :readme "README.org"
   :auto-sync t)
@@ -193,6 +192,8 @@
  ("hyperbole"   :url "https://git.savannah.gnu.org/r/hyperbole.git";
   :make ("kotl/kotl-autoloads.el")
   :auto-sync t)
+ ;; ("infix-notation-calculator"
+ ;;  :url "https://github.com/cjohansson/emacs-infix-notation-calculator";)
  ("ioccur" :url "https://github.com/thierryvolpiatto/ioccur.git";)
  ("isearch-mb" :url "https://github.com/astoff/isearch-mb";
   :auto-sync t)
@@ -363,6 +364,8 @@
  ("swiper" :url "https://github.com/abo-abo/swiper";)
  ("system-packages":url "https://gitlab.com/jabranham/system-packages";)
  ("systemd":url nil)
+ ("taxy":url "https://github.com/alphapapa/taxy.el.git";
+  :auto-sync t)
  ("temp-buffer-browse"  :url "https://github.com/leoliu/temp-buffer-browse";)
  ("test-simple" :url "https://github.com/rocky/emacs-test-simple";)
  ("timerfunctions" :url nil)



[elpa] branch externals/taxy created (now 2c044ed)

2021-08-27 Thread ELPA Syncer
elpasync pushed a change to branch externals/taxy.

at  2c044ed   Add: (taxy-take-keyed*) :then, and examples

This branch includes the following new commits:

   new  dbad5b9   Let there be taxonomy!
   new  8797141   Dynamic, consuming, and non-consuming
   new  657823b   Docs: Tidy example
   new  01e956a   Rename function
   new  a94ab1c   Tidy
   new  f115919   Add: taxy-copy and reverse args to taxy-fill
   new  6c5b7c7   Add: taxy-apply
   new  751e9d7   Show reusable taxys
   new  408a32b   Docs: Tidy
   new  09724dd   Add: taxy-take-keyed
   new  02217c4   Docs: Add comments
   new  c60a96f   Change: Rename taxy-simple
   new  9d44dba   Change: taxy-apply -> taxy-map
   new  d355d3a   Docs: Add mascot
   new  1699d3a   Docs: Clarify
   new  0dce844   Docs: Add example of incremental filling
   new  0a57638   Docs: Mention threading macros
   new  6eff6ae   Docs: Put Contents first
   new  524b151   Tidy: (taxy-fill)
   new  aa0fe08   Change: taxy-copy -> taxy-emptied
   new  3b253a6   Tidy: (taxy-fill) Argument order in labeled function
   new  21e6fa6   Docs: Commentary, header
   new  34aa94d   Add: taxy-magit-section
   new  bd28836   Meta: Headers
   new  3cf0d46   Docs: Export Info manual
   new  e56ae33   Meta: .gitignore
   new  fcc780f   Add: (taxy-take-keyed*)
   new  4e132ab   Docs: Tidy
   new  f5458d0   Change: taxy-map -> taxy-mapcar
   new  906d387   Fix: (taxy-magit-section-pp) Use magit-section-mode
   new  15eb9b7   Docs: Tidy
   new  e09dc38   Add: (taxy-mapc*) And musicy.el example
   new  35c8f61   Add: (taxy-magit-section-indent)
   new  f0b926f   Add: Diredy example
   new  a17e540   Docs: Show examples
   new  4686e03   Add: (taxy-size)
   new  a7ffe21   Change: (diredy) Sort taxys
   new  5a1b055   Docs: Add magit-loggy example
   new  2c044ed   Add: (taxy-take-keyed*) :then, and examples




[elpa] externals/taxy 01e956a 04/39: Rename function

2021-08-27 Thread ELPA Syncer
branch: externals/taxy
commit 01e956ae903ac7e678dcfc7ad361e8ac86707fd2
Author: Adam Porter 
Commit: Adam Porter 

Rename function
---
 README.org | 10 +-
 taxy.el|  2 +-
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/README.org b/README.org
index e19cdb6..b1c46a6 100644
--- a/README.org
+++ b/README.org
@@ -70,10 +70,10 @@ You might think about how to produce that by writing some 
imperative code, but =
 :predicate (lambda (n) (zerop 
(mod n 5)))
 :then #'identity))
 (numbers (cl-loop for i below 100 collect i)))
-(taxy-simple (taxy-apply numbery (reverse numbers
+(taxy-simple (taxy-fill numbery (reverse numbers
 #+END_SRC
 
-The ~taxy-apply~ function applies the numbers in a "cascade" down the 
hierarchy of "taxys", and the ~taxy-simple~ function returns a meaningful 
subset of the taxys' slots, suitable for display.
+The ~taxy-fill~ function applies the numbers in a "cascade" down the hierarchy 
of "taxys", and the ~taxy-simple~ function returns a meaningful subset of the 
taxys' slots, suitable for display.
 
 * Contents :noexport:
 :PROPERTIES:
@@ -125,11 +125,11 @@ A taxy is defined with the ~make-taxy~ constructor, like:
  :taxys (list ...))
 #+END_SRC
 
-The ~:predicate~ function determines whether an object fits into that taxy.  
If it does, ~taxy-apply~ adds the object to that taxy's descendant ~:taxys~, if 
present, or to its own ~objects~.  The function defaults to ~identity~, so a 
taxy "takes in" any object by default (i.e. if you only apply objects you want 
to classify, there's no need to test them at the top-level taxy).
+The ~:predicate~ function determines whether an object fits into that taxy.  
If it does, ~taxy-fill~ adds the object to that taxy's descendant ~:taxys~, if 
present, or to its own ~objects~.  The function defaults to ~identity~, so a 
taxy "takes in" any object by default (i.e. if you only apply objects you want 
to classify, there's no need to test them at the top-level taxy).
 
 The ~:then~ function determines what happens to an object after being taken 
in: if the function, called with the object, returns a non-nil value, that 
value is applied to other taxys at the same level until one of their ~:then~ 
functions returns nil or no more taxys remain.  The function defaults to 
~ignore~, which makes a taxy "consume" its objects by default.  Setting the 
function to, e.g. ~identity~, makes it not consume them, leaving them eligible 
to also be taken into subsequent tax [...]
 
-After defining a taxy, call ~taxy-apply~ with it and a list of objects to fill 
the taxy's hierarchy.
+After defining a taxy, call ~taxy-fill~ with it and a list of objects to fill 
the taxy's hierarchy.
 
 To return a taxy in a more human-readable format (with only relevant fields 
included), use ~taxy-simple~.
 
@@ -160,7 +160,7 @@ You may not always know in advance what taxonomy a set of 
objects fits into, so
  (equal key 
(funcall key-fn buffer
(taxy-taxys taxy))
   (push buffer (taxy-objects key-taxy)
-(taxy-simple (taxy-apply buffery (buffer-list
+(taxy-simple (taxy-fill buffery (buffer-list
 #+END_SRC
 
 Which produces this taxonomy of buffers:
diff --git a/taxy.el b/taxy.el
index 0070f27..0d956dc 100644
--- a/taxy.el
+++ b/taxy.el
@@ -46,7 +46,7 @@
 
  Functions
 
-(defun taxy-apply (taxy objects)
+(defun taxy-fill (taxy objects)
   (cl-labels ((apply-object (taxy object)
 (cl-loop with taken
  for taxy in (taxy-taxys taxy)



[elpa] externals/taxy dbad5b9 01/39: Let there be taxonomy!

2021-08-27 Thread ELPA Syncer
branch: externals/taxy
commit dbad5b9b60ebc9fe473acf22a052d923162108a3
Author: Adam Porter 
Commit: Adam Porter 

Let there be taxonomy!
---
 LICENSE| 674 +
 README.org | 166 +++
 taxy.el|  72 +++
 3 files changed, 912 insertions(+)

diff --git a/LICENSE b/LICENSE
new file mode 100644
index 000..94a9ed0
--- /dev/null
+++ b/LICENSE
@@ -0,0 +1,674 @@
+GNU GENERAL PUBLIC LICENSE
+   Version 3, 29 June 2007
+
+ Copyright (C) 2007 Free Software Foundation, Inc. 
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+Preamble
+
+  The GNU General Public License is a free, copyleft license for
+software and other kinds of works.
+
+  The licenses for most software and other practical works are designed
+to take away your freedom to share and change the works.  By contrast,
+the GNU General Public License is intended to guarantee your freedom to
+share and change all versions of a program--to make sure it remains free
+software for all its users.  We, the Free Software Foundation, use the
+GNU General Public License for most of our software; it applies also to
+any other work released this way by its authors.  You can apply it to
+your programs, too.
+
+  When we speak of free software, we are referring to freedom, not
+price.  Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+them if you wish), that you receive source code or can get it if you
+want it, that you can change the software or use pieces of it in new
+free programs, and that you know you can do these things.
+
+  To protect your rights, we need to prevent others from denying you
+these rights or asking you to surrender the rights.  Therefore, you have
+certain responsibilities if you distribute copies of the software, or if
+you modify it: responsibilities to respect the freedom of others.
+
+  For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must pass on to the recipients the same
+freedoms that you received.  You must make sure that they, too, receive
+or can get the source code.  And you must show them these terms so they
+know their rights.
+
+  Developers that use the GNU GPL protect your rights with two steps:
+(1) assert copyright on the software, and (2) offer you this License
+giving you legal permission to copy, distribute and/or modify it.
+
+  For the developers' and authors' protection, the GPL clearly explains
+that there is no warranty for this free software.  For both users' and
+authors' sake, the GPL requires that modified versions be marked as
+changed, so that their problems will not be attributed erroneously to
+authors of previous versions.
+
+  Some devices are designed to deny users access to install or run
+modified versions of the software inside them, although the manufacturer
+can do so.  This is fundamentally incompatible with the aim of
+protecting users' freedom to change the software.  The systematic
+pattern of such abuse occurs in the area of products for individuals to
+use, which is precisely where it is most unacceptable.  Therefore, we
+have designed this version of the GPL to prohibit the practice for those
+products.  If such problems arise substantially in other domains, we
+stand ready to extend this provision to those domains in future versions
+of the GPL, as needed to protect the freedom of users.
+
+  Finally, every program is threatened constantly by software patents.
+States should not allow patents to restrict development and use of
+software on general-purpose computers, but in those that do, we wish to
+avoid the special danger that patents applied to a free program could
+make it effectively proprietary.  To prevent this, the GPL assures that
+patents cannot be used to render the program non-free.
+
+  The precise terms and conditions for copying, distribution and
+modification follow.
+
+   TERMS AND CONDITIONS
+
+  0. Definitions.
+
+  "This License" refers to version 3 of the GNU General Public License.
+
+  "Copyright" also means copyright-like laws that apply to other kinds of
+works, such as semiconductor masks.
+
+  "The Program" refers to any copyrightable work licensed under this
+License.  Each licensee is addressed as "you".  "Licensees" and
+"recipients" may be individuals or organizations.
+
+  To "modify" a work means to copy from or adapt all or part of the work
+in a fashion requiring copyright permission, other than the making of an
+exact copy.  The resulting work is called a "modified version" of the
+earlier work or a work "based on" the earlier work.
+
+  A "covered work" means either the unmodified Program or a work based
+on the Program.
+
+  To "propagate" a work means to do anything with

[elpa] externals/taxy 751e9d7 08/39: Show reusable taxys

2021-08-27 Thread ELPA Syncer
branch: externals/taxy
commit 751e9d7dc23746e0fc3aed73de2f2ef378bac7b2
Author: Adam Porter 
Commit: Adam Porter 

Show reusable taxys
---
 README.org | 109 -
 taxy.el|   1 +
 2 files changed, 102 insertions(+), 8 deletions(-)

diff --git a/README.org b/README.org
index 0ccb801..1471b5d 100644
--- a/README.org
+++ b/README.org
@@ -8,7 +8,7 @@
 
 This library provides a way to programmably categorize arbitrary objects into 
a hierarchical taxonomy.  (That's a lot of fancy words to say that this lets 
you put things in groups.)
 
-* Examples
+* Example
 
 This is a silly taxonomy of numbers below 100:
 
@@ -80,12 +80,12 @@ The ~taxy-fill~ function applies the numbers in a "cascade" 
down the hierarchy o
 :TOC:  :include siblings
 :END:
 :CONTENTS:
-  -  [[#installation][Installation]]
-  -  [[#usage][Usage]]
-  -  [[#changelog][Changelog]]
-  -  [[#credits][Credits]]
-  -  [[#development][Development]]
-  -  [[#license][License]]
+- [[#usage][Usage]]
+  - [[#dynamic-taxys][Dynamic taxys]]
+  - [[#reusable-taxys][Reusable taxys]]
+- [[#changelog][Changelog]]
+- [[#development][Development]]
+- [[#license][License]]
 :END:
 
 # * Installation
@@ -112,7 +112,11 @@ The ~taxy-fill~ function applies the numbers in a 
"cascade" down the hierarchy o
 
 * Usage
 :PROPERTIES:
-:TOC:  :depth 0
+:TOC:  :include descendants :depth 1
+:END:
+:CONTENTS:
+- [[#dynamic-taxys][Dynamic taxys]]
+- [[#reusable-taxys][Reusable taxys]]
 :END:
 
 A taxy is defined with the ~make-taxy~ constructor, like:
@@ -203,6 +207,95 @@ Which produces this taxonomy of buffers:
 # 
 # + You can customize settings in the =taxy= group.
 
+** Reusable taxys
+
+Since taxys are structs, they may be stored in variables and used in other 
structs (being sure to copy the root taxy with ~taxy-copy~ before filling).  
For example, this shows using =taxy= to classify Matrix rooms in 
[[https://github.com/alphapapa/ement.el][Ement.el]]:
+
+#+BEGIN_SRC elisp
+  (defun ement-roomy-buffer (room)
+(alist-get 'buffer (ement-room-local room)))
+
+  (defvar ement-roomy-unread
+(make-taxy :name "Unread"
+   :predicate (lambda (room)
+(buffer-modified-p (ement-roomy-buffer room)
+
+  (defvar ement-roomy-opened
+(make-taxy :name "Opened"
+   :description "Rooms with buffers"
+   :predicate #'ement-roomy-buffer
+   :taxys (list ement-roomy-unread
+(make-taxy
+
+  (defvar ement-roomy-closed
+(make-taxy :name "Closed"
+   :description "Rooms without buffers"
+   :predicate (lambda (room)
+(not (ement-roomy-buffer room)
+
+  (defvar ement-roomy
+(make-taxy
+ :name "Ement Rooms"
+ :taxys (list (make-taxy
+   :name "Direct"
+   :description "Direct messaging rooms"
+   :predicate (lambda (room)
+(ement-room--direct-p room ement-session))
+   :taxys (list ement-roomy-opened
+ement-roomy-closed))
+  (make-taxy
+   :name "Non-direct"
+   :description "Group chat rooms"
+   :taxys (list ement-roomy-opened
+ement-roomy-closed)
+#+END_SRC
+
+Note how the taxys defined in the first three variables are used in subsequent 
taxys.  As well, the ~ement-roomy-opened~ taxy has an "anonymous" taxy, which 
collects any rooms that aren't collected by its sibling taxy (otherwise those 
objects would be collected into the parent, "Opened" taxy, which may not always 
be the most useful way to present the objects).
+
+Using those defined taxys, we then fill the ~ement-roomy~ taxy with all of the 
rooms in the user's session, and then use ~taxy-apply~ to replace the room 
structs with useful representations for display:
+
+#+BEGIN_SRC elisp
+  (let ((ement-session (alist-get "@USER:HOST" ement-sessions nil nil 
#'equal)))
+(taxy-simple
+ (taxy-apply (lambda (room)
+   (setf room (list (ement-room--room-display-name room)
+(ement-room-id room
+   (taxy-fill (ement-session-rooms ement-session)
+  (taxy-copy ement-roomy)
+#+END_SRC
+
+This produces:
+
+#+BEGIN_SRC elisp
+  ("Ement Rooms"
+   (("Direct" "Direct messaging rooms"
+ (("Opened" "Rooms with buffers"
+   (("Unread"
+ (("Lars Ingebrigtsen" "!nope:gnus.org")
+  ("Closed" "Rooms without buffers"
+   (("John Wiegley" "!not-really:newartisans.com")
+("Eli Zaretskii" "!im-afraid-not:gnu.org")
+("Non-direct" "Group chat rooms"
+ (("Opened" "Rooms with buffers"
+   (("Unread"
+ (("Emacs" "!WfZsmtnxbxTdoYPkaT:greyface.org")
+  ("#emacs" "!KuaCUVGoCiunYyKEpm:libera.chat")))
+;; The non-unread

[elpa] externals/taxy 09724dd 10/39: Add: taxy-take-keyed

2021-08-27 Thread ELPA Syncer
branch: externals/taxy
commit 09724dd73010a3ef1e799f20c6fe6daf121eb153
Author: Adam Porter 
Commit: Adam Porter 

Add: taxy-take-keyed
---
 README.org | 17 ++---
 taxy.el| 19 +++
 2 files changed, 21 insertions(+), 15 deletions(-)

diff --git a/README.org b/README.org
index e3784ab..b4b07c2 100644
--- a/README.org
+++ b/README.org
@@ -151,20 +151,7 @@ You may not always know in advance what taxonomy a set of 
objects fits into, so
  :taxys (list
  (make-taxy
   :name "Modes"
-  :take (lambda (buffer taxy)
-  (let* ((key (buffery-major-mode buffer))
- (key-taxy
-  (or (cl-find-if (lambda (taxy-key)
-(equal key taxy-key))
-  (taxy-taxys taxy)
-  :key #'taxy-key)
-  (car
-   (push (make-taxy
-  :name key :key key
-  :predicate (lambda (buffer)
-   (equal key 
(buffery-major-mode buffer
- (taxy-taxys taxy))
-(push buffer (taxy-objects key-taxy
+  :take (apply-partially #'taxy-take-keyed 
#'buffery-major-mode)
 
   ;; Note the use of `taxy-copy' to avoid mutating the original taxy 
definition.
   (taxy-simple
@@ -172,7 +159,7 @@ You may not always know in advance what taxonomy a set of 
objects fits into, so
   (taxy-copy buffery)))
 #+END_SRC
 
-Which produces this taxonomy of buffers:
+The taxy's ~:take~ function is set to the ~taxy-take-keyed~ function, 
partially applied with the ~buffery-major-mode~ function as its ~key-fn~ 
(~taxy-fill~ supplies the buffer and the taxy as arguments), and it produces 
this taxonomy of buffers:
 
 #+BEGIN_SRC elisp
   ("Buffers"
diff --git a/taxy.el b/taxy.el
index 621e0fd..7aafb88 100644
--- a/taxy.el
+++ b/taxy.el
@@ -95,6 +95,25 @@ useful form after classification."
collect (taxy-apply fn taxy)))
   taxy)
 
+(cl-defun taxy-take-keyed (key-fn object taxy &key (key-name-fn #'identity))
+  "Take OBJECT into TAXY, adding new taxys dynamically.
+Places OBJECT into a taxy in TAXY for the value returned by
+KEY-FN called with OBJECT.  The new taxy's name is that returned
+by KEY-NAME-FN called with OBJECT."
+  (let* ((key (funcall key-fn object))
+ (key-taxy
+  (or (cl-find-if (lambda (taxy-key)
+(equal key taxy-key))
+  (taxy-taxys taxy)
+  :key #'taxy-key)
+  (car
+   (push (make-taxy
+  :name (funcall key-name-fn key) :key key
+  :predicate (lambda (object)
+   (equal key (funcall key-fn object
+ (taxy-taxys taxy))
+(push object (taxy-objects key-taxy
+
  Footer
 
 (provide 'taxy)



[elpa] externals/taxy 657823b 03/39: Docs: Tidy example

2021-08-27 Thread ELPA Syncer
branch: externals/taxy
commit 657823b141dc5e12dbd270e156757cd60a10ff51
Author: Adam Porter 
Commit: Adam Porter 

Docs: Tidy example
---
 README.org | 15 +--
 1 file changed, 5 insertions(+), 10 deletions(-)

diff --git a/README.org b/README.org
index ea7d72f..e19cdb6 100644
--- a/README.org
+++ b/README.org
@@ -44,24 +44,19 @@ You might think about how to produce that by writing some 
imperative code, but =
  (make-taxy
   :name "Numbery"
   :description "A silly taxonomy of numbers."
-  :predicate #'numberp
-  :then #'ignore
   :taxys (list (make-taxy
 :name "< 10"
-:description "Numbers below 10"
+:description "Numbers below 10 (consuming)"
 :predicate (lambda (n) (< n 10))
-:then #'ignore
 :taxys (list (make-taxy :name "Odd (consuming)"
-:predicate #'oddp
-:then #'ignore)
+:predicate #'oddp)
  (make-taxy :name "Even (non-consuming)"
 :predicate #'evenp
 :then #'identity)))
(make-taxy
 :name ">= 10"
-:description "Numbers above 9"
+:description "Numbers above 9 (consuming)"
 :predicate (lambda (n) (>= n 10))
-:then #'ignore
 :taxys (list (make-taxy :name "Divisible by 3 
(non-consuming)"
 :predicate (lambda (n) (zerop 
(mod n 3)))
 :then #'identity)
@@ -130,9 +125,9 @@ A taxy is defined with the ~make-taxy~ constructor, like:
  :taxys (list ...))
 #+END_SRC
 
-The ~:predicate~ function determines whether an object fits into that taxy.  
If it does, ~taxy-apply~ adds the object to that taxy's descendant ~:taxys~, if 
present, or to its own ~objects~.
+The ~:predicate~ function determines whether an object fits into that taxy.  
If it does, ~taxy-apply~ adds the object to that taxy's descendant ~:taxys~, if 
present, or to its own ~objects~.  The function defaults to ~identity~, so a 
taxy "takes in" any object by default (i.e. if you only apply objects you want 
to classify, there's no need to test them at the top-level taxy).
 
-The ~:then~ function determines what happens to an object after being applied: 
if the function, called with the object, returns a non-nil value, that value is 
applied to other taxys at the same level until one of them returns nil or no 
more taxys remain.
+The ~:then~ function determines what happens to an object after being taken 
in: if the function, called with the object, returns a non-nil value, that 
value is applied to other taxys at the same level until one of their ~:then~ 
functions returns nil or no more taxys remain.  The function defaults to 
~ignore~, which makes a taxy "consume" its objects by default.  Setting the 
function to, e.g. ~identity~, makes it not consume them, leaving them eligible 
to also be taken into subsequent tax [...]
 
 After defining a taxy, call ~taxy-apply~ with it and a list of objects to fill 
the taxy's hierarchy.
 



[elpa] externals/taxy 8797141 02/39: Dynamic, consuming, and non-consuming

2021-08-27 Thread ELPA Syncer
branch: externals/taxy
commit 8797141334f03dd02dc5d9fe1f7f679491da3d8d
Author: Adam Porter 
Commit: Adam Porter 

Dynamic, consuming, and non-consuming

Squashed commit of the following:

commit 3f2d7ee535a74518ebc04fa7da751d72698c6c13
Author: Adam Porter 
Date:   Wed Aug 25 06:17:31 2021 -0500

WIP: Dynamic, consuming, and non-consuming

commit 41209b371ee98e12a0939264f293cd1a8652c401
Author: Adam Porter 
Date:   Wed Aug 25 05:18:25 2021 -0500

WIP: Dynamic taxys
---
 README.org | 145 -
 taxy.el|  30 -
 2 files changed, 125 insertions(+), 50 deletions(-)

diff --git a/README.org b/README.org
index 279e27e..ea7d72f 100644
--- a/README.org
+++ b/README.org
@@ -15,22 +15,24 @@ This is a silly taxonomy of numbers below 100:
 #+BEGIN_SRC elisp
   ("Numbery" "A silly taxonomy of numbers."
(("< 10" "Numbers below 10"
- (("Odd"
+ (0 2 4 6 8)
+ (("Odd (consuming)"
(1 3 5 7 9))
-  ("Even"
+  ("Even (non-consuming)"
(0 2 4 6 8
-("> 10" "Numbers above 9"
- (("Divisible by 3"
+(">= 10" "Numbers above 9"
+ (10 11 13 14 17 19 22 23 25 26 29 31 34 35 37 38 41 43 46 47 49 50 53 55 
58
+ 59 61 62 65 67 70 71 73 74 77 79 82 83 85 86 89 91 94 95 97 98)
+ (("Divisible by 3 (non-consuming)"
(12 15 18 21 24 27 30 33 36 39 42 45 48 51 54 57 60 63 66 69 72 75 78 
81 84
87 90 93 96 99))
-  ("Divisible by 4"
+  ("Divisible by 4 (non-consuming)"
(12 16 20 24 28 32 36 40 44 48 52 56 60 64 68 72 76 80 84 88 92 96))
-  ("Divisible by 3 or 4"
+  ("Divisible by 3 or 4 (consuming)"
(12 15 16 18 20 21 24 27 28 30 32 33 36 39 40 42 44 45 48 51 52 54 56 
57 60
63 64 66 68 69 72 75 76 78 80 81 84 87 88 90 92 93 96 99))
-  ("Not divisible by 3 or 4"
-   (10 11 13 14 17 19 22 23 25 26 29 31 34 35 37 38 41 43 46 47 49 50 53 
55 58
-   59 61 62 65 67 70 71 73 74 77 79 82 83 85 86 89 91 94 95 97 98))
+  ("Divisible by 5 (non-consuming)"
+   (10 25 35 50 55 65 70 85 95))
 #+END_SRC
 
 You might think about how to produce that by writing some imperative code, but 
=taxy= allows you to do so in a more declarative and functional manner:
@@ -39,37 +41,39 @@ You might think about how to produce that by writing some 
imperative code, but =
   (require 'taxy)
 
   (let ((numbery
- (make-taxy :name "Numbery"
-:description "A silly taxonomy of numbers."
-:predicate #'numberp
-:then #'ignore
-:taxys (list (make-taxy :name "< 10"
-:description "Numbers below 10"
-:predicate (lambda (n) (< n 10))
-:then #'ignore
-:taxys (list (make-taxy :name "Odd"
-:predicate 
#'oddp
-:then 
#'ignore)
- (make-taxy :name 
"Even"
-:predicate 
#'evenp
-:then 
#'ignore)))
- (make-taxy :name "> 10"
-:description "Numbers above 9"
-:predicate (lambda (n) (>= n 10))
-:then #'ignore
-:taxys (list (make-taxy :name 
"Divisible by 3"
-:predicate 
(lambda (n) (zerop (mod n 3)))
-:then 
#'identity)
- (make-taxy :name 
"Divisible by 4"
-:predicate 
(lambda (n) (zerop (mod n 4)))
-:then 
#'identity)
- (make-taxy :name 
"Divisible by 3 or 4"
-:predicate 
(lambda (n) (or (zerop (mod n 3))
-   
(zerop (mod n 4
-:then 
#'ignore)
- (make-taxy :name "Not 
divisible by 3 or 4"
-:predicate 
#'identity
-:then 
#'igno

[elpa] externals/taxy 6eff6ae 18/39: Docs: Put Contents first

2021-08-27 Thread ELPA Syncer
branch: externals/taxy
commit 6eff6aedc78da4bd9f56ddb53b25b2740f2c74af
Author: Adam Porter 
Commit: Adam Porter 

Docs: Put Contents first
---
 README.org | 79 +-
 1 file changed, 42 insertions(+), 37 deletions(-)

diff --git a/README.org b/README.org
index eda2f33..eca198c 100644
--- a/README.org
+++ b/README.org
@@ -8,6 +8,8 @@
 
 # 
[[https://melpa.org/#/package-name][file:https://melpa.org/packages/taxy-badge.svg]]
 
[[https://stable.melpa.org/#/package-name][file:https://stable.melpa.org/packages/taxy-badge.svg]]
 
+/Now, where did I put that.../
+
 This library provides a programmable way to classify arbitrary objects into a 
hierarchical taxonomy.  (That's a lot of fancy words to say that this lets you 
put things in nested groups.)
 
 Helpful features include:
@@ -15,9 +17,45 @@ Helpful features include:
 +  Dynamic taxonomies :: Objects may be classified into hierarchies 
automatically defined at runtime based on their attributes.
 +  Reusable taxonomies :: Taxonomy definitions may be stored in variables and 
reused in other taxonomies' descendant groups.
 
+* Contents :noexport:
+:PROPERTIES:
+:TOC:  :include siblings
+:END:
+:CONTENTS:
+- [[#examples][Examples]]
+- [[#usage][Usage]]
+  - [[#dynamic-taxys][Dynamic taxys]]
+  - [[#reusable-taxys][Reusable taxys]]
+  - [[#threading-macros][Threading macros]]
+- [[#changelog][Changelog]]
+- [[#development][Development]]
+:END:
+
+# * Installation
+# :PROPERTIES:
+# :TOC:  :depth 0
+# :END:
+# 
+# ** MELPA
+# 
+# If you installed from MELPA, you're done.  Just run one of the commands 
below.
+# 
+# ** Manual
+# 
+#   Install these required packages:
+# 
+#   + =foo=
+#   + =bar=
+# 
+#   Then put this file in your load-path, and put this in your init file:
+# 
+#   #+BEGIN_SRC elisp
+# (require 'taxy)
+#   #+END_SRC
+
 * Examples
 
-Let's make a silly taxonomy of numbers below 100:
+Let's imagine a silly taxonomy of numbers below 100:
 
 #+BEGIN_SRC elisp
   ("Numbery" "A silly taxonomy of numbers."
@@ -171,42 +209,6 @@ That's better:
  ("B" "C" "D" "F" "G" "H" "J" "K" "L" "M" "N" "N" "P" "Q" "R" "S" "T" "V" 
"W" "X" "Y" "Z"
 #+END_SRC
 
-* Contents :noexport:
-:PROPERTIES:
-:TOC:  :include siblings
-:END:
-:CONTENTS:
-- [[#usage][Usage]]
-  - [[#dynamic-taxys][Dynamic taxys]]
-  - [[#reusable-taxys][Reusable taxys]]
-  - [[#threading-macros][Threading macros]]
-- [[#changelog][Changelog]]
-- [[#development][Development]]
-- [[#license][License]]
-:END:
-
-# * Installation
-# :PROPERTIES:
-# :TOC:  :depth 0
-# :END:
-# 
-# ** MELPA
-# 
-# If you installed from MELPA, you're done.  Just run one of the commands 
below.
-# 
-# ** Manual
-# 
-#   Install these required packages:
-# 
-#   + =foo=
-#   + =bar=
-# 
-#   Then put this file in your load-path, and put this in your init file:
-# 
-#   #+BEGIN_SRC elisp
-# (require 'taxy)
-#   #+END_SRC
-
 * Usage
 :PROPERTIES:
 :TOC:  :include descendants :depth 1
@@ -410,6 +412,9 @@ Not yet tagged.
 Bug reports, feature requests, suggestions — /oh my/!
 
 * License
+:PROPERTIES:
+:TOC:  :ignore (this)
+:END:
 
 GPLv3
 



[elpa] externals/taxy 0a57638 17/39: Docs: Mention threading macros

2021-08-27 Thread ELPA Syncer
branch: externals/taxy
commit 0a57638a1c07d6f9fab3d6492aefe40ae5b71749
Author: Adam Porter 
Commit: Adam Porter 

Docs: Mention threading macros
---
 README.org | 29 ++---
 1 file changed, 22 insertions(+), 7 deletions(-)

diff --git a/README.org b/README.org
index 434e44b..eda2f33 100644
--- a/README.org
+++ b/README.org
@@ -179,6 +179,7 @@ That's better:
 - [[#usage][Usage]]
   - [[#dynamic-taxys][Dynamic taxys]]
   - [[#reusable-taxys][Reusable taxys]]
+  - [[#threading-macros][Threading macros]]
 - [[#changelog][Changelog]]
 - [[#development][Development]]
 - [[#license][License]]
@@ -213,6 +214,7 @@ That's better:
 :CONTENTS:
 - [[#dynamic-taxys][Dynamic taxys]]
 - [[#reusable-taxys][Reusable taxys]]
+- [[#threading-macros][Threading macros]]
 :END:
 
 A taxy is defined with the ~make-taxy~ constructor, like:
@@ -338,13 +340,12 @@ Note how the taxys defined in the first three variables 
are used in subsequent t
 Using those defined taxys, we then fill the ~ement-roomy~ taxy with all of the 
rooms in the user's session, and then use ~taxy-map~ to replace the room 
structs with useful representations for display:
 
 #+BEGIN_SRC elisp
-  (let ((ement-session (alist-get "@USER:HOST" ement-sessions nil nil 
#'equal)))
-(taxy-plain
- (taxy-map (lambda (room)
-   (list (ement-room--room-display-name room)
- (ement-room-id room)))
-   (taxy-fill (ement-session-rooms ement-session)
-  (taxy-copy ement-roomy)
+  (taxy-plain
+   (taxy-map (lambda (room)
+   (list (ement-room--room-display-name room)
+ (ement-room-id room)))
+ (taxy-fill (ement-session-rooms ement-session)
+(taxy-copy ement-roomy
 #+END_SRC
 
 This produces:
@@ -379,6 +380,20 @@ This produces:
 ("#matrix-dev:matrix.org" "!jxlRxnrZCsjpjDubDX:matrix.org")))
 #+END_SRC
 
+** Threading macros
+
+If you happen to like macros, ~taxy~ works well with threading (i.e. 
~thread-last~ or ~->>~):
+
+#+BEGIN_SRC elisp
+  (thread-last ement-roomy
+taxy-copy
+(taxy-fill (ement-session-rooms ement-session))
+(taxy-map (lambda (room)
+(list (ement-room--room-display-name room)
+  (ement-room-id room
+taxy-plain)
+#+END_SRC
+
 * Changelog
 :PROPERTIES:
 :TOC:  :depth 0



[elpa] externals/taxy f115919 06/39: Add: taxy-copy and reverse args to taxy-fill

2021-08-27 Thread ELPA Syncer
branch: externals/taxy
commit f11591987a84228a00f656d41334e70020825dab
Author: Adam Porter 
Commit: Adam Porter 

Add: taxy-copy and reverse args to taxy-fill

Now it works well in thread-last or ->>.
---
 README.org | 57 +++--
 taxy.el| 12 +++-
 2 files changed, 42 insertions(+), 27 deletions(-)

diff --git a/README.org b/README.org
index b1c46a6..c06b0f4 100644
--- a/README.org
+++ b/README.org
@@ -70,7 +70,7 @@ You might think about how to produce that by writing some 
imperative code, but =
 :predicate (lambda (n) (zerop 
(mod n 5)))
 :then #'identity))
 (numbers (cl-loop for i below 100 collect i)))
-(taxy-simple (taxy-fill numbery (reverse numbers
+(taxy-simple (taxy-fill (reverse numbers) numbery)))
 #+END_SRC
 
 The ~taxy-fill~ function applies the numbers in a "cascade" down the hierarchy 
of "taxys", and the ~taxy-simple~ function returns a meaningful subset of the 
taxys' slots, suitable for display.
@@ -125,11 +125,11 @@ A taxy is defined with the ~make-taxy~ constructor, like:
  :taxys (list ...))
 #+END_SRC
 
-The ~:predicate~ function determines whether an object fits into that taxy.  
If it does, ~taxy-fill~ adds the object to that taxy's descendant ~:taxys~, if 
present, or to its own ~objects~.  The function defaults to ~identity~, so a 
taxy "takes in" any object by default (i.e. if you only apply objects you want 
to classify, there's no need to test them at the top-level taxy).
+The ~:predicate~ function determines whether an object fits into that taxy.  
If it does, ~taxy-fill~ adds the object to that taxy's descendant ~:taxys~, if 
present, or to its own ~:objects~.  The function defaults to ~identity~, so a 
taxy "takes in" any object by default (i.e. if you only apply objects you want 
to classify, there's no need to test them at the top-level taxy).
 
 The ~:then~ function determines what happens to an object after being taken 
in: if the function, called with the object, returns a non-nil value, that 
value is applied to other taxys at the same level until one of their ~:then~ 
functions returns nil or no more taxys remain.  The function defaults to 
~ignore~, which makes a taxy "consume" its objects by default.  Setting the 
function to, e.g. ~identity~, makes it not consume them, leaving them eligible 
to also be taken into subsequent tax [...]
 
-After defining a taxy, call ~taxy-fill~ with it and a list of objects to fill 
the taxy's hierarchy.
+After defining a taxy, call ~taxy-fill~ with it and a list of objects to fill 
the taxy's hierarchy.  *Note:* ~taxy-fill~ modifies the taxy given to it 
(filling its ~:objects~ and those of its ~:taxys~), so when using a statically 
defined taxy (e.g. one defined with ~defvar~), you should pass ~taxy-fill~ a 
taxy copied with ~taxy-copy~, which recursively copies a taxy without 
~:objects~.
 
 To return a taxy in a more human-readable format (with only relevant fields 
included), use ~taxy-simple~.
 
@@ -138,29 +138,34 @@ To return a taxy in a more human-readable format (with 
only relevant fields incl
 You may not always know in advance what taxonomy a set of objects fits into, 
so =taxy= lets you add taxys dynamically by using the ~:take~ function to add a 
taxy when an object is "taken into" a parent taxy.  For example, you could 
dynamically classify buffers by their major mode like so:
 
 #+BEGIN_SRC elisp :exports code
-  (let* ((key-fn (lambda (buffer)
-   (buffer-local-value 'major-mode buffer)))
- (buffery
-  (make-taxy
-   :name "Buffers"
-   :taxys (list
-   (make-taxy
-:name "Modes"
-:take (lambda (buffer taxy)
-(let* ((key (funcall key-fn buffer))
-   (key-taxy
-(or (cl-find-if (lambda (taxy-key)
-  (equal key taxy-key))
-(taxy-taxys taxy)
-:key #'taxy-key)
-(car
- (push (make-taxy
-:name key :key key
-:predicate (lambda (buffer)
- (equal key 
(funcall key-fn buffer
-   (taxy-taxys taxy))
-  (push buffer (taxy-objects key-taxy)
-(taxy-simple (taxy-fill buffery (buffer-list
+  (defun buffery-major-mode (buffer)
+(buffer-local-value 'major-mode buffer))
+
+  (defvar buffery
+(make-taxy
+ :name "Buffers"
+ :taxys (list
+  

[elpa] externals/taxy 21e6fa6 22/39: Docs: Commentary, header

2021-08-27 Thread ELPA Syncer
branch: externals/taxy
commit 21e6fa6986e8d6452836ee3d86eb1ca676f744ad
Author: Adam Porter 
Commit: Adam Porter 

Docs: Commentary, header
---
 taxy.el | 22 --
 1 file changed, 20 insertions(+), 2 deletions(-)

diff --git a/taxy.el b/taxy.el
index 44fb4e3..74bf064 100644
--- a/taxy.el
+++ b/taxy.el
@@ -3,7 +3,7 @@
 ;; Copyright (C) 2021  Adam Porter
 
 ;; Author: Adam Porter 
-;; Keywords:
+;; Keywords: lisp
 
 ;; This program is free software; you can redistribute it and/or modify
 ;; it under the terms of the GNU General Public License as published by
@@ -20,7 +20,25 @@
 
 ;;; Commentary:
 
-;;
+;; This library provides a programmable way to classify arbitrary
+;; objects into a hierarchical taxonomy.  (That's a lot of fancy words
+;; to say that this lets you put things in nested groups.)
+
+;; Helpful features include:
+
+;; + Dynamic taxonomies: Objects may be classified into hierarchies
+;; automatically defined at runtime based on their attributes.
+
+;; + Reusable taxonomies: Taxonomy definitions may be stored in
+;; variables and reused in other taxonomies' descendant groups.
+
+;; Basic usage:
+
+;; 1.  Make a taxy with `make-taxy'.
+;; 2.  Fill the taxy with objects using `taxy-fill'.
+;; 3.  For a simple display of a taxy's objects, use `taxy-plain'.
+
+;; For more details, please see the README.org file.
 
 ;;; Code:
 



[elpa] externals/taxy f5458d0 29/39: Change: taxy-map -> taxy-mapcar

2021-08-27 Thread ELPA Syncer
branch: externals/taxy
commit f5458d086226f9696f4d3d8b1403f408589df634
Author: Adam Porter 
Commit: Adam Porter 

Change: taxy-map -> taxy-mapcar
---
 README.org | 16 
 taxy.el|  8 +---
 taxy.info  | 34 +-
 3 files changed, 30 insertions(+), 28 deletions(-)

diff --git a/README.org b/README.org
index ff82761..3aadc4a 100644
--- a/README.org
+++ b/README.org
@@ -247,7 +247,7 @@ The ~:then~ function determines what happens to an object 
after being taken in:
 
 After defining a taxy, call ~taxy-fill~ with it and a list of objects to fill 
the taxy's hierarchy.  *Note:* ~taxy-fill~ modifies the taxy given to it 
(filling its ~:objects~ and those of its ~:taxys~), so when using a statically 
defined taxy (e.g. one defined with ~defvar~), you should pass ~taxy-fill~ a 
taxy copied with ~taxy-emptied~, which recursively copies a taxy without 
~:objects~.
 
-To return a taxy in a more human-readable format (with only relevant fields 
included), use ~taxy-plain~.  You may also use ~taxy-map~ to replace objects in 
a taxy with, e.g. a more useful representation.
+To return a taxy in a more human-readable format (with only relevant fields 
included), use ~taxy-plain~.  You may also use ~taxy-mapcar~ to replace objects 
in a taxy with, e.g. a more useful representation.
 
 ** Dynamic taxys
 :PROPERTIES:
@@ -399,13 +399,13 @@ Since taxys are structs, they may be stored in variables 
and used in other struc
 
 Note how the taxys defined in the first three variables are used in subsequent 
taxys.  As well, the ~ement-roomy-opened~ taxy has an "anonymous" taxy, which 
collects any rooms that aren't collected by its sibling taxy (otherwise those 
objects would be collected into the parent, "Opened" taxy, which may not always 
be the most useful way to present the objects).
 
-Using those defined taxys, we then fill the ~ement-roomy~ taxy with all of the 
rooms in the user's session, and then use ~taxy-map~ to replace the room 
structs with useful representations for display:
+Using those defined taxys, we then fill the ~ement-roomy~ taxy with all of the 
rooms in the user's session, and then use ~taxy-mapcar~ to replace the room 
structs with useful representations for display:
 
 #+BEGIN_SRC elisp
   (taxy-plain
-   (taxy-map (lambda (room)
-   (list (ement-room--room-display-name room)
- (ement-room-id room)))
+   (taxy-mapcar (lambda (room)
+  (list (ement-room--room-display-name room)
+(ement-room-id room)))
  (taxy-fill (ement-session-rooms ement-session)
 (taxy-emptied ement-roomy
 #+END_SRC
@@ -450,9 +450,9 @@ If you happen to like macros, ~taxy~ works well with 
threading (i.e. ~thread-las
   (thread-last ement-roomy
 taxy-emptied
 (taxy-fill (ement-session-rooms ement-session))
-(taxy-map (lambda (room)
-(list (ement-room--room-display-name room)
-  (ement-room-id room
+(taxy-mapcar (lambda (room)
+   (list (ement-room--room-display-name room)
+ (ement-room-id room
 taxy-plain)
 #+END_SRC
 
diff --git a/taxy.el b/taxy.el
index 47bfb8c..335f7dd 100644
--- a/taxy.el
+++ b/taxy.el
@@ -101,8 +101,8 @@ when reusing taxy definitions."
 (taxy-taxys taxy) (mapcar #'taxy-emptied (taxy-taxys taxy)))
   taxy)
 
-(defun taxy-map (fn taxy)
-  "Return TAXY, having replaced each object in it with the value of FN on it.
+(defun taxy-mapcar-objects (fn taxy)
+  "Return copy of TAXY, having replaced its objects with the value of FN on 
each.
 Replaces every object in TAXY and its descendants.  Useful to
 replace objects with a more useful form after classification."
   (declare (indent defun))
@@ -111,9 +111,11 @@ replace objects with a more useful form after 
classification."
   ;; (even `cl-loop' with `in-ref' hasn't worked).
   (setf (taxy-objects taxy) (mapcar fn (taxy-objects taxy))
 (taxy-taxys taxy) (cl-loop for taxy in (taxy-taxys taxy)
-   collect (taxy-map fn taxy)))
+   collect (taxy-mapcar-objects fn taxy)))
   taxy)
 
+(defalias 'taxy-mapcar #'taxy-mapcar-objects)
+
 (cl-defun taxy-take-keyed (key-fn object taxy &key (key-name-fn #'identity))
   "Take OBJECT into TAXY, adding new taxys dynamically.
 Places OBJECT into a taxy in TAXY for the value returned by
diff --git a/taxy.info b/taxy.info
index ac6b346..23a84a8 100644
--- a/taxy.info
+++ b/taxy.info
@@ -249,7 +249,7 @@ should pass ‘taxy-fill’ a taxy copied with ‘taxy-emptied’, 
which
 recursively copies a taxy without ‘:objects’.
 
To return a taxy in a more human-readable format (with only relevant
-fields included), use ‘taxy-plain’.  You may also use ‘taxy-map’ to
+fields included), use ‘taxy-plain’.  You may also use ‘taxy-mapcar’ to
 replace objects in a taxy with, e.g.  a more useful representation.
 
 * Menu:
@@ -434,13

[elpa] externals/taxy 6c5b7c7 07/39: Add: taxy-apply

2021-08-27 Thread ELPA Syncer
branch: externals/taxy
commit 6c5b7c77d0324cac1fa9ebc2a5a7ba4a1a6a69ca
Author: Adam Porter 
Commit: Adam Porter 

Add: taxy-apply
---
 README.org |  2 +-
 taxy.el| 11 +++
 2 files changed, 12 insertions(+), 1 deletion(-)

diff --git a/README.org b/README.org
index c06b0f4..0ccb801 100644
--- a/README.org
+++ b/README.org
@@ -131,7 +131,7 @@ The ~:then~ function determines what happens to an object 
after being taken in:
 
 After defining a taxy, call ~taxy-fill~ with it and a list of objects to fill 
the taxy's hierarchy.  *Note:* ~taxy-fill~ modifies the taxy given to it 
(filling its ~:objects~ and those of its ~:taxys~), so when using a statically 
defined taxy (e.g. one defined with ~defvar~), you should pass ~taxy-fill~ a 
taxy copied with ~taxy-copy~, which recursively copies a taxy without 
~:objects~.
 
-To return a taxy in a more human-readable format (with only relevant fields 
included), use ~taxy-simple~.
+To return a taxy in a more human-readable format (with only relevant fields 
included), use ~taxy-simple~.  You may also use ~taxy-apply~ to replace objects 
in a taxy with, e.g. a more useful representation.
 
 ** Dynamic taxys
 
diff --git a/taxy.el b/taxy.el
index 115beca..b3bdb3d 100644
--- a/taxy.el
+++ b/taxy.el
@@ -83,6 +83,17 @@ Clears TAXY's objects and those of its descendant taxys."
 (taxy-taxys taxy) (mapcar #'taxy-copy (taxy-taxys taxy)))
   taxy)
 
+(defun taxy-apply (fn taxy)
+  "Return TAXY, having applied FN to each object in it, including descendants.
+Used to apply side effects, e.g. to transform objects into a more
+useful form after classification."
+  ;; I can't seem to find a way to do this without consing new lists.
+  ;; Even using `cl-loop' with `in-ref' didn't work.
+  (setf (taxy-objects taxy) (mapcar fn (taxy-objects taxy))
+(taxy-taxys taxy) (cl-loop for taxy in (taxy-taxys taxy)
+   collect (taxy-apply fn taxy)))
+  taxy)
+
  Footer
 
 (provide 'taxy)



[elpa] externals/taxy fcc780f 27/39: Add: (taxy-take-keyed*)

2021-08-27 Thread ELPA Syncer
branch: externals/taxy
commit fcc780f44a0a354519f190d96d71b57874ad2e00
Author: Adam Porter 
Commit: Adam Porter 

Add: (taxy-take-keyed*)
---
 README.org | 54 ---
 taxy.el| 29 +
 taxy.info  | 86 +-
 3 files changed, 154 insertions(+), 15 deletions(-)

diff --git a/README.org b/README.org
index e062744..722e0a6 100644
--- a/README.org
+++ b/README.org
@@ -250,6 +250,12 @@ After defining a taxy, call ~taxy-fill~ with it and a list 
of objects to fill th
 To return a taxy in a more human-readable format (with only relevant fields 
included), use ~taxy-plain~.  You may also use ~taxy-map~ to replace objects in 
a taxy with, e.g. a more useful representation.
 
 ** Dynamic taxys
+:PROPERTIES:
+:TOC:  :include descendants
+:END:
+:CONTENTS:
+- [[#multi-level-dynamic-taxys][Multi-level dynamic taxys]]
+:END:
 
 You may not always know in advance what taxonomy a set of objects fits into, 
so =taxy= lets you add taxys dynamically by using the ~:take~ function to add a 
taxy when an object is "taken into" a parent taxy.  For example, you could 
dynamically classify buffers by their major mode like so:
 
@@ -302,9 +308,51 @@ The taxy's ~:take~ function is set to the 
~taxy-take-keyed~ function, partially
  # # # #))
 #+END_SRC
 
-# ** Tips
-# 
-# + You can customize settings in the =taxy= group.
+*** Multi-level dynamic taxys
+
+Of course, the point of taxonomies is that they aren't restricted to a single 
level of depth, so you may also use the function ~taxy-take-keyed*~ (notice the 
~*~) to dynamically make multi-level taxys.  Expanding on the previous example, 
we use ~cl-labels~ to define functions which are used in the taxy's definition, 
which are used in the ~:take~ function, which calls ~taxy-take-keyed*~ (rather 
than using ~apply-partially~ like in the previous example, we use a lambda 
function, which perf [...]
+
+# MAYBE: A macro to define :take functions more concisely.
+
+#+BEGIN_SRC elisp :exports code
+  (defvar buffery
+(cl-labels ((buffer-mode (buffer) (buffer-local-value 'major-mode buffer))
+(buffer-directory (buffer) (buffer-local-value 
'default-directory buffer)))
+  (make-taxy
+   :name "Buffers"
+   :taxys (list
+   (make-taxy
+:name "Directories"
+:take (lambda (object taxy)
+(taxy-take-keyed* (list #'buffer-directory 
#'buffer-mode) object taxy)))
+
+  (taxy-plain
+   (taxy-fill (buffer-list)
+  (taxy-emptied buffery)))
+#+END_SRC
+
+That produces a list like:
+
+#+BEGIN_SRC elisp
+  ("Buffers"
+   (("Directories"
+ (("~/src/emacs/ement.el/"
+   ((dired-mode
+ (#))
+(emacs-lisp-mode
+ (# # #))
+(magit-diff-mode
+ (#
+  ("~/src/emacs/taxy.el/"
+   ((dired-mode
+ (#))
+(Info-mode
+ (#))
+(magit-status-mode
+ (#))
+(emacs-lisp-mode
+ (# # #
+#+END_SRC
 
 ** Reusable taxys
 
diff --git a/taxy.el b/taxy.el
index 03e09b9..47bfb8c 100644
--- a/taxy.el
+++ b/taxy.el
@@ -133,6 +133,35 @@ by KEY-NAME-FN called with OBJECT."
  (taxy-taxys taxy))
 (push object (taxy-objects key-taxy
 
+(cl-defun taxy-take-keyed* (key-fns object taxy &key (key-name-fn #'identity))
+  "Take OBJECT into TAXY, adding new taxys dynamically and recursively.
+Places OBJECT into a taxy in TAXY for the value returned by
+KEY-FNS called with OBJECT.  The new taxys are added to TAXY
+recursively as necessary.  Each new taxy's name is that returned
+by KEY-NAME-FN called with OBJECT."
+  (let ((key-fn (car key-fns)))
+(if-let ((key (funcall key-fn object)))
+(let ((key-taxy (or (cl-find-if (lambda (taxy-key)
+  (equal key taxy-key))
+(taxy-taxys taxy)
+:key #'taxy-key)
+(car
+ (push (make-taxy
+:name (funcall key-name-fn key) :key key
+:predicate (lambda (object)
+ (equal key (funcall key-fn 
object)))
+:take (when (cdr key-fns)
+(lambda (object taxy)
+  (taxy-take-keyed* (cdr key-fns) 
object taxy
+   (taxy-taxys taxy))
+  (if (cdr key-fns)
+  (taxy-take-keyed* (cdr key-fns) object key-taxy)
+(push object (taxy-objects key-taxy
+  ;; No key value: push to this taxy.
+  (if (cdr key-fns)
+  (taxy-take-keyed* (cdr key-fns) object taxy)
+(push object (taxy-objects taxy))
+
  Footer
 
 (pro

[elpa] externals/taxy 408a32b 09/39: Docs: Tidy

2021-08-27 Thread ELPA Syncer
branch: externals/taxy
commit 408a32b4fcf5bc843fc1c453047763a6446405bb
Author: Adam Porter 
Commit: Adam Porter 

Docs: Tidy
---
 README.org | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/README.org b/README.org
index 1471b5d..e3784ab 100644
--- a/README.org
+++ b/README.org
@@ -6,7 +6,7 @@
 
 # 
[[https://melpa.org/#/package-name][file:https://melpa.org/packages/taxy-badge.svg]]
 
[[https://stable.melpa.org/#/package-name][file:https://stable.melpa.org/packages/taxy-badge.svg]]
 
-This library provides a way to programmably categorize arbitrary objects into 
a hierarchical taxonomy.  (That's a lot of fancy words to say that this lets 
you put things in groups.)
+This library provides a programmable way to classify arbitrary objects into a 
hierarchical taxonomy.  (That's a lot of fancy words to say that this lets you 
put things in nested groups.)
 
 * Example
 



[elpa] externals/taxy 0dce844 16/39: Docs: Add example of incremental filling

2021-08-27 Thread ELPA Syncer
branch: externals/taxy
commit 0dce844733f0e615952a11564a75d2f93ecc13fc
Author: Adam Porter 
Commit: Adam Porter 

Docs: Add example of incremental filling
---
 README.org | 70 --
 1 file changed, 68 insertions(+), 2 deletions(-)

diff --git a/README.org b/README.org
index 59679a9..434e44b 100644
--- a/README.org
+++ b/README.org
@@ -15,9 +15,9 @@ Helpful features include:
 +  Dynamic taxonomies :: Objects may be classified into hierarchies 
automatically defined at runtime based on their attributes.
 +  Reusable taxonomies :: Taxonomy definitions may be stored in variables and 
reused in other taxonomies' descendant groups.
 
-* Example
+* Examples
 
-This is a silly taxonomy of numbers below 100:
+Let's make a silly taxonomy of numbers below 100:
 
 #+BEGIN_SRC elisp
   ("Numbery" "A silly taxonomy of numbers."
@@ -105,6 +105,72 @@ You might think about how to produce that by writing some 
imperative code, but =
 
 The ~taxy-fill~ function applies the numbers in a "cascade" down the hierarchy 
of "taxys", and the ~taxy-plain~ function returns a meaningful subset of the 
taxys' slots, suitable for display.
 
+You can also add more objects after the hierarchy has been filled:
+
+#+BEGIN_SRC elisp
+  (defvar lettery
+(make-taxy :name "Lettery"
+   :description "A comprehensive taxonomy of letters."
+   :taxys (list (make-taxy :name "Vowels"
+   :description "You know what those are."
+   :predicate (lambda (l)
+(member-ignore-case l 
'("a" "e" "i" "o" "u"
+(make-taxy :name "Consonants"
+   :description "Well, if they aren't a 
vowel..."
+
+  (taxy-plain
+   (taxy-fill (reverse
+   (cl-loop for l from ?a to ?n
+collect (upcase (char-to-string l
+  lettery))
+#+END_SRC
+
+#+BEGIN_SRC elisp
+  ("Lettery" "A comprehensive taxonomy of letters."
+   (("Vowels" "You know what those are."
+ ("A" "E" "I"))
+("Consonants" "Well, if they aren't a vowel..."
+ ("B" "C" "D" "F" "G" "H" "J" "K" "L" "M" "N"
+#+END_SRC
+
+Oops, we forgot the letters after N!  Let's add them, too:
+
+#+BEGIN_SRC elisp
+  (taxy-plain
+   (taxy-fill (reverse
+   (cl-loop for l from ?n to ?z
+collect (upcase (char-to-string l
+  lettery))
+#+END_SRC
+
+#+BEGIN_SRC elisp
+  ("Lettery" "A comprehensive taxonomy of letters."
+   (("Vowels" "You know what those are."
+ ("O" "U" "A" "E" "I"))
+("Consonants" "Well, if they aren't a vowel..."
+ ("N" "P" "Q" "R" "S" "T" "V" "W" "X" "Y" "Z" "B" "C" "D" "F" "G" "H" "J" 
"K" "L" "M" "N"
+#+END_SRC
+
+Oh, they're out of order, now.  That won't do.  Let's fix that:
+
+#+BEGIN_SRC elisp
+  (cl-loop for taxy in-ref (taxy-taxys lettery)
+   do (setf (taxy-objects taxy) (cl-sort (taxy-objects taxy) #'<
+ :key #'string-to-char)))
+
+  (taxy-plain lettery)
+#+END_SRC
+
+That's better:
+
+#+BEGIN_SRC elisp
+  ("Lettery" "A comprehensive taxonomy of letters."
+   (("Vowels" "You know what those are."
+ ("A" "E" "I" "O" "U"))
+("Consonants" "Well, if they aren't a vowel..."
+ ("B" "C" "D" "F" "G" "H" "J" "K" "L" "M" "N" "N" "P" "Q" "R" "S" "T" "V" 
"W" "X" "Y" "Z"
+#+END_SRC
+
 * Contents :noexport:
 :PROPERTIES:
 :TOC:  :include siblings



[elpa] externals/taxy bd28836 24/39: Meta: Headers

2021-08-27 Thread ELPA Syncer
branch: externals/taxy
commit bd2883658dd24116841f737d3acc8afe82fafedf
Author: Adam Porter 
Commit: Adam Porter 

Meta: Headers
---
 taxy.el | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/taxy.el b/taxy.el
index 74bf064..03e09b9 100644
--- a/taxy.el
+++ b/taxy.el
@@ -3,6 +3,8 @@
 ;; Copyright (C) 2021  Adam Porter
 
 ;; Author: Adam Porter 
+;; URL: 
+;; Version: 0.1-pre
 ;; Keywords: lisp
 
 ;; This program is free software; you can redistribute it and/or modify



[elpa] externals/taxy 5a1b055 38/39: Docs: Add magit-loggy example

2021-08-27 Thread ELPA Syncer
branch: externals/taxy
commit 5a1b0559b8c7d3d56d2ba15193d4f75b0c966558
Author: Adam Porter 
Commit: Adam Porter 

Docs: Add magit-loggy example

Really just a rough demo, but it works.
---
 examples/magit-loggy.el | 80 +
 1 file changed, 80 insertions(+)

diff --git a/examples/magit-loggy.el b/examples/magit-loggy.el
new file mode 100644
index 000..b0fde45
--- /dev/null
+++ b/examples/magit-loggy.el
@@ -0,0 +1,80 @@
+;;; magit-loggy.el --- Group Magit log commits by date  -*- lexical-binding: 
t; -*-
+
+;; Copyright (C) 2021  Adam Porter
+
+;; Author: Adam Porter 
+;; Keywords: convenience
+
+;; This program is free software; you can redistribute it and/or modify
+;; it under the terms of the GNU General Public License as published by
+;; the Free Software Foundation, either version 3 of the License, or
+;; (at your option) any later version.
+
+;; 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, see .
+
+;;; Commentary:
+
+;; This works, but since magit-log uses overlays for the committer and
+;; date on each line, those are lost when we erase the buffer.  Fixing
+;; that would require copying the properties of those overlays into
+;; the text properties of each line.  Probably not worth it, since
+;; this is just a demo, anyway.
+
+;;; Code:
+
+ Requirements
+
+(require 'magit-log)
+(require 'ov)
+
+ Variables
+
+(defvar magit-loggy-taxy
+  (make-taxy :name "Commits"
+ :taxys (list
+ (make-taxy :name "By date"
+:take (apply-partially #'taxy-take-keyed 
#'cdr)
+
+ Customization
+
+
+ Commands
+
+(defun magit-loggy ()
+  (interactive)
+  (cl-assert (derived-mode-p 'magit-log-mode))
+  (save-excursion
+(goto-char (point-min))
+(cl-labels ((line-date
+ () (when-let ((ov (car (ov-in 'before-string 'any 
(line-beginning-position) (line-end-position
+   (string (cadr (get-text-property 0 'display 
(overlay-get ov 'before-string
+   (_ (string-match (rx (group (1+ digit) ; number
+   " "
+   (1+ (not blank))) ; 
unit
+(1+ blank) eos)
+string)))
+  (match-string 1 string
+  (let* ((lines (cl-loop until (eobp)
+ collect (cons (buffer-substring (point-at-bol) 
(point-at-eol))
+   (line-date))
+ do (forward-line 1)))
+ (taxy (taxy-fill lines (taxy-emptied magit-loggy-taxy)))
+ (inhibit-read-only t))
+(erase-buffer)
+(taxy-magit-section-insert taxy)
+
+
+ Functions
+
+
+ Footer
+
+(provide 'magit-loggy)
+
+;;; magit-loggy.el ends here



[elpa] externals/taxy aa0fe08 20/39: Change: taxy-copy -> taxy-emptied

2021-08-27 Thread ELPA Syncer
branch: externals/taxy
commit aa0fe08de8676b61c3d633893b537839478d3434
Author: Adam Porter 
Commit: Adam Porter 

Change: taxy-copy -> taxy-emptied

This is more descriptive and accurate.
---
 README.org | 12 ++--
 taxy.el|  7 ---
 2 files changed, 10 insertions(+), 9 deletions(-)

diff --git a/README.org b/README.org
index eca198c..9c46940 100644
--- a/README.org
+++ b/README.org
@@ -233,7 +233,7 @@ The ~:predicate~ function determines whether an object fits 
into that taxy.  If
 
 The ~:then~ function determines what happens to an object after being taken 
in: if the function, called with the object, returns a non-nil value, that 
value is applied to other taxys at the same level until one of their ~:then~ 
functions returns nil or no more taxys remain.  The function defaults to 
~ignore~, which makes a taxy "consume" its objects by default.  Setting the 
function to, e.g. ~identity~, makes it not consume them, leaving them eligible 
to also be taken into subsequent tax [...]
 
-After defining a taxy, call ~taxy-fill~ with it and a list of objects to fill 
the taxy's hierarchy.  *Note:* ~taxy-fill~ modifies the taxy given to it 
(filling its ~:objects~ and those of its ~:taxys~), so when using a statically 
defined taxy (e.g. one defined with ~defvar~), you should pass ~taxy-fill~ a 
taxy copied with ~taxy-copy~, which recursively copies a taxy without 
~:objects~.
+After defining a taxy, call ~taxy-fill~ with it and a list of objects to fill 
the taxy's hierarchy.  *Note:* ~taxy-fill~ modifies the taxy given to it 
(filling its ~:objects~ and those of its ~:taxys~), so when using a statically 
defined taxy (e.g. one defined with ~defvar~), you should pass ~taxy-fill~ a 
taxy copied with ~taxy-emptied~, which recursively copies a taxy without 
~:objects~.
 
 To return a taxy in a more human-readable format (with only relevant fields 
included), use ~taxy-plain~.  You may also use ~taxy-map~ to replace objects in 
a taxy with, e.g. a more useful representation.
 
@@ -253,10 +253,10 @@ You may not always know in advance what taxonomy a set of 
objects fits into, so
   :name "Modes"
   :take (apply-partially #'taxy-take-keyed 
#'buffery-major-mode)
 
-  ;; Note the use of `taxy-copy' to avoid mutating the original taxy 
definition.
+  ;; Note the use of `taxy-emptied' to avoid mutating the original taxy 
definition.
   (taxy-plain
(taxy-fill (buffer-list)
-  (taxy-copy buffery)))
+  (taxy-emptied buffery)))
 #+END_SRC
 
 The taxy's ~:take~ function is set to the ~taxy-take-keyed~ function, 
partially applied with the ~buffery-major-mode~ function as its ~key-fn~ 
(~taxy-fill~ supplies the buffer and the taxy as arguments), and it produces 
this taxonomy of buffers:
@@ -296,7 +296,7 @@ The taxy's ~:take~ function is set to the ~taxy-take-keyed~ 
function, partially
 
 ** Reusable taxys
 
-Since taxys are structs, they may be stored in variables and used in other 
structs (being sure to copy the root taxy with ~taxy-copy~ before filling).  
For example, this shows using =taxy= to classify Matrix rooms in 
[[https://github.com/alphapapa/ement.el][Ement.el]]:
+Since taxys are structs, they may be stored in variables and used in other 
structs (being sure to copy the root taxy with ~taxy-emptied~ before filling).  
For example, this shows using =taxy= to classify Matrix rooms in 
[[https://github.com/alphapapa/ement.el][Ement.el]]:
 
 #+BEGIN_SRC elisp
   (defun ement-roomy-buffer (room)
@@ -347,7 +347,7 @@ Using those defined taxys, we then fill the ~ement-roomy~ 
taxy with all of the r
(list (ement-room--room-display-name room)
  (ement-room-id room)))
  (taxy-fill (ement-session-rooms ement-session)
-(taxy-copy ement-roomy
+(taxy-emptied ement-roomy
 #+END_SRC
 
 This produces:
@@ -388,7 +388,7 @@ If you happen to like macros, ~taxy~ works well with 
threading (i.e. ~thread-las
 
 #+BEGIN_SRC elisp
   (thread-last ement-roomy
-taxy-copy
+taxy-emptied
 (taxy-fill (ement-session-rooms ement-session))
 (taxy-map (lambda (room)
 (list (ement-room--room-display-name room)
diff --git a/taxy.el b/taxy.el
index 935b404..7f181f6 100644
--- a/taxy.el
+++ b/taxy.el
@@ -72,12 +72,13 @@
   (taxy-objects taxy)
   (mapcar #'taxy-plain (taxy-taxys taxy)
 
-(defun taxy-copy (taxy)
+(defun taxy-emptied (taxy)
   "Return a copy of TAXY without objects.
-Clears TAXY's objects and those of its descendant taxys."
+Omits TAXY's objects and those of its descendant taxys.  Useful
+when reusing taxy definitions."
   (setf taxy (copy-taxy taxy)
 (taxy-objects taxy) nil
-(taxy-taxys taxy) (mapcar #'taxy-copy (taxy-taxys taxy)))
+(taxy-taxys taxy) (mapcar #'taxy-emptied (taxy-taxys taxy)))
   taxy)
 
 (defun taxy-map (fn taxy)



[elpa] externals/taxy 524b151 19/39: Tidy: (taxy-fill)

2021-08-27 Thread ELPA Syncer
branch: externals/taxy
commit 524b151addde581ea49662fa1ba3f894e2f354d2
Author: Adam Porter 
Commit: Adam Porter 

Tidy: (taxy-fill)
---
 taxy.el | 19 ---
 1 file changed, 8 insertions(+), 11 deletions(-)

diff --git a/taxy.el b/taxy.el
index adbf69e..935b404 100644
--- a/taxy.el
+++ b/taxy.el
@@ -51,17 +51,14 @@
   (cl-labels ((apply-object (taxy object)
 (cl-loop for taxy in (taxy-taxys taxy)
  when (funcall (taxy-predicate taxy) 
object)
- do (setf object (if (taxy-take taxy)
- (progn
-   (funcall (taxy-take 
taxy) object taxy)
-   (funcall (taxy-then 
taxy) object))
-   (if (taxy-taxys taxy)
-   (progn
- (or (apply-object 
taxy object)
- (push object 
(taxy-objects taxy)))
- (funcall 
(taxy-then taxy) object))
- (push object 
(taxy-objects taxy))
- (funcall (taxy-then 
taxy) object
+ do (progn
+  (if (taxy-take taxy)
+  (funcall (taxy-take taxy) object 
taxy)
+(if (taxy-taxys taxy)
+(or (apply-object taxy object)
+(push object (taxy-objects 
taxy)))
+  (push object (taxy-objects 
taxy
+  (setf object (funcall (taxy-then 
taxy) object)))
  unless object return t
  finally return nil)))
 (dolist (object objects taxy)



[elpa] externals/taxy 3b253a6 21/39: Tidy: (taxy-fill) Argument order in labeled function

2021-08-27 Thread ELPA Syncer
branch: externals/taxy
commit 3b253a695bec564228efeb054cd4c7145d3178eb
Author: Adam Porter 
Commit: Adam Porter 

Tidy: (taxy-fill) Argument order in labeled function
---
 taxy.el | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/taxy.el b/taxy.el
index 7f181f6..44fb4e3 100644
--- a/taxy.el
+++ b/taxy.el
@@ -48,21 +48,21 @@
 
 (defun taxy-fill (objects taxy)
   "Fill TAXY with OBJECTS according to its definition."
-  (cl-labels ((apply-object (taxy object)
+  (cl-labels ((apply-object (object taxy)
 (cl-loop for taxy in (taxy-taxys taxy)
  when (funcall (taxy-predicate taxy) 
object)
  do (progn
   (if (taxy-take taxy)
   (funcall (taxy-take taxy) object 
taxy)
 (if (taxy-taxys taxy)
-(or (apply-object taxy object)
+(or (apply-object object taxy)
 (push object (taxy-objects 
taxy)))
   (push object (taxy-objects 
taxy
   (setf object (funcall (taxy-then 
taxy) object)))
  unless object return t
  finally return nil)))
 (dolist (object objects taxy)
-  (apply-object taxy object
+  (apply-object object taxy
 
 (defun taxy-plain (taxy)
   "Return a list of the human-readable parts of TAXY."



[elpa] externals/taxy 3cf0d46 25/39: Docs: Export Info manual

2021-08-27 Thread ELPA Syncer
branch: externals/taxy
commit 3cf0d46f97ac22954b862ba0c90054c60f1f278c
Author: Adam Porter 
Commit: Adam Porter 

Docs: Export Info manual
---
 README.org |  32 +++-
 taxy.info  | 508 +
 2 files changed, 536 insertions(+), 4 deletions(-)

diff --git a/README.org b/README.org
index 2e40b12..e062744 100644
--- a/README.org
+++ b/README.org
@@ -426,6 +426,8 @@ That shows a buffer like this:
 
 [[images/magit-section-numbery.png]]
 
+Note that =taxy-magit-section.el= is not installed with the =taxy= package by 
default.
+
 * Changelog
 :PROPERTIES:
 :TOC:  :depth 0
@@ -448,10 +450,32 @@ Bug reports, feature requests, suggestions — /oh my/!
 
 GPLv3
 
+* COMMENT Export setup :noexport:
+:PROPERTIES:
+:TOC:  :ignore (this descendants)
+:END:
+
+# Copied from org-super-agenda's readme, in which much was borrowed from Org's 
=org-manual.org=.
+
+#+OPTIONS: broken-links:t *:t
+
+** Info export options
+
+#+TEXINFO_DIR_CATEGORY: Emacs
+#+TEXINFO_DIR_TITLE: Taxy: (taxy)
+#+TEXINFO_DIR_DESC: Programmable taxonomical grouping for arbitrary objects
+
+# NOTE: We could use these, but that causes a pointless error, 
"org-compile-file: File "..README.info" wasn't produced...", so we just rename 
the files in the after-save-hook instead.
+# #+TEXINFO_FILENAME: taxy.info
+# #+EXPORT_FILE_NAME: taxy.texi
+
+** File-local variables
+
+# NOTE: Setting org-comment-string buffer-locally is a nasty hack to work 
around GitHub's org-ruby's HTML rendering, which does not respect noexport 
tags.  The only way to hide this tree from its output is to use the COMMENT 
keyword, but that prevents Org from processing the export options declared in 
it.  So since these file-local variables don't affect org-ruby, wet set 
org-comment-string to an unused keyword, which prevents Org from deleting this 
tree from the export buffer, which all [...]
+
 # Local Variables:
-# eval: (require 'org-make-toc)
 # before-save-hook: org-make-toc
-# org-export-with-properties: ()
-# org-export-with-title: t
+# after-save-hook: (lambda nil (when (and (require 'ox-texinfo nil t) 
(org-texinfo-export-to-info)) (delete-file "README.texi") (rename-file 
"README.info" "taxy.info" t)))
+# org-export-initial-scope: buffer
+# org-comment-string: "NOTCOMMENT"
 # End:
-
diff --git a/taxy.info b/taxy.info
new file mode 100644
index 000..f0d0a8b
--- /dev/null
+++ b/taxy.info
@@ -0,0 +1,508 @@
+This is README.info, produced by makeinfo version 5.2 from README.texi.
+
+INFO-DIR-SECTION Emacs
+START-INFO-DIR-ENTRY
+* Taxy: (taxy). Programmable taxonomical grouping for arbitrary 
objects.
+END-INFO-DIR-ENTRY
+
+
+File: README.info,  Node: Top,  Next: Examples,  Up: (dir)
+
+taxy.el
+***
+
+* Menu:
+
+* Examples::
+* Usage::
+* Changelog::
+* Development::
+* License::
+
+— The Detailed Node Listing —
+
+
+Usage
+
+* Dynamic taxys::
+* Reusable taxys::
+* Threading macros::
+* Magit section::
+
+
+
+Changelog
+
+* 0.1-pre: 01-pre. 
+
+_Now, where did I put that…_
+
+   This library provides a programmable way to classify arbitrary
+objects into a hierarchical taxonomy.  (That’s a lot of fancy words to
+say that this lets you put things in nested groups.)
+
+   Helpful features include:
+
+‘Dynamic taxonomies’
+ Objects may be classified into hierarchies automatically defined at
+ runtime based on their attributes.
+‘Reusable taxonomies’
+ Taxonomy definitions may be stored in variables and reused in other
+ taxonomies’ descendant groups.
+
+
+File: README.info,  Node: Examples,  Next: Usage,  Prev: Top,  Up: Top
+
+1 Examples
+**
+
+Let’s imagine a silly taxonomy of numbers below 100:
+
+ ("Numbery" "A silly taxonomy of numbers."
+  (("< 10" "Numbers below 10"
+;; These numbers are leftovers from the sub-taxys below.
+(0 2 4 6 8)
+;; These sub-taxys further classify the numbers below 10 into odd
+;; and even.  The odd taxy "consumes" numbers, while the even one
+;; doesn't, leaving them to reappear in the parent taxy's objects.
+(("Odd" "(consuming)"
+  (1 3 5 7 9))
+ ("Even" "(non-consuming)"
+  (0 2 4 6 8
+   (">= 10" "Numbers above 9"
+;; Like in the "< 10" taxy, these numbers are leftovers from this
+;; taxy's sub-taxys, three of which are non-consuming.
+(10 11 13 14 17 19 22 23 25 26 29 31 34 35 37 38 41 43 46 47 49 50 53 
55 58
+59 61 62 65 67 70 71 73 74 77 79 82 83 85 86 89 91 94 95 97 98)
+(("Divisible by 3" "(non-consuming)"
+  (12 15 18 21 24 27 30 33 36 39 42 45 48 51 54 57 60 63 66 69 72 75 
78 81 84
+  87 90 93 96 99))
+ ("Divisible by 4" "(non-consuming)"
+  (12 16 20 24 28 32 36 40 44 48 52 56 60 64 68 72 76 80 84 88 92 96))
+ ("Divisible by 3 or 4" "(consuming)"
+  ;; This taxy consumes numbers it takes in, but since the

[elpa] externals/taxy 35c8f61 33/39: Add: (taxy-magit-section-indent)

2021-08-27 Thread ELPA Syncer
branch: externals/taxy
commit 35c8f61b8b83a4573d3877d1c3d88000f99edae4
Author: Adam Porter 
Commit: Adam Porter 

Add: (taxy-magit-section-indent)
---
 taxy-magit-section.el | 6 --
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/taxy-magit-section.el b/taxy-magit-section.el
index 932e917..d14f36b 100644
--- a/taxy-magit-section.el
+++ b/taxy-magit-section.el
@@ -31,6 +31,8 @@
 
  Variables
 
+(defvar taxy-magit-section-indent 2
+  "Default indentation per level.")
 
  Customization
 
@@ -55,13 +57,13 @@ If OBJECTS is `first', insert a taxy's objects before its
 descendant taxys; if `last', insert them after descendants."
   (let ((depth 0))
 (cl-labels ((insert-object
- (object) (insert (make-string (+ 2 (* depth 2)) ? )
+ (object) (insert (make-string (+ 2 (* depth 
taxy-magit-section-indent)) ? )
   (format "%s" object)
   "\n"))
 (insert-taxy
  (taxy) (magit-insert-section (magit-section taxy)
   (magit-insert-heading
-(make-string (* depth 2) ? )
+(make-string (* depth taxy-magit-section-indent) ? 
)
 (propertize (taxy-name taxy) 'face 
'magit-section-heading)
 (when (taxy-description taxy)
   (concat " (" (taxy-description taxy) ")")))



[elpa] externals/taxy 9d44dba 13/39: Change: taxy-apply -> taxy-map

2021-08-27 Thread ELPA Syncer
branch: externals/taxy
commit 9d44dba49984928c4b049cf6f6ce2df78f228fd6
Author: Adam Porter 
Commit: Adam Porter 

Change: taxy-apply -> taxy-map
---
 README.org | 10 +-
 taxy.el| 15 ---
 2 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/README.org b/README.org
index fcef2ee..f6bbb51 100644
--- a/README.org
+++ b/README.org
@@ -158,7 +158,7 @@ The ~:then~ function determines what happens to an object 
after being taken in:
 
 After defining a taxy, call ~taxy-fill~ with it and a list of objects to fill 
the taxy's hierarchy.  *Note:* ~taxy-fill~ modifies the taxy given to it 
(filling its ~:objects~ and those of its ~:taxys~), so when using a statically 
defined taxy (e.g. one defined with ~defvar~), you should pass ~taxy-fill~ a 
taxy copied with ~taxy-copy~, which recursively copies a taxy without 
~:objects~.
 
-To return a taxy in a more human-readable format (with only relevant fields 
included), use ~taxy-plain~.  You may also use ~taxy-apply~ to replace objects 
in a taxy with, e.g. a more useful representation.
+To return a taxy in a more human-readable format (with only relevant fields 
included), use ~taxy-plain~.  You may also use ~taxy-map~ to replace objects in 
a taxy with, e.g. a more useful representation.
 
 ** Dynamic taxys
 
@@ -262,14 +262,14 @@ Since taxys are structs, they may be stored in variables 
and used in other struc
 
 Note how the taxys defined in the first three variables are used in subsequent 
taxys.  As well, the ~ement-roomy-opened~ taxy has an "anonymous" taxy, which 
collects any rooms that aren't collected by its sibling taxy (otherwise those 
objects would be collected into the parent, "Opened" taxy, which may not always 
be the most useful way to present the objects).
 
-Using those defined taxys, we then fill the ~ement-roomy~ taxy with all of the 
rooms in the user's session, and then use ~taxy-apply~ to replace the room 
structs with useful representations for display:
+Using those defined taxys, we then fill the ~ement-roomy~ taxy with all of the 
rooms in the user's session, and then use ~taxy-map~ to replace the room 
structs with useful representations for display:
 
 #+BEGIN_SRC elisp
   (let ((ement-session (alist-get "@USER:HOST" ement-sessions nil nil 
#'equal)))
 (taxy-plain
- (taxy-apply (lambda (room)
-   (setf room (list (ement-room--room-display-name room)
-(ement-room-id room
+ (taxy-map (lambda (room)
+   (list (ement-room--room-display-name room)
+ (ement-room-id room)))
(taxy-fill (ement-session-rooms ement-session)
   (taxy-copy ement-roomy)
 #+END_SRC
diff --git a/taxy.el b/taxy.el
index a7d4073..adbf69e 100644
--- a/taxy.el
+++ b/taxy.el
@@ -83,16 +83,17 @@ Clears TAXY's objects and those of its descendant taxys."
 (taxy-taxys taxy) (mapcar #'taxy-copy (taxy-taxys taxy)))
   taxy)
 
-(defun taxy-apply (fn taxy)
-  "Return TAXY, having applied FN to each object in it, including descendants.
-Used to apply side effects, e.g. to transform objects into a more
-useful form after classification."
+(defun taxy-map (fn taxy)
+  "Return TAXY, having replaced each object in it with the value of FN on it.
+Replaces every object in TAXY and its descendants.  Useful to
+replace objects with a more useful form after classification."
   (declare (indent defun))
-  ;; I can't seem to find a way to do this without consing new lists.
-  ;; Even using `cl-loop' with `in-ref' didn't work.
+  ;; It might be preferable to destructively replace objects rather
+  ;; than consing new lists, but I haven't found a way that works
+  ;; (even `cl-loop' with `in-ref' hasn't worked).
   (setf (taxy-objects taxy) (mapcar fn (taxy-objects taxy))
 (taxy-taxys taxy) (cl-loop for taxy in (taxy-taxys taxy)
-   collect (taxy-apply fn taxy)))
+   collect (taxy-map fn taxy)))
   taxy)
 
 (cl-defun taxy-take-keyed (key-fn object taxy &key (key-name-fn #'identity))



[elpa] externals/taxy 15eb9b7 31/39: Docs: Tidy

2021-08-27 Thread ELPA Syncer
branch: externals/taxy
commit 15eb9b7880e05b81aeb2456fbcd1e080d629ba4e
Author: Adam Porter 
Commit: Adam Porter 

Docs: Tidy
---
 README.org |  4 +++-
 taxy.info  | 18 ++
 2 files changed, 13 insertions(+), 9 deletions(-)

diff --git a/README.org b/README.org
index 3aadc4a..4624c6f 100644
--- a/README.org
+++ b/README.org
@@ -310,7 +310,9 @@ The taxy's ~:take~ function is set to the ~taxy-take-keyed~ 
function, partially
 
 *** Multi-level dynamic taxys
 
-Of course, the point of taxonomies is that they aren't restricted to a single 
level of depth, so you may also use the function ~taxy-take-keyed*~ (notice the 
~*~) to dynamically make multi-level taxys.  Expanding on the previous example, 
we use ~cl-labels~ to define functions which are used in the taxy's definition, 
which are used in the ~:take~ function, which calls ~taxy-take-keyed*~ (rather 
than using ~apply-partially~ like in the previous example, we use a lambda 
function, which perf [...]
+Of course, the point of taxonomies is that they aren't restricted to a single 
level of depth, so you may also use the function ~taxy-take-keyed*~ (notice the 
~*~) to dynamically make multi-level taxys.  
+
+Expanding on the previous example, we use ~cl-labels~ to define functions 
which are used in the taxy's definition, which are used in the ~:take~ 
function, which calls ~taxy-take-keyed*~ (rather than using ~apply-partially~ 
like in the previous example, we use a lambda function, which performs better 
than partially applied functions).  Then when the taxy is filled, a multi-level 
hierarchy is created dynamically, organizing buffers first by their directory, 
and then by mode in each directory.
 
 # MAYBE: A macro to define :take functions more concisely.
 
diff --git a/taxy.info b/taxy.info
index 23a84a8..43ef1bc 100644
--- a/taxy.info
+++ b/taxy.info
@@ -333,7 +333,9 @@ File: README.info,  Node: Multi-level dynamic taxys,  Up: 
Dynamic taxys
 Of course, the point of taxonomies is that they aren’t restricted to a
 single level of depth, so you may also use the function
 ‘taxy-take-keyed*’ (notice the ‘*’) to dynamically make multi-level
-taxys.  Expanding on the previous example, we use ‘cl-labels’ to define
+taxys.
+
+   Expanding on the previous example, we use ‘cl-labels’ to define
 functions which are used in the taxy’s definition, which are used in the
 ‘:take’ function, which calls ‘taxy-take-keyed*’ (rather than using
 ‘apply-partially’ like in the previous example, we use a lambda
@@ -554,13 +556,13 @@ Node: Examples1101
 Node: Usage9001
 Node: Dynamic taxys11087
 Node: Multi-level dynamic taxys13505
-Node: Reusable taxys15665
-Node: Threading macros19834
-Node: Magit section20364
-Node: Changelog20959
-Node: 01-pre21097
-Node: Development21191
-Node: License21362
+Node: Reusable taxys15668
+Node: Threading macros19837
+Node: Magit section20367
+Node: Changelog20962
+Node: 01-pre21100
+Node: Development21194
+Node: License21365
 
 End Tag Table
 



[nongnu] elpa/tuareg updated (f6801c8 -> 4c4fad3)

2021-08-27 Thread ELPA Syncer
elpasync pushed a change to branch elpa/tuareg.

  from  f6801c8   Update Tuareg header
   new  95f3b01   Explicit group numbering in error regexp
   new  5872d6b   Treat ancillary locations as messages at Info level, not 
Error
   new  2a58507   Use Warning level for Alert messages
   new  b62d4ee   Add genuine example of warning with ancillary locations
   new  4c4fad3   Work around bug in Emacs 26 and older


Summary of changes:
 compilation.txt | 44 
 tuareg-tests.el | 22 +-
 tuareg.el   | 31 ++-
 3 files changed, 59 insertions(+), 38 deletions(-)



[elpa] externals/taxy e09dc38 32/39: Add: (taxy-mapc*) And musicy.el example

2021-08-27 Thread ELPA Syncer
branch: externals/taxy
commit e09dc38a5786b3de2a70437f232968b644f32e13
Author: Adam Porter 
Commit: Adam Porter 

Add: (taxy-mapc*) And musicy.el example
---
 README.org  |  49 +++-
 examples/README.org |  26 +++
 examples/musicy.el  | 126 
 images/musicy.png   | Bin 0 -> 28010 bytes
 taxy.el |  11 +
 taxy.info   |  77 +---
 6 files changed, 252 insertions(+), 37 deletions(-)

diff --git a/README.org b/README.org
index 4624c6f..168a687 100644
--- a/README.org
+++ b/README.org
@@ -23,37 +23,17 @@ Helpful features include:
 :END:
 :CONTENTS:
 - [[#examples][Examples]]
+  - [[#example-applications][Example applications]]
 - [[#usage][Usage]]
   - [[#dynamic-taxys][Dynamic taxys]]
   - [[#reusable-taxys][Reusable taxys]]
   - [[#threading-macros][Threading macros]]
+  - [[#modifying-filled-taxys][Modifying filled taxys]]
   - [[#magit-section][Magit section]]
 - [[#changelog][Changelog]]
 - [[#development][Development]]
 :END:
 
-# * Installation
-# :PROPERTIES:
-# :TOC:  :depth 0
-# :END:
-#
-# ** MELPA
-#
-# If you installed from MELPA, you're done.  Just run one of the commands 
below.
-#
-# ** Manual
-#
-#   Install these required packages:
-#
-#   + =foo=
-#   + =bar=
-#
-#   Then put this file in your load-path, and put this in your init file:
-#
-#   #+BEGIN_SRC elisp
-# (require 'taxy)
-#   #+END_SRC
-
 * Examples
 
 Let's imagine a silly taxonomy of numbers below 100:
@@ -220,6 +200,10 @@ That's better:
  ("B" "C" "D" "F" "G" "H" "J" "K" "L" "M" "N" "N" "P" "Q" "R" "S" "T" "V" 
"W" "X" "Y" "Z"
 #+END_SRC
 
+** Example applications
+
+Some example applications may be found in the 
[[file:examples/README.org][examples directory]].
+
 * Usage
 :PROPERTIES:
 :TOC:  :include descendants :depth 1
@@ -228,6 +212,7 @@ That's better:
 - [[#dynamic-taxys][Dynamic taxys]]
 - [[#reusable-taxys][Reusable taxys]]
 - [[#threading-macros][Threading macros]]
+- [[#modifying-filled-taxys][Modifying filled taxys]]
 - [[#magit-section][Magit section]]
 :END:
 
@@ -458,6 +443,26 @@ If you happen to like macros, ~taxy~ works well with 
threading (i.e. ~thread-las
 taxy-plain)
 #+END_SRC
 
+** Modifying filled taxys
+
+Sometimes it's necessary to modify a taxy after filling it with objects, e.g. 
to sort the objects and/or the sub-taxys.  For this, use the function 
~taxy-mapc-taxys~ (a.k.a. ~taxy-mapc*~).  For example, in the sample 
application [[file:examples/musicy.el][musicy.el]], the taxys and their objects 
are sorted after filling, like so:
+
+#+BEGIN_SRC elisp
+  (defun musicy-files (files)
+(thread-last musicy-taxy
+  taxy-emptied
+  (taxy-fill files)
+  (taxy-mapc* (lambda (taxy)
+;; Sort sub-taxys by their name.
+(setf (taxy-taxys taxy)
+  (cl-sort (taxy-taxys taxy) #'string<
+   :key #'taxy-name))
+;; Sort sub-taxys' objects by name.
+(setf (taxy-objects taxy)
+  (cl-sort (taxy-objects taxy) #'string<
+  taxy-magit-section-pp))
+#+END_SRC
+
 ** Magit section
 
 Showing a =taxy= with =magit-section= is very easy:
diff --git a/examples/README.org b/examples/README.org
new file mode 100644
index 000..06d7325
--- /dev/null
+++ b/examples/README.org
@@ -0,0 +1,26 @@
+#+TITLE: Taxy Examples
+
+Some example applcations using ~taxy~.
+
+* Musicy
+
+[[file:musicy.el][Musicy]] displays a music library in a ~magit-section~ 
buffer.  Use it like:
+
+#+BEGIN_SRC elisp
+  (require 'musicy)
+
+  (musicy "~/Music")
+#+END_SRC
+
+Since it calls the =mediainfo= program on every file, it can be slow on large 
music libraries, so you might want to test it on only a subset of them, like:
+
+#+BEGIN_SRC elisp
+  (musicy-files
+   (seq-take (directory-files-recursively
+  "~/Music" (rx "." (or "mp3" "ogg") eos))
+ 100))
+#+END_SRC
+
+The resulting buffer shows tracks organized by genre, then artist, then year, 
then album, then track name:
+
+[[../images/musicy.png]]
diff --git a/examples/musicy.el b/examples/musicy.el
new file mode 100644
index 000..be74fcd
--- /dev/null
+++ b/examples/musicy.el
@@ -0,0 +1,126 @@
+;;; musicy.el --- View a music library in a useful taxonomy  -*- 
lexical-binding: t; -*-
+
+;; Copyright (C) 2021  Adam Porter
+
+;; Author: Adam Porter 
+;; Keywords: convenience
+
+;; This program is free software; you can redistribute it and/or modify
+;; it under the terms of the GNU General Public License as published by
+;; the Free Software Foundation, either version 3 of the License, or
+;; (at your option) any later version.
+
+;; 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 Publ

[elpa] externals/taxy e56ae33 26/39: Meta: .gitignore

2021-08-27 Thread ELPA Syncer
branch: externals/taxy
commit e56ae3353ad70426876b0461b3390c14fd75ad35
Author: Adam Porter 
Commit: Adam Porter 

Meta: .gitignore
---
 .gitignore | 4 
 1 file changed, 4 insertions(+)

diff --git a/.gitignore b/.gitignore
new file mode 100644
index 000..c75cc9d
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,4 @@
+scratch.*
+org-src-*
+*.elc
+.#*



[elpa] externals/taxy 2c044ed 39/39: Add: (taxy-take-keyed*) :then, and examples

2021-08-27 Thread ELPA Syncer
branch: externals/taxy
commit 2c044ed4b2033a36878b3ed00cdc2afb73f32368
Author: Adam Porter 
Commit: Adam Porter 

Add: (taxy-take-keyed*) :then, and examples
---
 README.org | 219 +++-
 taxy.el|   7 +-
 taxy.info  | 253 -
 3 files changed, 455 insertions(+), 24 deletions(-)

diff --git a/README.org b/README.org
index 94f5c24..da4b5b4 100644
--- a/README.org
+++ b/README.org
@@ -23,7 +23,10 @@ Helpful features include:
 :END:
 :CONTENTS:
 - [[#examples][Examples]]
-  - [[#example-applications][Example applications]]
+  - [[#numbery-starting-basically][Numbery (starting basically)]]
+  - [[#lettery-filling-incrementally][Lettery (filling incrementally)]]
+  - [[#sporty-understanding-completely][Sporty (understanding completely)]]
+  - [[#applications][Applications]]
 - [[#usage][Usage]]
   - [[#dynamic-taxys][Dynamic taxys]]
   - [[#reusable-taxys][Reusable taxys]]
@@ -35,6 +38,19 @@ Helpful features include:
 :END:
 
 * Examples
+:PROPERTIES:
+:TOC:  :include descendants :depth 1
+:END:
+:CONTENTS:
+- [[#numbery-starting-basically][Numbery (starting basically)]]
+- [[#lettery-filling-incrementally][Lettery (filling incrementally)]]
+- [[#sporty-understanding-completely][Sporty (understanding completely)]]
+- [[#applications][Applications]]
+:END:
+
+May these examples help you classify your understanding.
+
+** Numbery (starting basically)
 
 Let's imagine a silly taxonomy of numbers below 100:
 
@@ -134,6 +150,8 @@ You might think about how to produce that by writing some 
imperative code, but =
 
 The ~taxy-fill~ function applies the numbers in a "cascade" down the hierarchy 
of "taxys", and the ~taxy-plain~ function returns a meaningful subset of the 
taxys' slots, suitable for display.
 
+** Lettery (filling incrementally)
+
 You can also add more objects after the hierarchy has been filled:
 
 #+BEGIN_SRC elisp
@@ -200,7 +218,204 @@ That's better:
  ("B" "C" "D" "F" "G" "H" "J" "K" "L" "M" "N" "N" "P" "Q" "R" "S" "T" "V" 
"W" "X" "Y" "Z"
 #+END_SRC
 
-** Example applications
+** Sporty (understanding completely)
+
+Let's try to understand a few things about sports.  First we'll define a 
struct to make them easier to grasp:
+
+#+BEGIN_SRC elisp :exports code :results silent
+  (cl-defstruct sport
+name uses venue fun)
+#+END_SRC
+
+Now we'll make a list of sports:
+
+#+BEGIN_SRC elisp :exports code :results silent
+  (defvar sports
+(list (make-sport :name "Baseball"
+  :uses '(bat ball glove)
+  :venue 'outdoor
+  :fun t)
+  (make-sport :name "Football"
+  :uses '(ball)
+  :venue 'outdoor
+  :fun t)
+  (make-sport :name "Basketball"
+  :uses '(ball hoop)
+  :venue 'indoor
+  :fun t)
+  (make-sport :name "Tennis"
+  :uses '(ball racket)
+  :venue 'outdoor
+  :fun t)
+  (make-sport :name "Racquetball"
+  :uses '(ball racket)
+  :venue 'indoor
+  :fun t)
+  (make-sport :name "Handball"
+  :uses '(ball glove)
+  :venue 'indoor
+  :fun t)
+  (make-sport :name "Soccer"
+  :uses '(ball)
+  :venue 'outdoor
+  :fun nil)
+  (make-sport :name "Disc golf"
+  :uses '(disc basket)
+  :venue 'outdoor
+  :fun t)
+  (make-sport :name "Ultimate"
+  :uses '(disc)
+  :venue 'outdoor
+  :fun t)
+  (make-sport :name "Volleyball"
+  :uses '(ball)
+  :venue 'indoor
+  :fun t)))
+#+END_SRC
+
+And finally we'll define a taxy to organize them.  In this, we use a helper 
macro to make the ~member~ function easier to use in the list of key functions:
+
+#+BEGIN_SRC elisp :exports code :results silent :lexical t
+  (defvar sporty
+(cl-macrolet ((in (needle haystack)
+  `(lambda (object)
+ (when (member ,needle (funcall ,haystack object))
+   ,needle
+  (make-taxy
+   :taxys (list (make-taxy
+ :name "Sporty"
+ :take (lambda (object taxy)
+ (taxy-take-keyed*
+  (list #'sport-venue
+(in 'ball 'sport-uses)
+(in 'disc 'sport-uses)
+(in 'glove 'sport-uses)
+(in 'racket 'sport-uses))
+  object taxy
+

[nongnu] elpa/tuareg 2a58507 3/5: Use Warning level for Alert messages

2021-08-27 Thread ELPA Syncer
branch: elpa/tuareg
commit 2a585072ba6531e2d5935dc56b69ebb3238e38f1
Author: Mattias Engdegård 
Commit: Christophe Troestler 

Use Warning level for Alert messages

Previously they got the Error level by default.
---
 compilation.txt | 8 
 tuareg-tests.el | 5 +
 tuareg.el   | 7 +++
 3 files changed, 16 insertions(+), 4 deletions(-)

diff --git a/compilation.txt b/compilation.txt
index 736066d..d88a348 100644
--- a/compilation.txt
+++ b/compilation.txt
@@ -122,6 +122,14 @@ File "moo.ml", line 6, characters 6-10:
 Warning 26 [unused-var]: unused variable fish.
 
 
+* Alert: treat like warning
+
+File "alrt.ml", line 25, characters 9-10:
+25 |   val x: t [@@ocaml.deprecated]
+  ^
+Alert deprecated: t
+
+
 * Backtrace messages
 
 Before 4.11:
diff --git a/tuareg-tests.el b/tuareg-tests.el
index c336ef1..da1ca32 100644
--- a/tuareg-tests.el
+++ b/tuareg-tests.el
@@ -460,6 +460,11 @@ Returns the value of the last FORM."
  ((1 error "main.ml" 13 13 34 34)
   (225 info "main.ml" 10 10 2 40)
   (308 info "main.ml" 7 7 0 31)))
+(("File \"alrt.ml\", line 25, characters 9-10:\n"
+  "25 |   val x: t [@@ocaml.deprecated]\n"
+  "  ^\n"
+  "Alert deprecated: t\n")
+ ((1 warning "alrt.ml" 25 25 9 9)))
 (("Fatal error: exception Bad.Disaster(\"oh no!\")\n"
   "Raised at file \"bad.ml\", line 5, characters 4-22\n"
   "Called from file \"worse.ml\" (inlined), line 9, characters 2-5\n"
diff --git a/tuareg.el b/tuareg.el
index 3222ca1..ae00426 100644
--- a/tuareg.el
+++ b/tuareg.el
@@ -3206,10 +3206,9 @@ Short cuts for interactions with the REPL:
 (+ "^"))
 "\n"
 (* (in "\t ")))
- (group-n 8 "Warning"   ; 8: WARNING
-(? " " (+ (in "0-9")))
-(? " [" (+ (in "a-z0-9-")) "]")
-":")))
+ (group-n 8 (or "Warning" "Alert")  ; 8: WARNING
+  (* (not (in ":\n")))
+  ":")))
   "Regular expression matching the error messages produced by ocamlc/ocamlopt.
 Also matches source references in exception backtraces.")
 



[elpa] externals/taxy 1699d3a 15/39: Docs: Clarify

2021-08-27 Thread ELPA Syncer
branch: externals/taxy
commit 1699d3ad22f07fb83b691a919c9387aa0fe9182d
Author: Adam Porter 
Commit: Adam Porter 

Docs: Clarify
---
 README.org | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/README.org b/README.org
index 45cf19a..59679a9 100644
--- a/README.org
+++ b/README.org
@@ -12,7 +12,7 @@ This library provides a programmable way to classify 
arbitrary objects into a hi
 
 Helpful features include:
 
-+  Dynamic taxonomies :: Objects may be classified into hierarchies determined 
at runtime based on their attributes.
++  Dynamic taxonomies :: Objects may be classified into hierarchies 
automatically defined at runtime based on their attributes.
 +  Reusable taxonomies :: Taxonomy definitions may be stored in variables and 
reused in other taxonomies' descendant groups.
 
 * Example



[elpa] externals/taxy 4e132ab 28/39: Docs: Tidy

2021-08-27 Thread ELPA Syncer
branch: externals/taxy
commit 4e132ab350aff925e7091ecbc459974329d2854e
Author: Adam Porter 
Commit: Adam Porter 

Docs: Tidy
---
 README.org | 14 +++---
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/README.org b/README.org
index 722e0a6..ff82761 100644
--- a/README.org
+++ b/README.org
@@ -36,20 +36,20 @@ Helpful features include:
 # :PROPERTIES:
 # :TOC:  :depth 0
 # :END:
-# 
+#
 # ** MELPA
-# 
+#
 # If you installed from MELPA, you're done.  Just run one of the commands 
below.
-# 
+#
 # ** Manual
-# 
+#
 #   Install these required packages:
-# 
+#
 #   + =foo=
 #   + =bar=
-# 
+#
 #   Then put this file in your load-path, and put this in your init file:
-# 
+#
 #   #+BEGIN_SRC elisp
 # (require 'taxy)
 #   #+END_SRC



[elpa] externals/taxy f0b926f 34/39: Add: Diredy example

2021-08-27 Thread ELPA Syncer
branch: externals/taxy
commit f0b926f48f5826054d3d537afe799069c3fb3c85
Author: Adam Porter 
Commit: Adam Porter 

Add: Diredy example
---
 examples/README.org |  12 ++
 examples/diredy.el  | 103 
 images/diredy.png   | Bin 0 -> 33772 bytes
 3 files changed, 115 insertions(+)

diff --git a/examples/README.org b/examples/README.org
index 06d7325..1820f59 100644
--- a/examples/README.org
+++ b/examples/README.org
@@ -2,6 +2,18 @@
 
 Some example applcations using ~taxy~.
 
+* Diredy
+
+[[file:diredy.el][Diredy]] rearranges a Dired buffer, grouping files and 
directories by their size and MIME type.  Use it like:
+
+#+BEGIN_SRC elisp
+  (require 'diredy)
+#+END_SRC
+
+Then open a Dired buffer and =M-x diredy RET=, and it will be rearranged like 
so:
+
+[[../images/diredy.png]]
+
 * Musicy
 
 [[file:musicy.el][Musicy]] displays a music library in a ~magit-section~ 
buffer.  Use it like:
diff --git a/examples/diredy.el b/examples/diredy.el
new file mode 100644
index 000..c951664
--- /dev/null
+++ b/examples/diredy.el
@@ -0,0 +1,103 @@
+;;; diredy.el --- Flexible grouping for files in Dired buffers  -*- 
lexical-binding: t; -*-
+
+;; Copyright (C) 2021  Adam Porter
+
+;; Author: Adam Porter 
+;; Keywords: convenience
+
+;; This program is free software; you can redistribute it and/or modify
+;; it under the terms of the GNU General Public License as published by
+;; the Free Software Foundation, either version 3 of the License, or
+;; (at your option) any later version.
+
+;; 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, see .
+
+;;; Commentary:
+
+;; This library provides a command, `diredy', that rearranges a Dired
+;; buffer into a hierarchy by file size and MIME type.
+
+;;; Code:
+
+ Requirements
+
+(require 'taxy)
+(require 'taxy-magit-section)
+
+(require 'dired)
+(require 'mailcap)
+
+ Variables
+
+(defvar diredy-taxy
+  (cl-labels ((file-name
+   (string) (let* ((start (text-property-not-all 0 (length string) 
'dired-filename nil string))
+   (end (text-property-any start (length string) 
'dired-filename nil string)))
+  (substring string start end)))
+  (file-extension
+   (filename) (file-name-extension filename))
+  (file-type (string)
+ (when-let ((extension (file-extension (file-name 
string
+   (mailcap-extension-to-mime extension)))
+  (file-size
+   (filename) (file-attribute-size (file-attributes filename)))
+  (file-size-group
+   (string) (pcase (file-size (file-name string))
+  ('nil "No size")
+  ((pred (> 1024))
+   "< 1K")
+  ((pred (> 102400))
+   "< 100K")
+  ((pred (> 1048576))
+   "< 1M")
+  ((pred (> 10485760))
+   "< 10M")
+  (_ ">= 10M")))
+  (file-dir? (string) (if (file-directory-p (file-name string))
+  "Directory" "File")))
+(make-taxy
+ :name "Diredy"
+ :taxys (list (make-taxy :name "Types"
+ :take (apply-partially #'taxy-take-keyed* (list 
#'file-dir? #'file-size-group #'file-type)))
+
+(defvar dired-mode)
+
+ Customization
+
+
+ Commands
+
+(defun diredy ()
+  "Apply grouping to current Dired buffer."
+  (interactive)
+  (cl-assert (eq 'dired-mode major-mode))
+  (use-local-map (make-composed-keymap (list dired-mode-map 
magit-section-mode-map)))
+  (save-excursion
+(goto-char (point-min))
+(forward-line 2)
+(let* ((lines (save-excursion
+(cl-loop until (eobp)
+ collect (buffer-substring (point-at-bol) 
(point-at-eol))
+ do (forward-line 1
+   (filled-taxy (thread-last diredy-taxy
+  taxy-emptied
+  (taxy-fill lines)))
+   (inhibit-read-only t)
+   (taxy-magit-section-indent 2))
+  (delete-region (point) (point-max))
+  (taxy-magit-section-insert filled-taxy :objects 'first
+
+ Functions
+
+
+ Footer
+
+(provide 'diredy)
+
+;;; diredy.el ends here
diff --git a/images/diredy.png b/images/diredy.png
new file mode 100644
index 000..4e8f3e5
Binary files /dev/null and b/images/diredy.png differ



[elpa] externals/taxy 906d387 30/39: Fix: (taxy-magit-section-pp) Use magit-section-mode

2021-08-27 Thread ELPA Syncer
branch: externals/taxy
commit 906d38757660dcdd8b1d09d94ec8241cf709c8d4
Author: Adam Porter 
Commit: Adam Porter 

Fix: (taxy-magit-section-pp) Use magit-section-mode
---
 taxy-magit-section.el | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/taxy-magit-section.el b/taxy-magit-section.el
index afad87c..932e917 100644
--- a/taxy-magit-section.el
+++ b/taxy-magit-section.el
@@ -43,8 +43,7 @@
 (cl-defun taxy-magit-section-pp (taxy &key (objects 'first))
   "Pretty-print TAXY into a buffer with `magit-section' and show it."
   (with-current-buffer (get-buffer-create "*taxy-magit-section-pp*")
-(setf buffer-read-only t)
-(use-local-map magit-section-mode-map)
+(magit-section-mode)
 (let ((inhibit-read-only t))
   (erase-buffer)
   (taxy-magit-section-insert taxy :objects objects))



[elpa] externals/taxy a7ffe21 37/39: Change: (diredy) Sort taxys

2021-08-27 Thread ELPA Syncer
branch: externals/taxy
commit a7ffe2191f2fb1c2852dcac40202782155e629bd
Author: Adam Porter 
Commit: Adam Porter 

Change: (diredy) Sort taxys
---
 examples/diredy.el | 6 +-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/examples/diredy.el b/examples/diredy.el
index c951664..acfb9f5 100644
--- a/examples/diredy.el
+++ b/examples/diredy.el
@@ -87,7 +87,11 @@
  do (forward-line 1
(filled-taxy (thread-last diredy-taxy
   taxy-emptied
-  (taxy-fill lines)))
+  (taxy-fill lines)
+  (taxy-mapc* (lambda (taxy)
+(setf (taxy-taxys taxy)
+  (cl-sort (taxy-taxys taxy) 
#'string<
+   :key #'taxy-name))
(inhibit-read-only t)
(taxy-magit-section-indent 2))
   (delete-region (point) (point-max))



[nongnu] elpa/tuareg 4c4fad3 5/5: Work around bug in Emacs 26 and older

2021-08-27 Thread ELPA Syncer
branch: elpa/tuareg
commit 4c4fad3c096876939ea0a329638a1825786cfc26
Author: Mattias Engdegård 
Commit: Christophe Troestler 

Work around bug in Emacs 26 and older

Block test failures caused by a compilation-mode bug in old Emacs
versions; see https://debbugs.gnu.org/cgi/bugreport.cgi?bug=34479
---
 tuareg-tests.el | 13 ++---
 1 file changed, 10 insertions(+), 3 deletions(-)

diff --git a/tuareg-tests.el b/tuareg-tests.el
index da1ca32..b24f495 100644
--- a/tuareg-tests.el
+++ b/tuareg-tests.el
@@ -569,9 +569,16 @@ Return (FILE TYPE START-LINE END-LINE START-COL END-COL)."
 ;; aa5437493b1ca539409495ecdc54cf420ea110b9.
 (when buggy-emacs-28
   (setq end-col (1- end-col)))
-(should (equal (tuareg-test--extract-message-info str pos)
-   (list file type
- start-line end-line start-col end-col)
+(let ((message-info (tuareg-test--extract-message-info str pos)))
+  (when (< emacs-major-version 27)
+;; Prior to Emacs 27, a bug in compilation-mode caused the
+;; message type to be wrong in some cases (Emacs bug#34479).
+;; Pretend that the test passed anyway.
+(setq type (nth 1 message-info)))
+  (should (equal message-info
+ (list file type
+   start-line end-line
+   start-col end-col))
 
 (defun tuareg-test--comment-region (text)
   (with-temp-buffer



[nongnu] elpa/tuareg 95f3b01 1/5: Explicit group numbering in error regexp

2021-08-27 Thread ELPA Syncer
branch: elpa/tuareg
commit 95f3b01a5f1af24cc1cd427c5f8e16b551ba57fd
Author: Mattias Engdegård 
Commit: Christophe Troestler 

Explicit group numbering in error regexp

This refactoring makes it easier to change the regexp without
renumbering them all each time a group is added or removed.
---
 tuareg.el | 16 
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/tuareg.el b/tuareg.el
index 5e5c39c..5dd9429 100644
--- a/tuareg.el
+++ b/tuareg.el
@@ -3173,7 +3173,7 @@ Short cuts for interactions with the REPL:
 (defconst tuareg--error-regexp
   (rx bol
   (* " ")
-  (group; 1: HIGHLIGHT
+  (group-n 1; 1: HIGHLIGHT
(or "File "
;; Exception backtrace.
(seq
@@ -3181,16 +3181,16 @@ Short cuts for interactions with the REPL:
 "Called from")
 (* nonl); OCaml ≥4.11: " FUNCTION in"
 " file "))
-   (group (? "\"")) ; 2
-   (group (+ (not (in "\t\n \",<>"  ; 3: FILE
+   (group-n 2 (? "\"")) ; 2
+   (group-n 3 (+ (not (in "\t\n \",<>"  ; 3: FILE
(backref 2)
(? " (inlined)")
", line" (? "s") " "
-   (group (+ (in "0-9")))   ; 4: LINE-START
-   (? "-" (group (+ (in "0-9"   ; 5; LINE-END
+   (group-n 4 (+ (in "0-9")))   ; 4: LINE-START
+   (? "-" (group-n 5 (+ (in "0-9"   ; 5; LINE-END
(? ", character" (? "s") " "
-  (group (+ (in "0-9"))); 6: COL-START
-  (? "-" (group (+ (in "0-9")   ; 7: COL-END
+  (group-n 6 (+ (in "0-9"))); 6: COL-START
+  (? "-" (group-n 7 (+ (in "0-9")   ; 7: COL-END
;; Colon not present in backtraces.
(? ":"))
   (? "\n"
@@ -3201,7 +3201,7 @@ Short cuts for interactions with the REPL:
 (+ "^"))
 "\n"
 (* (in "\t ")))
- (group "Warning"   ; 8: WARNING
+ (group-n 8 "Warning"   ; 8: WARNING
 (? " " (+ (in "0-9")))
 (? " [" (+ (in "a-z0-9-")) "]")
 ":")))



[elpa] externals/taxy a94ab1c 05/39: Tidy

2021-08-27 Thread ELPA Syncer
branch: externals/taxy
commit a94ab1cbd0a6764911bc5200e38f5cfa4b9e422f
Author: Adam Porter 
Commit: Adam Porter 

Tidy
---
 taxy.el | 6 ++
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/taxy.el b/taxy.el
index 0d956dc..4f538c5 100644
--- a/taxy.el
+++ b/taxy.el
@@ -48,11 +48,9 @@
 
 (defun taxy-fill (taxy objects)
   (cl-labels ((apply-object (taxy object)
-(cl-loop with taken
- for taxy in (taxy-taxys taxy)
+(cl-loop for taxy in (taxy-taxys taxy)
  when (funcall (taxy-predicate taxy) 
object)
- do (setf taken t
-  object (if (taxy-take taxy)
+ do (setf object (if (taxy-take taxy)
  (progn
(funcall (taxy-take 
taxy) object taxy)
(funcall (taxy-then 
taxy) object))



[elpa] externals/taxy 02217c4 11/39: Docs: Add comments

2021-08-27 Thread ELPA Syncer
branch: externals/taxy
commit 02217c455233253777469c8abacde709d363d09b
Author: Adam Porter 
Commit: Adam Porter 

Docs: Add comments
---
 README.org | 57 -
 1 file changed, 40 insertions(+), 17 deletions(-)

diff --git a/README.org b/README.org
index b4b07c2..de91bdb 100644
--- a/README.org
+++ b/README.org
@@ -15,12 +15,18 @@ This is a silly taxonomy of numbers below 100:
 #+BEGIN_SRC elisp
   ("Numbery" "A silly taxonomy of numbers."
(("< 10" "Numbers below 10"
+ ;; These numbers are leftovers from the sub-taxys below.
  (0 2 4 6 8)
+ ;; These sub-taxys further classify the numbers below 10 into odd
+ ;; and even.  The odd taxy "consumes" numbers, while the even one
+ ;; doesn't, leaving them to reappear in the parent taxy's objects.
  (("Odd (consuming)"
(1 3 5 7 9))
   ("Even (non-consuming)"
(0 2 4 6 8
 (">= 10" "Numbers above 9"
+ ;; Like in the "< 10" taxy, these numbers are leftovers from this
+ ;; taxy's sub-taxys, three of which are non-consuming.
  (10 11 13 14 17 19 22 23 25 26 29 31 34 35 37 38 41 43 46 47 49 50 53 55 
58
  59 61 62 65 67 70 71 73 74 77 79 82 83 85 86 89 91 94 95 97 98)
  (("Divisible by 3 (non-consuming)"
@@ -29,6 +35,9 @@ This is a silly taxonomy of numbers below 100:
   ("Divisible by 4 (non-consuming)"
(12 16 20 24 28 32 36 40 44 48 52 56 60 64 68 72 76 80 84 88 92 96))
   ("Divisible by 3 or 4 (consuming)"
+   ;; This taxy consumes numbers it takes in, but since these
+   ;; numbers have already been taken in (without being consumed) by
+   ;; the previous two sibling taxys, they may also appear in them.
(12 15 16 18 20 21 24 27 28 30 32 33 36 39 40 42 44 45 48 51 52 54 56 
57 60
63 64 66 68 69 72 75 76 78 80 81 84 87 88 90 92 93 96 99))
   ("Divisible by 5 (non-consuming)"
@@ -48,27 +57,41 @@ You might think about how to produce that by writing some 
imperative code, but =
 :name "< 10"
 :description "Numbers below 10 (consuming)"
 :predicate (lambda (n) (< n 10))
-:taxys (list (make-taxy :name "Odd (consuming)"
-:predicate #'oddp)
- (make-taxy :name "Even (non-consuming)"
-:predicate #'evenp
-:then #'identity)))
+:taxys (list
+;; These sub-taxys further classify the 
numbers below 10 into odd
+;; and even.  The odd taxy "consumes" numbers, 
while the even one
+;; doesn't, leaving them to reappear in the 
parent taxy's objects.
+(make-taxy :name "Odd (consuming)"
+   :predicate #'oddp)
+(make-taxy :name "Even (non-consuming)"
+   :predicate #'evenp
+   :then #'identity)))
(make-taxy
 :name ">= 10"
 :description "Numbers above 9 (consuming)"
 :predicate (lambda (n) (>= n 10))
-:taxys (list (make-taxy :name "Divisible by 3 
(non-consuming)"
-:predicate (lambda (n) (zerop 
(mod n 3)))
-:then #'identity)
- (make-taxy :name "Divisible by 4 
(non-consuming)"
-:predicate (lambda (n) (zerop 
(mod n 4)))
-:then #'identity)
- (make-taxy :name "Divisible by 3 or 4 
(consuming)"
-:predicate (lambda (n) (or 
(zerop (mod n 3))
-   
(zerop (mod n 4)
- (make-taxy :name "Divisible by 5 
(non-consuming)"
-:predicate (lambda (n) (zerop 
(mod n 5)))
-:then #'identity))
+:taxys (list
+;; Like in the "< 10" taxy, these sub-taxys 
further classify
+;; the numbers, but only one of them consumes 
numbers it
+;; takes in, leaving the rest to reappear in 
the parent taxy.
+(make-taxy :name "Divisible by 3 
(non-consuming)"
+   :predicate (lambda (n) (zerop (mod 
n 3)))
+   :then #'

[elpa] externals/taxy c60a96f 12/39: Change: Rename taxy-simple

2021-08-27 Thread ELPA Syncer
branch: externals/taxy
commit c60a96f91a1ffe08bc592093b376ee56e2d9a12b
Author: Adam Porter 
Commit: Adam Porter 

Change: Rename taxy-simple
---
 README.org | 10 +-
 taxy.el|  4 ++--
 2 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/README.org b/README.org
index de91bdb..fcef2ee 100644
--- a/README.org
+++ b/README.org
@@ -93,10 +93,10 @@ You might think about how to produce that by writing some 
imperative code, but =
:predicate (lambda (n) (zerop (mod 
n 5)))
:then #'identity))
 (numbers (cl-loop for i below 100 collect i)))
-(taxy-simple (taxy-fill (reverse numbers) numbery)))
+(taxy-plain (taxy-fill (reverse numbers) numbery)))
 #+END_SRC
 
-The ~taxy-fill~ function applies the numbers in a "cascade" down the hierarchy 
of "taxys", and the ~taxy-simple~ function returns a meaningful subset of the 
taxys' slots, suitable for display.
+The ~taxy-fill~ function applies the numbers in a "cascade" down the hierarchy 
of "taxys", and the ~taxy-plain~ function returns a meaningful subset of the 
taxys' slots, suitable for display.
 
 * Contents :noexport:
 :PROPERTIES:
@@ -158,7 +158,7 @@ The ~:then~ function determines what happens to an object 
after being taken in:
 
 After defining a taxy, call ~taxy-fill~ with it and a list of objects to fill 
the taxy's hierarchy.  *Note:* ~taxy-fill~ modifies the taxy given to it 
(filling its ~:objects~ and those of its ~:taxys~), so when using a statically 
defined taxy (e.g. one defined with ~defvar~), you should pass ~taxy-fill~ a 
taxy copied with ~taxy-copy~, which recursively copies a taxy without 
~:objects~.
 
-To return a taxy in a more human-readable format (with only relevant fields 
included), use ~taxy-simple~.  You may also use ~taxy-apply~ to replace objects 
in a taxy with, e.g. a more useful representation.
+To return a taxy in a more human-readable format (with only relevant fields 
included), use ~taxy-plain~.  You may also use ~taxy-apply~ to replace objects 
in a taxy with, e.g. a more useful representation.
 
 ** Dynamic taxys
 
@@ -177,7 +177,7 @@ You may not always know in advance what taxonomy a set of 
objects fits into, so
   :take (apply-partially #'taxy-take-keyed 
#'buffery-major-mode)
 
   ;; Note the use of `taxy-copy' to avoid mutating the original taxy 
definition.
-  (taxy-simple
+  (taxy-plain
(taxy-fill (buffer-list)
   (taxy-copy buffery)))
 #+END_SRC
@@ -266,7 +266,7 @@ Using those defined taxys, we then fill the ~ement-roomy~ 
taxy with all of the r
 
 #+BEGIN_SRC elisp
   (let ((ement-session (alist-get "@USER:HOST" ement-sessions nil nil 
#'equal)))
-(taxy-simple
+(taxy-plain
  (taxy-apply (lambda (room)
(setf room (list (ement-room--room-display-name room)
 (ement-room-id room
diff --git a/taxy.el b/taxy.el
index 7aafb88..a7d4073 100644
--- a/taxy.el
+++ b/taxy.el
@@ -67,13 +67,13 @@
 (dolist (object objects taxy)
   (apply-object taxy object
 
-(defun taxy-simple (taxy)
+(defun taxy-plain (taxy)
   "Return a list of the human-readable parts of TAXY."
   (delq nil
 (list (taxy-name taxy)
   (taxy-description taxy)
   (taxy-objects taxy)
-  (mapcar #'taxy-simple (taxy-taxys taxy)
+  (mapcar #'taxy-plain (taxy-taxys taxy)
 
 (defun taxy-copy (taxy)
   "Return a copy of TAXY without objects.



[elpa] externals/taxy d355d3a 14/39: Docs: Add mascot

2021-08-27 Thread ELPA Syncer
branch: externals/taxy
commit d355d3a523cd43b863293787a332aebf7268225a
Author: Adam Porter 
Commit: Adam Porter 

Docs: Add mascot
---
 README.org|   7 +++
 images/mascot.png | Bin 0 -> 114906 bytes
 2 files changed, 7 insertions(+)

diff --git a/README.org b/README.org
index f6bbb51..45cf19a 100644
--- a/README.org
+++ b/README.org
@@ -4,10 +4,17 @@
 
 # Note: This readme works with the org-make-toc 
 package, which automatically 
updates the table of contents.
 
+#+HTML: 
+
 # 
[[https://melpa.org/#/package-name][file:https://melpa.org/packages/taxy-badge.svg]]
 
[[https://stable.melpa.org/#/package-name][file:https://stable.melpa.org/packages/taxy-badge.svg]]
 
 This library provides a programmable way to classify arbitrary objects into a 
hierarchical taxonomy.  (That's a lot of fancy words to say that this lets you 
put things in nested groups.)
 
+Helpful features include:
+
++  Dynamic taxonomies :: Objects may be classified into hierarchies determined 
at runtime based on their attributes.
++  Reusable taxonomies :: Taxonomy definitions may be stored in variables and 
reused in other taxonomies' descendant groups.
+
 * Example
 
 This is a silly taxonomy of numbers below 100:
diff --git a/images/mascot.png b/images/mascot.png
new file mode 100644
index 000..919e45e
Binary files /dev/null and b/images/mascot.png differ



[elpa] externals/taxy 4686e03 36/39: Add: (taxy-size)

2021-08-27 Thread ELPA Syncer
branch: externals/taxy
commit 4686e03bc81c32322ff15edcf32996ecd495c659
Author: Adam Porter 
Commit: Adam Porter 

Add: (taxy-size)
---
 images/diredy.png | Bin 33772 -> 36255 bytes
 taxy-magit-section.el |   7 +--
 taxy.el   |   7 +++
 3 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/images/diredy.png b/images/diredy.png
index 4e8f3e5..7e84fb4 100644
Binary files a/images/diredy.png and b/images/diredy.png differ
diff --git a/taxy-magit-section.el b/taxy-magit-section.el
index d14f36b..1760b52 100644
--- a/taxy-magit-section.el
+++ b/taxy-magit-section.el
@@ -65,8 +65,11 @@ descendant taxys; if `last', insert them after descendants."
   (magit-insert-heading
 (make-string (* depth taxy-magit-section-indent) ? 
)
 (propertize (taxy-name taxy) 'face 
'magit-section-heading)
-(when (taxy-description taxy)
-  (concat " (" (taxy-description taxy) ")")))
+(format " (%s%s)"
+(if (taxy-description taxy)
+(concat (taxy-description taxy) " ")
+  "")
+(taxy-size taxy)))
   (magit-insert-section-body
 (when (eq 'first objects)
   (mapc #'insert-object (taxy-objects taxy)))
diff --git a/taxy.el b/taxy.el
index 6ba04a5..334d1c8 100644
--- a/taxy.el
+++ b/taxy.el
@@ -175,6 +175,13 @@ by KEY-NAME-FN called with OBJECT."
   (taxy-take-keyed* (cdr key-fns) object taxy)
 (push object (taxy-objects taxy))
 
+(defun taxy-size (taxy)
+  "Return the number of objects TAXY holds.
+Includes objects in TAXY's sub-taxys."
+  (cl-loop for sub-taxy in (taxy-taxys taxy)
+   sum (taxy-size sub-taxy) into total
+   finally return (+ total (length (taxy-objects taxy)
+
  Footer
 
 (provide 'taxy)



[elpa] externals/taxy a17e540 35/39: Docs: Show examples

2021-08-27 Thread ELPA Syncer
branch: externals/taxy
commit a17e5407fbe9d0bb351ba366584831831ef4c6bd
Author: Adam Porter 
Commit: Adam Porter 

Docs: Show examples
---
 README.org |  7 ++-
 taxy.info  | 28 
 2 files changed, 22 insertions(+), 13 deletions(-)

diff --git a/README.org b/README.org
index 168a687..94f5c24 100644
--- a/README.org
+++ b/README.org
@@ -202,7 +202,12 @@ That's better:
 
 ** Example applications
 
-Some example applications may be found in the 
[[file:examples/README.org][examples directory]].
+Some example applications may be found in the 
[[file:examples/README.org][examples directory]]:
+
++  Diredy rearranges a Dired buffer into groups by file size and type:
+   [[images/diredy.png]]
++  Musicy shows a music library with tracks categorized by genre, artist, 
year, album, etc:
+   [[images/musicy.png]]
 
 * Usage
 :PROPERTIES:
diff --git a/taxy.info b/taxy.info
index ccb6d37..c8e4df4 100644
--- a/taxy.info
+++ b/taxy.info
@@ -226,7 +226,11 @@ File: README.info,  Node: Example applications,  Up: 
Examples
 
 
 Some example applications may be found in the examples directory
-(examples/README.org).
+(examples/README.org):
+
+   • Diredy rearranges a Dired buffer into groups by file size and type:
+   • Musicy shows a music library with tracks categorized by genre,
+ artist, year, album, etc:
 
 
 File: README.info,  Node: Usage,  Next: Changelog,  Prev: Examples,  Up: Top
@@ -599,17 +603,17 @@ Tag Table:
 Node: Top218
 Node: Examples1164
 Node: Example applications9099
-Node: Usage9304
-Node: Dynamic taxys11421
-Node: Multi-level dynamic taxys13839
-Node: Reusable taxys16002
-Node: Threading macros20171
-Node: Modifying filled taxys20710
-Node: Magit section21803
-Node: Changelog22404
-Node: 01-pre22542
-Node: Development22636
-Node: License22807
+Node: Usage9481
+Node: Dynamic taxys11598
+Node: Multi-level dynamic taxys14016
+Node: Reusable taxys16179
+Node: Threading macros20348
+Node: Modifying filled taxys20887
+Node: Magit section21980
+Node: Changelog22581
+Node: 01-pre22719
+Node: Development22813
+Node: License22984
 
 End Tag Table
 



[elpa] externals/taxy 34aa94d 23/39: Add: taxy-magit-section

2021-08-27 Thread ELPA Syncer
branch: externals/taxy
commit 34aa94df48791d74fdd41412627968d7482425ba
Author: Adam Porter 
Commit: Adam Porter 

Add: taxy-magit-section

This is so simple!
---
 README.org   | 132 ---
 images/magit-section-numbery.png | Bin 0 -> 18985 bytes
 taxy-magit-section.el|  84 +
 3 files changed, 165 insertions(+), 51 deletions(-)

diff --git a/README.org b/README.org
index 9c46940..2e40b12 100644
--- a/README.org
+++ b/README.org
@@ -27,6 +27,7 @@ Helpful features include:
   - [[#dynamic-taxys][Dynamic taxys]]
   - [[#reusable-taxys][Reusable taxys]]
   - [[#threading-macros][Threading macros]]
+  - [[#magit-section][Magit section]]
 - [[#changelog][Changelog]]
 - [[#development][Development]]
 :END:
@@ -65,27 +66,27 @@ Let's imagine a silly taxonomy of numbers below 100:
  ;; These sub-taxys further classify the numbers below 10 into odd
  ;; and even.  The odd taxy "consumes" numbers, while the even one
  ;; doesn't, leaving them to reappear in the parent taxy's objects.
- (("Odd (consuming)"
+ (("Odd" "(consuming)"
(1 3 5 7 9))
-  ("Even (non-consuming)"
+  ("Even" "(non-consuming)"
(0 2 4 6 8
 (">= 10" "Numbers above 9"
  ;; Like in the "< 10" taxy, these numbers are leftovers from this
  ;; taxy's sub-taxys, three of which are non-consuming.
  (10 11 13 14 17 19 22 23 25 26 29 31 34 35 37 38 41 43 46 47 49 50 53 55 
58
  59 61 62 65 67 70 71 73 74 77 79 82 83 85 86 89 91 94 95 97 98)
- (("Divisible by 3 (non-consuming)"
+ (("Divisible by 3" "(non-consuming)"
(12 15 18 21 24 27 30 33 36 39 42 45 48 51 54 57 60 63 66 69 72 75 78 
81 84
87 90 93 96 99))
-  ("Divisible by 4 (non-consuming)"
+  ("Divisible by 4" "(non-consuming)"
(12 16 20 24 28 32 36 40 44 48 52 56 60 64 68 72 76 80 84 88 92 96))
-  ("Divisible by 3 or 4 (consuming)"
+  ("Divisible by 3 or 4" "(consuming)"
;; This taxy consumes numbers it takes in, but since these
;; numbers have already been taken in (without being consumed) by
;; the previous two sibling taxys, they may also appear in them.
(12 15 16 18 20 21 24 27 28 30 32 33 36 39 40 42 44 45 48 51 52 54 56 
57 60
63 64 66 68 69 72 75 76 78 80 81 84 87 88 90 92 93 96 99))
-  ("Divisible by 5 (non-consuming)"
+  ("Divisible by 5" "(non-consuming)"
(10 25 35 50 55 65 70 85 95))
 #+END_SRC
 
@@ -94,51 +95,61 @@ You might think about how to produce that by writing some 
imperative code, but =
 #+BEGIN_SRC elisp :exports code
   (require 'taxy)
 
-  (let ((numbery
- (make-taxy
-  :name "Numbery"
-  :description "A silly taxonomy of numbers."
-  :taxys (list (make-taxy
-:name "< 10"
-:description "Numbers below 10 (consuming)"
-:predicate (lambda (n) (< n 10))
-:taxys (list
-;; These sub-taxys further classify the 
numbers below 10 into odd
-;; and even.  The odd taxy "consumes" numbers, 
while the even one
-;; doesn't, leaving them to reappear in the 
parent taxy's objects.
-(make-taxy :name "Odd (consuming)"
-   :predicate #'oddp)
-(make-taxy :name "Even (non-consuming)"
-   :predicate #'evenp
-   :then #'identity)))
-   (make-taxy
-:name ">= 10"
-:description "Numbers above 9 (consuming)"
-:predicate (lambda (n) (>= n 10))
-:taxys (list
-;; Like in the "< 10" taxy, these sub-taxys 
further classify
-;; the numbers, but only one of them consumes 
numbers it
-;; takes in, leaving the rest to reappear in 
the parent taxy.
-(make-taxy :name "Divisible by 3 
(non-consuming)"
-   :predicate (lambda (n) (zerop (mod 
n 3)))
-   :then #'identity)
-(make-taxy :name "Divisible by 4 
(non-consuming)"
-   :predicate (lambda (n) (zerop (mod 
n 4)))
-   :then #'identity)
-(make-taxy :name "Divisible by 3 or 4 
(consuming)"
-   ;; Since this taxy's `:then' 
function is unset,
-   ;; it defaults to `ignore', which 
causes it to
-   ;; consume num

[nongnu] elpa/tuareg 5872d6b 2/5: Treat ancillary locations as messages at Info level, not Error

2021-08-27 Thread ELPA Syncer
branch: elpa/tuareg
commit 5872d6b0b1e3762176855792b1e044da5d7c062a
Author: Mattias Engdegård 
Commit: Christophe Troestler 

Treat ancillary locations as messages at Info level, not Error

Leading spaces (before the `File`) are assumed to indicate an
ancillary location. This is mostly true but not for warnings.
---
 tuareg-tests.el |  4 ++--
 tuareg.el   | 10 --
 2 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/tuareg-tests.el b/tuareg-tests.el
index 7118a4b..c336ef1 100644
--- a/tuareg-tests.el
+++ b/tuareg-tests.el
@@ -458,8 +458,8 @@ Returns the value of the last FORM."
   "   File \"main.ml\", line 7, characters 0-32:\n"
   " Definition of module M/2\n")
  ((1 error "main.ml" 13 13 34 34)
-  (225 error "main.ml" 10 10 2 40)
-  (308 error "main.ml" 7 7 0 31)))
+  (225 info "main.ml" 10 10 2 40)
+  (308 info "main.ml" 7 7 0 31)))
 (("Fatal error: exception Bad.Disaster(\"oh no!\")\n"
   "Raised at file \"bad.ml\", line 5, characters 4-22\n"
   "Called from file \"worse.ml\" (inlined), line 9, characters 2-5\n"
diff --git a/tuareg.el b/tuareg.el
index 5dd9429..3222ca1 100644
--- a/tuareg.el
+++ b/tuareg.el
@@ -3172,7 +3172,12 @@ Short cuts for interactions with the REPL:
 
 (defconst tuareg--error-regexp
   (rx bol
-  (* " ")
+  ;; Require either zero or 7 leading spaces, to avoid matching
+  ;; Python tracebacks. Assume that spaces mean that this is an
+  ;; ancillary location that should have level Info.
+  ;; FIXME: Ancillary locations for warnings probably have no spaces
+  ;; and are now treated as errors. Fortunately these are rare.
+  (? (group-n 9 "   ")) ; 9: INFO
   (group-n 1; 1: HIGHLIGHT
(or "File "
;; Exception backtrace.
@@ -3220,7 +3225,8 @@ OCaml uses exclusive end-columns but Emacs wants them to 
be inclusive."
 (when (boundp 'compilation-error-regexp-alist-alist)
   (setq compilation-error-regexp-alist-alist
 (assq-delete-all 'ocaml compilation-error-regexp-alist-alist))
-  (push `(ocaml ,tuareg--error-regexp 3 (4 . 5) (6 . tuareg--end-column) (8) 1
+  (push `(ocaml ,tuareg--error-regexp 3 (4 . 5) (6 . tuareg--end-column)
+(8 . 9) 1
 (8 font-lock-function-name-face))
 compilation-error-regexp-alist-alist))
 



[nongnu] elpa/tuareg b62d4ee 4/5: Add genuine example of warning with ancillary locations

2021-08-27 Thread ELPA Syncer
branch: elpa/tuareg
commit b62d4ee28939af67d178ade03546dee7a8dca851
Author: Mattias Engdegård 
Commit: Christophe Troestler 

Add genuine example of warning with ancillary locations

Remove the previous such examples in compilation.txt as they were all
fake (error messages edited to pass as warnings).
---
 compilation.txt | 36 
 1 file changed, 16 insertions(+), 20 deletions(-)

diff --git a/compilation.txt b/compilation.txt
index d88a348..df2b784 100644
--- a/compilation.txt
+++ b/compilation.txt
@@ -93,26 +93,6 @@ Error: This expression has type M/2.t but an expression was 
expected of type
File "main.ml", line 7, characters 0-32:
  Definition of module M/2
 
-File "main.ml", line 13, characters 34-35:
-13 |   let f : M.t -> M.t = fun M.C -> y
-   ^
-Warning 3: This expression has type M/2.t but an expression was expected of 
type
- M/1.t
-   File "main.ml", lines 10-12, characters 2-5:
- Definition of module M/1
-   File "main.ml", line 7, characters 0-32:
- Definition of module M/2
-
-File "main.ml", line 13, characters 34-35:
-13 |   let f : M.t -> M.t = fun M.C -> y
-   ^
-Warning 3: This expression has type M/2.t but an expression was expected of 
type
- M/1.t
-   File "main.ml", lines 10-12, characters 2-5:
- Definition of module M/1
-   File "main.ml", line 7, characters 0-32:
- Definition of module M/2
-
 
 * Since OCaml 4.12, warnings come with mnemonics.
 
@@ -122,6 +102,22 @@ File "moo.ml", line 6, characters 6-10:
 Warning 26 [unused-var]: unused variable fish.
 
 
+* Example of a warning with ancillary locations
+
+File "urk.ml", line 1:
+Warning 63 [erroneous-printed-signature]: The printed interface differs from 
the inferred interface.
+The inferred interface contained items which could not be printed
+properly due to name collisions between identifiers.
+File "urk.ml", lines 23-25, characters 2-5:
+  Definition of module M/1
+File "urk.ml", lines 17-20, characters 0-3:
+  Definition of module M/2
+Beware that this warning is purely informational and will not catch
+all instances of erroneous printed interface.
+module M : sig type t val v : t end
+module F : sig module M : sig val v : M.t end val v : M/2.t end
+
+
 * Alert: treat like warning
 
 File "alrt.ml", line 25, characters 9-10:



[elpa] externals/javaimp updated (fc39dc0 -> 691f0ec)

2021-08-27 Thread Filipp Gunbin
fgunbin pushed a change to branch externals/javaimp.

  from  fc39dc0   Use already existing buffer for 
javaimp--get-file-classes, if there is one
   new  d7d4c72   Add class abstract methods to imenu support
   new  691f0ec   Imenu & scopes improvements


Summary of changes:
 javaimp-parse.el | 143 ++--
 javaimp-tests.el | 281 +++
 javaimp-util.el  |  61 ++--
 javaimp.el   |  97 ++-
 4 files changed, 310 insertions(+), 272 deletions(-)



[elpa] externals/javaimp 691f0ec 2/2: Imenu & scopes improvements

2021-08-27 Thread Filipp Gunbin
branch: externals/javaimp
commit 691f0ec7a0aee8f598bae969508c0b7b3966c7d6
Author: Filipp Gunbin 
Commit: Filipp Gunbin 

Imenu & scopes improvements
---
 javaimp-parse.el |  83 --
 javaimp-tests.el | 204 +++
 javaimp-util.el  |  61 -
 javaimp.el   |  97 +++---
 4 files changed, 230 insertions(+), 215 deletions(-)

diff --git a/javaimp-parse.el b/javaimp-parse.el
index 460e615..130edff 100644
--- a/javaimp-parse.el
+++ b/javaimp-parse.el
@@ -208,8 +208,7 @@ is unchanged."
 the position of opening brace.")
 
 (defun javaimp--parse-scope-class (brace-pos)
-  "Attempts to parse 'class' / 'interface' / 'enum' scope.  Some of
-those may later become 'local-class' (see `javaimp--parse-scopes')."
+  "Attempts to parse 'class' / 'interface' / 'enum' scope."
   (save-excursion
 (if (javaimp--parse-preceding (regexp-opt 
javaimp--parse-classlike-keywords 'symbols)
   brace-pos)
@@ -334,8 +333,9 @@ those may later become 'local-class' (see 
`javaimp--parse-scopes')."
   :open-brace brace-pos))
 
 (defun javaimp--parse-scopes (count)
-  "Attempts to parse COUNT enclosing scopes at point.  If COUNT is
-nil then goes all the way up.  Examines and sets property
+  "Attempts to parse COUNT enclosing scopes at point.  Returns most
+nested one, with its parents sets accordingly.  If COUNT is nil
+then goes all the way up.  Examines and sets property
 'javaimp-parse-scope' at each scope's open brace."
   (let ((state (syntax-ppss))
 res)
@@ -356,19 +356,12 @@ nil then goes all the way up.  Examines and sets property
 (if (javaimp-scope-start scope)
 (goto-char (javaimp-scope-start scope)
 (setq state (syntax-ppss
-;; if a class is enclosed in anything other than a class, then it
-;; should be local
-(let ((tmp res)
-  in-local parent)
-  (while tmp
-(if (javaimp--is-classlike (car tmp))
-(when in-local
-  (setf (javaimp-scope-type (car tmp)) 'local-class))
-  (setq in-local t))
-(setf (javaimp-scope-parent (car tmp)) parent)
-(setq parent (car tmp))
-(setq tmp (cdr tmp
-res))
+(let (parent)
+  (while res
+(setf (javaimp-scope-parent (car res)) parent)
+(setq parent (car res))
+(setq res (cdr res)))
+  parent)))
 
 (defun javaimp--parse-all-scopes ()
   "Entry point to the scope parsing.  Parses scopes in this
@@ -403,20 +396,26 @@ non-nil.  Resets this variable after parsing is done."
(javaimp--parse-rsb-keyword ";" nil t -1)
;; we're in the same nest
(= (nth 1 (syntax-ppss)) enclosing))
-  (backward-char) ;skip semicolon
+  (backward-char)  ;skip semicolon
   ;; now parse as normal method scope
   (when-let ((scope (javaimp--parse-scope-method-or-stmt (point)))
- ;; note that an abstract method with no parents
- ;; will be ignored
- (parents (javaimp--parse-scopes nil)))
-(setf (javaimp-scope-parent scope) (car (last parents)))
+ ;; note that an abstract method with no
+ ;; parents will be ignored
+ (parent (javaimp--parse-scopes nil)))
+(setf (javaimp-scope-parent scope) (javaimp--copy-scope 
parent))
 (push scope res)))
 res))
 
+(defun javaimp--parse-abstract-interface-methods ()
+  ;; TODO
+  )
+
+
 
 ;; Functions intended to be called from other parts of javaimp.
 
 (defun javaimp--parse-get-package ()
+  "Return the package declared in the current file."
   (save-excursion
 (save-restriction
   (widen)
@@ -425,39 +424,6 @@ non-nil.  Resets this variable after parsing is done."
  "^[ \t]*package[ \t]+\\([^ \t;\n]+\\)[ \t]*;" nil t 1)
 (match-string 1)
 
-(defun javaimp--parse-get-all-classlikes ()
-  (mapcar (lambda (scope)
-(let ((name (javaimp-scope-name scope))
-  (parent-names (javaimp--concat-scope-parents scope)))
-  (if (string-empty-p parent-names)
-  name
-(concat parent-names "." name
-  (javaimp--parse-get-all-scopes #'javaimp--is-classlike)))
-
-(defun javaimp--parse-get-imenu-forest ()
-  (let* ((methods (javaimp--parse-get-all-scopes
-   #'javaimp--is-imenu-included-method 
#'javaimp--is-classlike))
- (classes (javaimp--parse-get-all-scopes #'javaimp--is-classlike))
- (top-classes (seq-filter (lambda (s)
-(null (javaimp-scope-parent s)))
-  classes))
- (ac-methods (javaimp--parse-abstract-class-methods)))
-(map

[elpa] externals/javaimp d7d4c72 1/2: Add class abstract methods to imenu support

2021-08-27 Thread Filipp Gunbin
branch: externals/javaimp
commit d7d4c72d2941f39d1e1da8e68532c28c42b5abf5
Author: Filipp Gunbin 
Commit: Filipp Gunbin 

Add class abstract methods to imenu support
---
 javaimp-parse.el | 82 +---
 javaimp-tests.el | 77 +---
 2 files changed, 91 insertions(+), 68 deletions(-)

diff --git a/javaimp-parse.el b/javaimp-parse.el
index d543a62..460e615 100644
--- a/javaimp-parse.el
+++ b/javaimp-parse.el
@@ -165,7 +165,7 @@ as for `re-search-backward'."
  (= (scan-lists (match-end 0) (or skip-count 1) -1)
 (1+ scope-start)
 
-(defun javaimp--parse-decl-suffix (regexp state &optional bound)
+(defun javaimp--parse-decl-suffix (regexp brace-pos &optional bound)
   "Attempts to parse declaration suffix backwards from point (but
 not farther than BOUND), returning non-nil on success.  More
 precisely, the value is the end of the match for REGEXP.  Point
@@ -178,10 +178,10 @@ is unchanged."
   (with-syntax-table javaimp--arglist-syntax-table
 ;; Skip over any number of lists, which may be exceptions
 ;; in "throws", or something like that
-(while (and scan-pos (<= scan-pos (nth 1 state)))
+(while (and scan-pos (<= scan-pos brace-pos))
   (if (ignore-errors
 (= (scan-lists scan-pos 1 -1) ;As in 
javaimp--parse-preceding
-   (1+ (nth 1 state
+   (1+ brace-pos)))
   (progn
 (goto-char (match-beginning 0))
 (throw 'found (match-end 0)))
@@ -203,21 +203,23 @@ is unchanged."
 javaimp--parse-scope-simple-stmt
 javaimp--parse-scope-method-or-stmt
 javaimp--parse-scope-unknown
-))
+)
+  "List of parser functions, each of which is called with BRACE-POS,
+the position of opening brace.")
 
-(defun javaimp--parse-scope-class (state)
+(defun javaimp--parse-scope-class (brace-pos)
   "Attempts to parse 'class' / 'interface' / 'enum' scope.  Some of
 those may later become 'local-class' (see `javaimp--parse-scopes')."
   (save-excursion
-(if (javaimp--parse-preceding (regexp-opt 
javaimp--parse-classlike-keywords 'words)
-  (nth 1 state))
+(if (javaimp--parse-preceding (regexp-opt 
javaimp--parse-classlike-keywords 'symbols)
+  brace-pos)
 (let* ((keyword-start (match-beginning 1))
(keyword-end (match-end 1))
arglist)
-  (goto-char (nth 1 state))
-  (or (javaimp--parse-decl-suffix "\\" state keyword-end)
-  (javaimp--parse-decl-suffix "\\" state keyword-end)
-  (javaimp--parse-decl-suffix "\\" state keyword-end))
+  (goto-char brace-pos)
+  (or (javaimp--parse-decl-suffix "\\_" brace-pos 
keyword-end)
+  (javaimp--parse-decl-suffix "\\_" brace-pos 
keyword-end)
+  (javaimp--parse-decl-suffix "\\_" brace-pos 
keyword-end))
   ;; we either skipped back over the valid declaration
   ;; suffix(-es), or there wasn't any
   (setq arglist (javaimp--parse-arglist keyword-end (point) t))
@@ -227,9 +229,9 @@ those may later become 'local-class' (see 
`javaimp--parse-scopes')."
 keyword-start keyword-end))
 :name (javaimp--parse-substr-before-< (caar 
arglist))
 :start keyword-start
-:open-brace (nth 1 state)))
+:open-brace brace-pos))
 
-(defun javaimp--parse-scope-simple-stmt (state)
+(defun javaimp--parse-scope-simple-stmt (brace-pos)
   "Attempts to parse 'simple-statement' scope."
   (save-excursion
 (and (javaimp--parse-skip-back-until)
@@ -243,9 +245,9 @@ those may later become 'local-class' (see 
`javaimp--parse-scopes')."
 "lambda")
   :start (or (match-beginning 1)
  (- (point) 2))
-  :open-brace (nth 1 state)
+  :open-brace brace-pos
 
-(defun javaimp--parse-scope-anonymous-class (state)
+(defun javaimp--parse-scope-anonymous-class (brace-pos)
   "Attempts to parse 'anonymous-class' scope."
   (save-excursion
 ;; skip arg-list and ws
@@ -257,16 +259,16 @@ those may later become 'local-class' (see 
`javaimp--parse-scopes')."
   (scan-lists (point) -1 0
   (let ((end (point))
 start arglist)
-(when (javaimp--parse-preceding "\\" (nth 1 state) 2)
+(when (javaimp--parse-preceding "\\_" brace-pos 2)
   (setq start (match-beginning 0)
 arglist (javaimp--parse-arglist (match-end 0) end t))
   (when (= (length arglist) 1)
 (make-javaimp-scope :type 'anonymous-class
 :name (javaimp--parse-substr-before-< (caar 
arglist))
 

[nongnu] elpa/tuareg updated (4c4fad3 -> ef1ec3f)

2021-08-27 Thread ELPA Syncer
elpasync pushed a change to branch elpa/tuareg.

  from  4c4fad3   Work around bug in Emacs 26 and older
   new  5eab0de   Tests: add commenting then uncommenting tests
   new  f0af0b8   Fix uncommenting with `comment-continue' made solely of 
whitespace
   new  ef1ec3f   Be clearer about how to highlight all operators


Summary of changes:
 README.md|   4 +-
 tuareg-compat.el | 230 ++-
 tuareg-tests.el  |  28 +++
 3 files changed, 260 insertions(+), 2 deletions(-)



[nongnu] elpa/tuareg f0af0b8 2/3: Fix uncommenting with `comment-continue' made solely of whitespace

2021-08-27 Thread ELPA Syncer
branch: elpa/tuareg
commit f0af0b8ccc522b89045f52a854e9f527ec13296a
Author: Christophe Troestler 
Commit: Christophe Troestler 

Fix uncommenting with `comment-continue' made solely of whitespace
---
 tuareg-compat.el | 230 ++-
 1 file changed, 229 insertions(+), 1 deletion(-)

diff --git a/tuareg-compat.el b/tuareg-compat.el
index ad7c62f..81b2b32 100644
--- a/tuareg-compat.el
+++ b/tuareg-compat.el
@@ -6,7 +6,6 @@
 (require 'newcomment)
 
 ;; Emacs < 26
-
 (defun tuareg--comment-padright--advice (origfn &rest args)
   (let ((str (nth 0 args)))
 (unless (and (eq major-mode 'tuareg-mode)
@@ -194,5 +193,234 @@ out."
   (advice-add 'comment-region-default-1 :around
   #'tuareg--comment-region-default-1--advice))
 
+;; FIX: uncommenting
+
+;; Emacs < 27
+(defun tuareg--uncomment-region-default (beg end &optional arg)
+  "Uncomment each line in the BEG .. END region.
+The numeric prefix ARG can specify a number of chars to remove from the
+comment delimiters.
+This function is the default value of `uncomment-region-function'."
+  (goto-char beg)
+  (setq end (copy-marker end))
+  (let* ((numarg (prefix-numeric-value arg))
+(ccs comment-continue)
+(srei (or (comment-padright ccs 're)
+   (and (stringp comment-continue) comment-continue)))
+(csre (comment-padright comment-start 're))
+(sre (and srei (concat "^\\s-*?\\(" srei "\\)")))
+spt)
+(while (and (< (point) end)
+   (setq spt (comment-search-forward end t)))
+  (let ((ipt (point))
+   ;; Find the end of the comment.
+   (ept (progn
+  (goto-char spt)
+  (unless (or (comment-forward)
+  ;; Allow non-terminated comments.
+  (eobp))
+(error "Can't find the comment end"))
+  (point)))
+   (box nil)
+   (box-equal nil))   ;Whether we might be using `=' for boxes.
+   (save-restriction
+ (narrow-to-region spt ept)
+
+ ;; Remove the comment-start.
+ (goto-char ipt)
+ (skip-syntax-backward " ")
+ ;; A box-comment starts with a looong comment-start marker.
+ (when (and (or (and (= (- (point) (point-min)) 1)
+ (setq box-equal t)
+ (looking-at "=\\{7\\}")
+ (not (eq (char-before (point-max)) ?\n))
+ (skip-chars-forward "="))
+(> (- (point) (point-min) (length comment-start)) 7))
+(> (count-lines (point-min) (point-max)) 2))
+   (setq box t))
+ ;; Skip the padding.  Padding can come from comment-padding and/or
+ ;; from comment-start, so we first check comment-start.
+ (if (or (save-excursion (goto-char (point-min)) (looking-at csre))
+ (looking-at (regexp-quote comment-padding)))
+ (goto-char (match-end 0)))
+ (when (and sre (looking-at (concat "\\s-*\n\\s-*" srei)))
+   (goto-char (match-end 0)))
+ (if (null arg) (delete-region (point-min) (point))
+(let ((opoint (point-marker)))
+  (skip-syntax-backward " ")
+  (delete-char (- numarg))
+  (unless (and (not (bobp))
+   (save-excursion (goto-char (point-min))
+   (looking-at comment-start-skip)))
+;; If there's something left but it doesn't look like
+;; a comment-start any more, just remove it.
+(delete-region (point-min) opoint
+
+ ;; Remove the end-comment (and leading padding and such).
+ (goto-char (point-max)) (comment-enter-backward)
+ ;; Check for special `=' used sometimes in comment-box.
+ (when (and box-equal (not (eq (char-before (point-max)) ?\n)))
+   (let ((pos (point)))
+ ;; skip `=' but only if there are at least 7.
+ (when (> (skip-chars-backward "=") -7) (goto-char pos
+ (unless (looking-at "\\(\n\\|\\s-\\)*\\'")
+   (when (and (bolp) (not (bobp))) (backward-char))
+   (if (null arg) (delete-region (point) (point-max))
+ (skip-syntax-forward " ")
+ (delete-char numarg)
+ (unless (or (eobp) (looking-at comment-end-skip))
+   ;; If there's something left but it doesn't look like
+   ;; a comment-end any more, just remove it.
+   (delete-region (point) (point-max)
+
+ ;; Unquote any nested end-comment.
+ (comment-quote-nested comment-start comment-end t)
+
+ ;; Eliminate continuation markers as well.
+ (when sre
+   (let* ((cce (comment-string-reverse (or comment-continue
+   comment-start)))
+   

[nongnu] elpa/tuareg ef1ec3f 3/3: Be clearer about how to highlight all operators

2021-08-27 Thread ELPA Syncer
branch: elpa/tuareg
commit ef1ec3fd191085c4013344de8f2c850ef0c6a40f
Author: Christophe Troestler 
Commit: Christophe Troestler 

Be clearer about how to highlight all operators

Fixes https://github.com/ocaml/tuareg/issues/207
---
 README.md | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/README.md b/README.md
index 392ce8e..5c0adc4 100644
--- a/README.md
+++ b/README.md
@@ -149,7 +149,9 @@ Tips & customization
 - Fontifying all operators (as opposed to only non-standard ones) is a
   costly operation that slows down font-lock.  This is why it is
   disabled by default.  If you nonetheless want it, set
-  `tuareg-highlight-all-operators` to `t` in your [Init File][].
+  `tuareg-highlight-all-operators` to `t` in your [Init File][]
+  (before `tuareg-mode` is initialized; in particular, not in a hook
+  added to `'tuareg-mode-hook`).
 
 - You can turn on and off the rendering of certain sequences of
   characters as symbols (such as `∔` and `∧` instead of `+.`and `&&`),



[nongnu] elpa/tuareg 5eab0de 1/3: Tests: add commenting then uncommenting tests

2021-08-27 Thread ELPA Syncer
branch: elpa/tuareg
commit 5eab0de3417585b304478b2d798d527c71278c01
Author: Christophe Troestler 
Commit: Christophe Troestler 

Tests: add commenting then uncommenting tests
---
 tuareg-tests.el | 28 
 1 file changed, 28 insertions(+)

diff --git a/tuareg-tests.el b/tuareg-tests.el
index b24f495..f248320 100644
--- a/tuareg-tests.el
+++ b/tuareg-tests.el
@@ -625,4 +625,32 @@ Return (FILE TYPE START-LINE END-LINE START-COL END-COL)."
 "  epsilon\ntau\n")
"  (* epsilon\n   tau *)\n"
 
+(defun tuareg-test--comment-uncomment-region (text)
+  (equal text
+ (with-temp-buffer
+   (tuareg-mode)
+   (insert text)
+   (comment-region (point-min) (point-max))
+   (uncomment-region (point-min) (point-max))
+   (buffer-string
+
+(ert-deftest tuareg-comment-uncomment-region ()
+  "Check that commenting out code then uncommenting it leads to
+the original code."
+  (should (let ((comment-style 'indent))
+(tuareg-test--comment-uncomment-region
+ "let f x =\n  g x\ny\n")))
+  (should (let ((comment-style 'multi-line)
+(comment-continue " * "))
+(tuareg-test--comment-uncomment-region
+ "let f x =\n  g x\ny\n")))
+  (should (let ((comment-style 'multi-line))
+(tuareg-test--comment-uncomment-region
+ "let f x =\n  g x\ny\n")))
+  (should (let ((comment-style 'multi-line)
+(comment-continue "   "))
+(tuareg-test--comment-uncomment-region
+ "let f x =\n  g x\ny\n"
+
+
 (provide 'tuareg-tests)



[elpa] externals/javaimp 80d4a95: Add interface abstract methods to imenu support

2021-08-27 Thread Filipp Gunbin
branch: externals/javaimp
commit 80d4a95f7244904ff6eb7a9ec024c91abfe68579
Author: Filipp Gunbin 
Commit: Filipp Gunbin 

Add interface abstract methods to imenu support
---
 javaimp-parse.el | 55 +++
 javaimp-tests.el | 18 +++---
 javaimp.el   | 17 ++---
 3 files changed, 60 insertions(+), 30 deletions(-)

diff --git a/javaimp-parse.el b/javaimp-parse.el
index 130edff..21bda4b 100644
--- a/javaimp-parse.el
+++ b/javaimp-parse.el
@@ -390,26 +390,40 @@ non-nil.  Resets this variable after parsing is done."
   (let (res)
 (while (javaimp--parse-rsb-keyword "\\_" nil t)
   (save-excursion
-(save-match-data
-  (let ((enclosing (nth 1 (syntax-ppss
-(when (and enclosing
-   (javaimp--parse-rsb-keyword ";" nil t -1)
-   ;; we're in the same nest
-   (= (nth 1 (syntax-ppss)) enclosing))
-  (backward-char)  ;skip semicolon
-  ;; now parse as normal method scope
-  (when-let ((scope (javaimp--parse-scope-method-or-stmt (point)))
- ;; note that an abstract method with no
- ;; parents will be ignored
- (parent (javaimp--parse-scopes nil)))
-(setf (javaimp-scope-parent scope) (javaimp--copy-scope 
parent))
-(push scope res)))
+(let ((enclosing (nth 1 (syntax-ppss
+  (when (and enclosing
+ (javaimp--parse-rsb-keyword ";" nil t -1)
+ ;; are we in the same nest?
+ (= (nth 1 (syntax-ppss)) enclosing))
+(backward-char);skip semicolon
+;; now parse as normal method scope
+(when-let ((scope (javaimp--parse-scope-method-or-stmt (point)))
+   ;; note that an abstract method with no
+   ;; parents will be ignored
+   (parent (javaimp--parse-scopes nil)))
+  (setf (javaimp-scope-parent scope) (javaimp--copy-scope parent))
+  (push scope res))
 res))
 
-(defun javaimp--parse-abstract-interface-methods ()
-  ;; TODO
-  )
-
+(defun javaimp--parse-abstract-interface-methods (int-scope)
+  (let ((start (1+ (javaimp-scope-open-brace int-scope)))
+(end (ignore-errors
+   (1- (scan-lists (javaimp-scope-open-brace int-scope) 1 0
+res)
+(when (and start end)
+  (goto-char end)
+  (while (and (> (point) start)
+  (javaimp--parse-rsb-keyword ";" start t))
+;; are we in the same nest?
+(if (= (nth 1 (syntax-ppss)) (javaimp-scope-open-brace int-scope))
+(save-excursion
+  ;; now parse as normal method scope
+  (when-let ((scope (javaimp--parse-scope-method-or-stmt (point
+(setf (javaimp-scope-parent scope) int-scope)
+(push scope res)))
+  ;; we've entered another nest, go back to its start
+  (goto-char (nth 1 (syntax-ppss))
+res))
 
 
 ;; Functions intended to be called from other parts of javaimp.
@@ -445,12 +459,13 @@ them should move point."
 (push scope res)))
 res
 
-(defun javaimp--parse-abstract-methods ()
+(defun javaimp--parse-abstract-methods (interfaces)
   (save-excursion
 (save-restriction
   (widen)
   (append (javaimp--parse-abstract-class-methods)
-  (javaimp--parse-abstract-interface-methods)
+  (seq-mapcat #'javaimp--parse-abstract-interface-methods
+  interfaces)
 
 (defun javaimp--parse-update-dirty-pos (beg _end _old-len)
   "Function to add to `after-change-functions' hook."
diff --git a/javaimp-tests.el b/javaimp-tests.el
index 93dfcc4..0ad3fd8 100644
--- a/javaimp-tests.el
+++ b/javaimp-tests.el
@@ -314,11 +314,15 @@ package commented.block;
("baz()" . 1281)))
  ("IInner1"
   ("foo()" . 1603)
+  ("abstract_method()" . 1715)
   ("IInner1_CInner1"
("foo()" . 1798))
+  ("baz()" . 1934)
   ("defaultMethod(String)" . 1963)
   ("IInner1_IInner1"
-   ("defaultMethod(String)" . 2157)))
+   ("foo()" . 2122)
+   ("defaultMethod(String)" . 2157)
+   ("baz()" . 2258)))
  ("EnumInner1"
   ("EnumInner1()" . 2353)
   ("foo()" . 2399)
@@ -342,13 +346,17 @@ package commented.block;
 (javaimp-test--imenu-method-list
  '("foo() [Top.CInner1]"
"foo() [Top.CInner1.CInner1_CInner1]"
-   "abstract_method()"
+   "abstract_method() [Top.CInner1.CInner1_CInner1]"
"bar()"
-   "baz()"
+   "baz() [Top.CInner1.CInner1_CInner1]"
"foo() [Top.IInner1]"
+   "abstract_method() [Top.IInner1]"
"foo() [Top.IInner1.IInner1_CInner1]"
+   "baz() [Top.IInner1]"
 

[elpa] externals/taxy 92b3e06: Add/Change: taxy-magit-section: Various improvements

2021-08-27 Thread ELPA Syncer
branch: externals/taxy
commit 92b3e060fdf8445f4bc6f47e43fd4233c1a23651
Author: Adam Porter 
Commit: Adam Porter 

Add/Change: taxy-magit-section: Various improvements
---
 taxy-magit-section.el | 93 +++
 1 file changed, 64 insertions(+), 29 deletions(-)

diff --git a/taxy-magit-section.el b/taxy-magit-section.el
index 1760b52..6fd71c9 100644
--- a/taxy-magit-section.el
+++ b/taxy-magit-section.el
@@ -37,11 +37,65 @@
  Customization
 
 
+ Structs
+
+(cl-defstruct (taxy-magit-section (:include taxy))
+  ;; This struct is not required to be used for taxys passed to
+  ;; `taxy-magit-section-insert', but it allows a visibility function
+  ;; to be specified to override the default for it.
+  (visibility-fn #'taxy-magit-section-visibility)
+  format-fn)
+
  Commands
 
 
  Functions
 
+(cl-defun taxy-magit-section-insert (taxy &key (objects 'first))
+  "Insert a `magit-section' for TAXY into current buffer.
+If OBJECTS is `first', insert a taxy's objects before its
+descendant taxys; if `last', insert them after descendants."
+  (let* ((depth 0)
+ (magit-section-set-visibility-hook (cons 
#'taxy-magit-section-visibility magit-section-set-visibility-hook)))
+(cl-labels ((insert-object
+ (object &optional (format-fn (lambda (o) (format "%s" o
+ (magit-insert-section (magit-section object)
+   (magit-insert-section-body
+ (insert (make-string (+ 2 (* depth 
taxy-magit-section-indent)) ? )
+ (funcall format-fn object)
+ "\n"
+(insert-taxy
+ (taxy) (let ((magit-section-set-visibility-hook 
magit-section-set-visibility-hook)
+  (format-fn (cl-typecase taxy
+   (taxy-magit-section
+(taxy-magit-section-format-fn 
taxy)
+  (cl-typecase taxy
+(taxy-magit-section
+ (when (taxy-magit-section-visibility-fn taxy)
+   (push (taxy-magit-section-visibility-fn taxy) 
magit-section-set-visibility-hook
+  (magit-insert-section (magit-section taxy)
+(magit-insert-heading
+  (make-string (* depth taxy-magit-section-indent) 
? )
+  (propertize (taxy-name taxy) 'face 
'magit-section-heading)
+  (format " (%s%s)"
+  (if (taxy-description taxy)
+  (concat (taxy-description taxy) " ")
+"")
+  (taxy-size taxy)))
+(magit-insert-section-body
+  (when (eq 'first objects)
+(dolist (object (taxy-objects taxy))
+  (insert-object object format-fn))
+(mapc #'insert-object (taxy-objects taxy)))
+  (cl-incf depth)
+  (mapc #'insert-taxy (taxy-taxys taxy))
+  (cl-decf depth)
+  (when (eq 'last objects)
+(dolist (object (taxy-objects taxy))
+  (insert-object object format-fn
+  (magit-insert-section (magit-section)
+(insert-taxy taxy)
+
 (cl-defun taxy-magit-section-pp (taxy &key (objects 'first))
   "Pretty-print TAXY into a buffer with `magit-section' and show it."
   (with-current-buffer (get-buffer-create "*taxy-magit-section-pp*")
@@ -51,35 +105,16 @@
   (taxy-magit-section-insert taxy :objects objects))
 (pop-to-buffer (current-buffer
 
-(cl-defun taxy-magit-section-insert (taxy &key (objects 'first))
-  "Insert a `magit-section' for TAXY into current buffer.
-If OBJECTS is `first', insert a taxy's objects before its
-descendant taxys; if `last', insert them after descendants."
-  (let ((depth 0))
-(cl-labels ((insert-object
- (object) (insert (make-string (+ 2 (* depth 
taxy-magit-section-indent)) ? )
-  (format "%s" object)
-  "\n"))
-(insert-taxy
- (taxy) (magit-insert-section (magit-section taxy)
-  (magit-insert-heading
-(make-string (* depth taxy-magit-section-indent) ? 
)
-(propertize (taxy-name taxy) 'face 
'magit-section-heading)
-(format " (%s%s)"
-(if (taxy-description taxy)
-(concat (taxy-description taxy) " ")
-