From 940e94e1b041af1fea6079018f6508215377c135 Mon Sep 17 00:00:00 2001 From: Andreas Gerler Date: Sun, 26 Nov 2023 16:31:16 +0100 Subject: [PATCH] update treepy Signed-off-by: Andreas Gerler --- elpa/treepy-20191108.2217/treepy-pkg.el | 2 - .../treepy-autoloads.el | 8 +- elpa/treepy-20230715.2154/treepy-pkg.el | 14 +++ .../treepy.el | 88 +++++++++---------- 4 files changed, 64 insertions(+), 48 deletions(-) delete mode 100644 elpa/treepy-20191108.2217/treepy-pkg.el rename elpa/{treepy-20191108.2217 => treepy-20230715.2154}/treepy-autoloads.el (65%) create mode 100644 elpa/treepy-20230715.2154/treepy-pkg.el rename elpa/{treepy-20191108.2217 => treepy-20230715.2154}/treepy.el (90%) diff --git a/elpa/treepy-20191108.2217/treepy-pkg.el b/elpa/treepy-20191108.2217/treepy-pkg.el deleted file mode 100644 index 196fcdc4..00000000 --- a/elpa/treepy-20191108.2217/treepy-pkg.el +++ /dev/null @@ -1,2 +0,0 @@ -;;; -*- no-byte-compile: t -*- -(define-package "treepy" "20191108.2217" "Generic tree traversal tools" '((emacs "25.1")) :commit "306f7031d26e4ebfc9ff36614acdc6993f3e23c3" :keywords '("lisp" "maint" "tools") :authors '(("Daniel Barreto" . "daniel.barreto.n@gmail.com")) :maintainer '("Daniel Barreto" . "daniel.barreto.n@gmail.com") :url "https://github.com/volrath/treepy.el") diff --git a/elpa/treepy-20191108.2217/treepy-autoloads.el b/elpa/treepy-20230715.2154/treepy-autoloads.el similarity index 65% rename from elpa/treepy-20191108.2217/treepy-autoloads.el rename to elpa/treepy-20230715.2154/treepy-autoloads.el index cbc161a6..faab8f30 100644 --- a/elpa/treepy-20191108.2217/treepy-autoloads.el +++ b/elpa/treepy-20230715.2154/treepy-autoloads.el @@ -1,4 +1,4 @@ -;;; treepy-autoloads.el --- automatically extracted autoloads +;;; treepy-autoloads.el --- automatically extracted autoloads -*- lexical-binding: t -*- ;; ;;; Code: @@ -9,7 +9,11 @@ ;;;### (autoloads nil "treepy" "treepy.el" (0 0 0 0)) ;;; Generated autoloads from treepy.el -(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "treepy" '("treepy-"))) +(register-definition-prefixes "treepy" '("treepy-")) + +;;;*** + +;;;### (autoloads nil nil ("treepy-pkg.el") (0 0 0 0)) ;;;*** diff --git a/elpa/treepy-20230715.2154/treepy-pkg.el b/elpa/treepy-20230715.2154/treepy-pkg.el new file mode 100644 index 00000000..2a067a34 --- /dev/null +++ b/elpa/treepy-20230715.2154/treepy-pkg.el @@ -0,0 +1,14 @@ +(define-package "treepy" "20230715.2154" "Generic tree traversal tools" + '((emacs "25.1")) + :commit "75fe3ec37e6f9b2bdfd6d0584efd984d0c00a43e" :authors + '(("Daniel Barreto" . "daniel.barreto.n@gmail.com")) + :maintainers + '(("Daniel Barreto" . "daniel.barreto.n@gmail.com")) + :maintainer + '("Daniel Barreto" . "daniel.barreto.n@gmail.com") + :keywords + '("lisp" "maint" "tools") + :url "https://github.com/volrath/treepy.el") +;; Local Variables: +;; no-byte-compile: t +;; End: diff --git a/elpa/treepy-20191108.2217/treepy.el b/elpa/treepy-20230715.2154/treepy.el similarity index 90% rename from elpa/treepy-20191108.2217/treepy.el rename to elpa/treepy-20230715.2154/treepy.el index b98ba140..e949aac9 100644 --- a/elpa/treepy-20191108.2217/treepy.el +++ b/elpa/treepy-20230715.2154/treepy.el @@ -1,44 +1,34 @@ -;;; treepy.el --- Generic tree traversal tools -*- lexical-binding: t -*- -;; -;; Filename: treepy.el -;; +;;; treepy.el --- Generic tree traversal tools -*- lexical-binding: t -*- + ;; Copyright (C) 2017 Daniel Barreto -;; -;; Description: Generic Tree Traversing Tools + ;; Author: Daniel Barreto ;; Keywords: lisp, maint, tools -;; Package-Version: 20191108.2217 ;; Created: Mon Jul 10 15:17:36 2017 (+0200) -;; Version: 0.1.1 +;; Version: 0.1.2 ;; Package-Requires: ((emacs "25.1")) ;; URL: https://github.com/volrath/treepy.el -;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; -;;; Commentary: -;; -;; Generic tools for recursive and iterative tree traversal based on -;; clojure.walk and clojure.zip respectively. Depends on `map', a map -;; manipulation library built in Emacs 25.1. All functions are prefixed -;; with "treepy-" -;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; + ;; 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 GNU Emacs. If not, see . -;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; + +;;; Commentary: + +;; Generic tools for recursive and iterative tree traversal based on +;; clojure.walk and clojure.zip respectively. Depends on `map', a map +;; manipulation library built in Emacs 25.1. All functions are prefixed +;; with "treepy-". + ;;; Code: (require 'map) @@ -90,18 +80,28 @@ Return a list of each form as it is walked." (defun treepy-postwalk-replace (smap form &optional testfn) "Use SMAP to transform FORM by doing replacing operations. -Recursively replace in FORM keys in SMAP with their values. Does -replacement at the leaves of the tree first. The optional TESTFN -parameter is the function to be used by `map-contains-key'." - (treepy-postwalk (lambda (x) (if (map-contains-key smap x testfn) (map-elt smap x) x)) +Recursively replace in FORM keys in SMAP with their values. +Does replacement at the leaves of the tree first." + ;; Also see comment in `map-contains-key's definition. + (declare (advertised-calling-convention (smap key) "0.1.3")) + (treepy-postwalk (lambda (x) + (if (with-suppressed-warnings ((callargs map-contains-key)) + (map-contains-key smap x testfn)) + (map-elt smap x) + x)) form)) (defun treepy-prewalk-replace (smap form &optional testfn) "Use SMAP to transform FORM by doing replacing operations. -Recursively replace in FORM keys in SMAP with their values. Does -replacement at the root of the tree first. The optional TESTFN -parameter is the function to be used by `map-contains-key'." - (treepy-prewalk (lambda (x) (if (map-contains-key smap x testfn) (map-elt smap x) x)) +Recursively replace in FORM keys in SMAP with their values. +Does replacement at the root of the tree first." + ;; Also see comment in `map-contains-key's definition. + (declare (advertised-calling-convention (smap key) "0.1.3")) + (treepy-prewalk (lambda (x) + (if (with-suppressed-warnings ((callargs map-contains-key)) + (map-contains-key smap x testfn)) + (map-elt smap x) + x)) form)) @@ -158,9 +158,9 @@ Execute BODY in this context." (declare (indent defun)) (let ((lex-ctx (mapcar (lambda (v) (cl-case v - ('node `(node (treepy-node ,loc))) - ('context `(context (treepy--context ,loc))) - (t `(,v (treepy--context ,loc (quote ,(intern (concat ":" (symbol-name v))))))))) + (node `(node (treepy-node ,loc))) + (context `(context (treepy--context ,loc))) + (t `(,v (treepy--context ,loc (quote ,(intern (concat ":" (symbol-name v))))))))) vars))) `(let* (,@lex-ctx) ,@body))) @@ -270,7 +270,7 @@ Reflect any alterations to the tree." (defun treepy-right (loc) "Return the loc of the right sibling of the node at this LOC. -nil if there's no more right sibilings." +nil if there's no more right siblings." (treepy--with-loc loc (node context l r) (let ((r (if (listp r) r @@ -302,7 +302,7 @@ If LOC is already the rightmost sibling, return self." (defun treepy-left (loc) "Return the loc of the left sibling of the node at this LOC. -nil if no more left sibilings." +nil if no more left siblings." (treepy--with-loc loc (node context l r) (when (and context l) (seq-let [cl &rest lnext] l @@ -337,7 +337,7 @@ If LOC is already the leftmost sibling, return self." (defun treepy-insert-left (loc item) "Insert as the left sibling of this LOC'S node the ITEM. -Return same loc with sibilings updated." +Return same loc with siblings updated." (treepy--with-loc loc (node context l) (if (not context) (error "Insert at top") @@ -350,7 +350,7 @@ Return same loc with sibilings updated." (defun treepy-insert-right (loc item) "Insert as the right sibling of this LOC's node the ITEM. -Return same loc with sibilings updated." +Return same loc with siblings updated." (treepy--with-loc loc (node context r) (if (not context) (error "Insert at top") @@ -441,8 +441,8 @@ When reaching the end, returns a distinguished loc detectable via Use ORDER if given. Possible values for ORDER are `:preorder' and `:postorder', defaults to the former." (cl-case (or order ':preorder) - (':preorder (treepy--preorder-next loc)) - (':postorder (treepy--postorder-next loc)) + (:preorder (treepy--preorder-next loc)) + (:postorder (treepy--postorder-next loc)) (t (error "Unrecognized order")))) (defun treepy--preorder-prev (loc) @@ -472,8 +472,8 @@ If already at the root, returns nil." Use ORDER if given. Possible values for ORDER are `:preorder' and `:postorder', defaults to the former." (cl-case (or order ':preorder) - (':preorder (treepy--preorder-prev loc)) - (':postorder (treepy--postorder-prev loc)) + (:preorder (treepy--preorder-prev loc)) + (:postorder (treepy--postorder-prev loc)) (t (error "Unrecognized order")))) (defun treepy-end-p (loc) -- 2.47.3