emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/eev d1b5b490a4: New function: `find-rstdoc-links'.


From: ELPA Syncer
Subject: [elpa] externals/eev d1b5b490a4: New function: `find-rstdoc-links'.
Date: Thu, 1 Dec 2022 22:57:34 -0500 (EST)

branch: externals/eev
commit d1b5b490a4e7c55882b4322e54d4946e50af0806
Author: Eduardo Ochs <eduardoochs@gmail.com>
Commit: Eduardo Ochs <eduardoochs@gmail.com>

    New function: `find-rstdoc-links'.
---
 ChangeLog     |  6 ++++++
 VERSION       |  4 ++--
 eev-rstdoc.el | 15 ++++++++++++---
 eev-tlinks.el | 55 ++++++++++++++++++++++++++++++++++++++++++++++++++++++-
 4 files changed, 74 insertions(+), 6 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 49149086f2..8a8fb16f16 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2022-12-02  Eduardo Ochs  <eduardoochs@gmail.com>
+
+       * eev-rstdoc.el (ee-rstdoc-getfield0): new function.
+
+       * eev-tlinks.el (find-rstdoc-links): new function.
+
 2022-12-01  Eduardo Ochs  <eduardoochs@gmail.com>
 
        * eev-intro.el (find-kla-intro): added some sections.
diff --git a/VERSION b/VERSION
index 8e0214ce56..f71c45685e 100644
--- a/VERSION
+++ b/VERSION
@@ -1,2 +1,2 @@
-Thu Dec  1 05:27:37 GMT 2022
-Thu Dec  1 02:27:37 -03 2022
+Fri Dec  2 03:45:33 GMT 2022
+Fri Dec  2 00:45:33 -03 2022
diff --git a/eev-rstdoc.el b/eev-rstdoc.el
index a859eb4e94..92acd6913f 100644
--- a/eev-rstdoc.el
+++ b/eev-rstdoc.el
@@ -19,7 +19,7 @@
 ;;
 ;; Author:     Eduardo Ochs <eduardoochs@gmail.com>
 ;; Maintainer: Eduardo Ochs <eduardoochs@gmail.com>
-;; Version:    20221102
+;; Version:    20221202
 ;; Keywords:   e-scripts
 ;;
 ;; Latest version: <http://angg.twu.net/eev-current/eev-rstdoc.el>
@@ -318,8 +318,12 @@
 ;; (ee-rstdoc-kw  "py")
 ;; (ee-rstdoc-var :py)
 ;; (ee-rstdoc-var "py")
-;; (ee-rstdoc-getfield :py :base-web)
-;; (ee-rstdoc-getfield :py :foo)
+;; (ee-rstdoc-getfield  :py  :base-web)
+;; (ee-rstdoc-getfield  :py  :base-web0)
+;; (ee-rstdoc-getfield  :py0 :base-web0)
+;; (ee-rstdoc-getfield0 :py  :base-web)
+;; (ee-rstdoc-getfield0 :py  :base-web0)
+;; (ee-rstdoc-getfield0 :py0 :base-web0)
 ;; (ee-rstdoc-hashanchor "https://docs.python.org/3/index.html";)
 ;; (ee-rstdoc-hashanchor "https://docs.python.org/3/index.html#foo";)
 ;; (ee-rstdoc-stem   :py "https://docs.python.org/3/index.html#foo";)
@@ -338,6 +342,11 @@
     (if (not result) (error "Empty field %S in %S" field (ee-rstdoc-var kw)))
     result))
 
+(defun ee-rstdoc-getfield0 (kw field)
+  (let* ((var (ee-rstdoc-var kw))
+        (fields (and (boundp var) (symbol-value var))))
+    (and fields (plist-get fields field))))
+
 (defun ee-rstdoc-stem (kw str)
   (dolist (re (ee-rstdoc-getfield kw :res))
     (setq str (replace-regexp-in-string re "" str)))
diff --git a/eev-tlinks.el b/eev-tlinks.el
index cedfe528fc..3c3803963c 100644
--- a/eev-tlinks.el
+++ b/eev-tlinks.el
@@ -19,7 +19,7 @@
 ;;
 ;; Author:     Eduardo Ochs <eduardoochs@gmail.com>
 ;; Maintainer: Eduardo Ochs <eduardoochs@gmail.com>
-;; Version:    20221029
+;; Version:    20221202
 ;; Keywords:   e-scripts
 ;;
 ;; Latest version: <http://angg.twu.net/eev-current/eev-tlinks.el>
@@ -136,6 +136,7 @@
 ;; «.find-telegachat-links»            (to "find-telegachat-links")
 ;; «.find-eejump-links»                        (to "find-eejump-links")
 ;; «.find-kla-links»                   (to "find-kla-links")
+;; «.find-rstdoc-links»                        (to "find-rstdoc-links")
 
 
 (require 'eev-env)
@@ -3780,6 +3781,58 @@ N should be either a number or a symbol; SEXP should be 
a sexp."
 
 
 
+;; «find-rstdoc-links»  (to ".find-rstdoc-links")
+;; Skel: (find-find-links-links-new "rstdoc" "kw" "bweb bhtml brst kil")
+;; Tests: (find-rstdoc-links)
+;;        (find-rstdoc-links :py)
+;;
+(defun find-rstdoc-links (&optional kw &rest pos-spec-list)
+"Visit a temporary buffer containing hyperlinks for rstdoc."
+  (interactive)
+  (setq kw (or kw "{kw}"))
+  (let* ((bweb   (or (ee-rstdoc-getfield0 kw :base-web)
+                    "https://BASE-WEB/";
+                    "{bweb}"))
+         (bhtml  (or (ee-rstdoc-getfield0 kw :base-html)
+                    "file:///BASE-HTML/"
+                    "{bhtml}"))
+         (brst   (or (ee-rstdoc-getfield0 kw :base-rst)
+                    "/BASE-RST/"
+                    "{brst}"))
+        (bhtml0 (replace-regexp-in-string "^file://" "" bhtml))
+         (kil    (or (ee-rstdoc-getfield0 kw :kill)
+                    "{kil}")))
+    (let ((ee-buffer-name (or ee-buffer-name "*find-rstdoc-links*")))
+      (apply
+       'find-elinks-elisp
+       `((find-rstdoc-links ,kw ,@pos-spec-list)
+        ;; Convention: the first sexp always regenerates the buffer.
+        (find-efunction 'find-rstdoc-links)
+        ""
+        ,(ee-template0 "\
+;; <ee-rstdoc-{kw}>
+;; Skel: (find-rstdoc-links {kw})
+\(setq ee-rstdoc-{kw}
+      '(:base      \"index\"
+        :base-web  \"{bweb}\"
+        :base-html \"{bhtml}\"
+        :base-rst  \"{brst}\"
+        :rst       \".rst\"
+        :res       (\"#.*$\" \"\\\\?.*$\" \".html$\" \".txt$\" \".rst$\" 
\"^file://\"
+                    \"^{bweb}\"
+                    \"^{bhtml0}\"
+                    \"^{brst}\")
+        :kill      {kil}
+       ))
+
+;; (find-code-rstdoc {kw})
+        (code-rstdoc {kw})
+")
+        )
+       pos-spec-list))))
+
+
+
 
 (provide 'eev-tlinks)
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]