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

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

[elpa] externals/eev 02c297bb55: Added (find-show2-intro) and its depend


From: ELPA Syncer
Subject: [elpa] externals/eev 02c297bb55: Added (find-show2-intro) and its dependencies.
Date: Sat, 16 Dec 2023 21:57:46 -0500 (EST)

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

    Added (find-show2-intro) and its dependencies.
---
 ChangeLog         |  29 ++++++++
 VERSION           |   4 +-
 eev-intro.el      | 197 ++++++++++++++++++++++++++++++++++++++++++++++++++++--
 eev-testblocks.el |   6 +-
 eev-tlinks.el     | 149 ++++++++++++++++++++++++++++++++++++++---
 eev-videolinks.el |   3 +-
 eev.el            |   2 +-
 7 files changed, 368 insertions(+), 22 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index bbf75ec5de..a08686c2c9 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,34 @@
+2023-12-16  Eduardo Ochs  <eduardoochs@gmail.com>
+
+       * eev.el: bumped the version.
+
+       * eev-tlinks.el (find-luatb0, find-luatb): new functions.
+
+       * eev-intro.el (find-show2-intro): new function.
+       (find-eev-intro): added an entry for `(find-show2-intro)'.
+
+       * eev-tlinks.el (code-brappend, find-code-brappend)
+       (ee-code-brappend): new functions.
+
+2023-12-15  Eduardo Ochs  <eduardoochs@gmail.com>
+
+       * eev-videolinks.el (ee-1stclassvideos-info): added an indication
+       that the video "eev2023repls" (now) has subtitles.
+
+2023-12-14  Eduardo Ochs  <eduardoochs@gmail.com>
+
+       * eev-testblocks.el (ee-insert-test-makefile-gmake-mode)
+       (ee-insert-test-makefile-mode): change the "^#T " to "^#T ?".
+
+2023-12-10  Eduardo Ochs  <eduardoochs@gmail.com>
+
+       * eev-tlinks.el (find-show2-links, show2): new functions.
+
 2023-12-05  Eduardo Ochs  <eduardoochs@gmail.com>
 
+       * eev-tlinks.el (find-maximamsg-links, ee-find-maximamsg-links)
+       (find-maximamsg): new functions.
+
        * eepitch.el (eepitch-this-line): added the argument `debug'.
        (find-eepitch-debug-links): new function.
 
diff --git a/VERSION b/VERSION
index 6c9f2d7fc1..d5390e11d9 100644
--- a/VERSION
+++ b/VERSION
@@ -1,2 +1,2 @@
-Tue Dec  5 05:24:50 GMT 2023
-Tue Dec  5 02:24:50 -03 2023
+Sun Dec 17 01:01:43 GMT 2023
+Sat Dec 16 22:01:43 -03 2023
diff --git a/eev-intro.el b/eev-intro.el
index e5e4aec44a..df9c21b928 100644
--- a/eev-intro.el
+++ b/eev-intro.el
@@ -19,7 +19,7 @@
 ;;
 ;; Author:     Eduardo Ochs <eduardoochs@gmail.com>
 ;; Maintainer: Eduardo Ochs <eduardoochs@gmail.com>
-;; Version:    20230107
+;; Version:    20231216
 ;; Keywords:   e-scripts
 ;;
 ;; Latest version: <http://anggtwu.net/eev-current/eev-intro.el>
@@ -97,6 +97,7 @@
 ;; «.find-kla-intro»                   (to "find-kla-intro")
 ;; «.find-edit-index-intro»            (to "find-edit-index-intro")
 ;; «.find-rstdoc-intro»                        (to "find-rstdoc-intro")
+;; «.find-show2-intro»                 (to "find-show2-intro")
 
 ;; Videos:
 ;; «.find-three-main-keys-intro»       (to "find-three-main-keys-intro")
@@ -2831,18 +2832,19 @@ These ones explain advanced features that require extra 
setup:
   31. (find-kla-intro)
   32. (find-edit-index-intro)
   33. (find-rstdoc-intro)
-  34. (find-prepared-intro)
-  35. (find-bounded-intro)
-  36. (find-channels-intro)
+  34. (find-show2-intro)
+  35. (find-prepared-intro)
+  36. (find-bounded-intro)
+  37. (find-channels-intro)
 
 This one was used in a video:
 
-  37. (find-three-main-keys-intro)
+  38. (find-three-main-keys-intro)
 
 These ones are obsolete:
 
-  38. (find-emacs-intro)
-  39. (find-defun-intro)
+  39. (find-emacs-intro)
+  40. (find-defun-intro)
 
 For an index of the videos, run:
 
@@ -15973,6 +15975,187 @@ TODO: explain how to use `find-rstdoc-links'!
 
 
 
+;;;  ____  _                   ____  
+;;; / ___|| |__   _____      _|___ \ 
+;;; \___ \| '_ \ / _ \ \ /\ / / __) |
+;;;  ___) | | | | (_) \ V  V / / __/ 
+;;; |____/|_| |_|\___/ \_/\_/ |_____|
+;;;                                  
+;; «find-show2-intro»  (to ".find-show2-intro")
+;; Skel: (find-intro-links "show2")
+;; Test: (find-show2-intro)
+
+(defun find-show2-intro (&rest pos-spec-list) (interactive)
+  (let ((ee-buffer-name "*(find-show2-intro)*"))
+    (apply 'find-eintro "\
+\(Re)generate: (find-show2-intro)
+Source code:  (find-efunction 'find-show2-intro)
+More intros:  (find-eev-quick-intro)
+              (find-eev-intro)
+              (find-eepitch-intro)
+This buffer is _temporary_ and _editable_.
+It is meant as both a tutorial and a sandbox.
+
+
+
+Introduction
+============
+My presentation at the EmacsConf2023 was titled \"REPLs in
+strange places: Lua, LaTeX, LPeg, LPegRex, TikZ\". My page about
+it is here,
+
+  http://anggtwu.net/emacsconf2023.html
+
+and its video is here:
+
+  Info: (find-1stclassvideo-links \"eev2023repls\")
+  Play: (find-eev2023replsvideo \"0:00\")
+  Subs: (find-1stclassvideolsubs \"eev2023repls\")
+        http://anggtwu.net/emacsconf2023-repls.html
+
+The presentation was about a family of small Lua programs that
+were all built on top of these two libraries:
+
+  http://anggtwu.net/LUA/Show2.lua.html
+  http://anggtwu.net/LUA/ELpeg1.lua.html
+         (find-angg \"LUA/Show2.lua\")
+         (find-angg \"LUA/ELpeg1.lua\")
+
+where Show2.lua is the module that lets us generate LaTeX code
+from REPLs and that displays the resulting PDFs using a 3-window
+setting like this one,
+
+   ___________________________
+  |           |               |
+  |           |  [t]arget     |
+  | the file  |   buffer      |
+  |   being   |_______________|
+  | [e]dited  |               |
+  | (a .lua)  |  [v]iew the   |
+  |           | resulting PDF |
+  |___________|_______________|
+
+and ELpeg1 is the module that lets us create parsers in REPLs. In
+most cases these parsers return abstract syntax trees (ASTs),
+that are displayed in a format like this one:
+
+  Stmt__.________________.
+  |     |                |
+  if    Expr__._____.    Stmt
+        |     |     |    |
+        Id    Optr  Num  StmtList_______.
+        |     |     |    |              |
+        x     >     9    Stmt__.__.     Stmt__.__.
+                         |     |  |     |     |  |
+                         Id    =  Expr  Id    =  Expr__._____.
+                         |        |     |        |     |     |
+                         x        Num   y        Id    Optr  Num
+                                  |              |     |     |
+                                  0              y     +     1
+
+Installation (on Debian)
+========================
+
+ (eepitch-shell)
+ (eepitch-kill)
+ (eepitch-shell)
+sudo apt-get install lua5.1 lua5.1-doc lua5.2 lua5.2-doc 
+sudo apt-get install lua-lpeg lua-lpeg-dev
+sudo apt-get install luarocks
+sudo apt-get install texlive-latex-extra
+
+ Clone the git repository
+rm -Rfv /tmp/show2-elpeg1/
+mkdir   /tmp/show2-elpeg1/
+cd      /tmp/show2-elpeg1/
+git clone https://github.com/edrx/show2-elpeg1 .
+ (code-c-d \"show2\" \"/tmp/show2-elpeg1/\" :anchor)
+ Test: (find-show2file \"\")
+       (find-show2\"\")
+
+ Links to some manuals
+ (code-brappend \"lua51manual\"  
\"file:///usr/share/doc/lua5.1-doc/doc/manual.html\")
+ (code-brappend \"lua52manual\"  
\"file:///usr/share/doc/lua5.2-doc/manual.html\")
+ (code-brappend \"lpegmanual\"   
\"file:///usr/share/doc/lua-lpeg-dev/lpeg.html\")
+ (code-brappend \"lpegremanual\" 
\"file:///usr/share/doc/lua-lpeg-dev/re.html\")
+ Test: (find-lua51manual)
+       (find-lua52manual)
+       (find-lpegmanual)
+       (find-lpegremanual)
+
+ Download and compile lpegrex and lpeglabel.
+ I couldn't make their rocks work, so...
+ (eepitch-shell)
+ (eepitch-kill)
+ (eepitch-shell)
+rm -Rfv /tmp/show2-elpeg1/lpeglabel
+rm -Rfv /tmp/show2-elpeg1/lpegrex
+cd      /tmp/show2-elpeg1/
+git clone https://github.com/sqmedeiros/lpeglabel
+git clone https://github.com/edubart/lpegrex
+cd      /tmp/show2-elpeg1/lpeglabel/
+make LUADIR=/usr/include/lua5.2      2>&1 | tee om
+
+ Make some ennvironment variables point to /tmp/show2-elpeg1/
+ (setenv \"SHOW2LUADIR\"   \"/tmp/show2-elpeg1/LUA\")
+ (setenv \"SHOW2LATEXDIR\" \"/tmp/show2-elpeg1/LATEX\")
+ (setenv \"LUA_INIT\"     \"@/tmp/show2-elpeg1/LUA/lua50init.lua\")
+ (setenv \"LUA_PATH\"      \"/tmp/show2-elpeg1/LUA/?.lua;;\")
+
+ Test:
+ (eepitch-lua51)
+ (eepitch-kill)
+ (eepitch-lua51)
+PP({10,20,\"30\",d=40})
+require \"Tos2\"
+PPC(Tos.__index)
+
+ Test lpegrex: first test
+ (eepitch-lua52)
+ (eepitch-kill)
+ (eepitch-lua52)
+Path.prepend(\"path\",  \"/tmp/show2-elpeg1/lpeglabel/?.lua\")
+Path.prepend(\"cpath\", \"/tmp/show2-elpeg1/lpeglabel/?.so\")
+Path.prepend(\"path\",  \"/tmp/show2-elpeg1/lpegrex/?.lua\")
+require \"lpegrex\"
+require \"tests/csv-test\"
+arg =  {\"/home/edrx/usrc/lpegrex/examples/lua-ast.lua\"}
+require \"examples/lua-ast\"
+
+ Test lpegrex: second test
+ (eepitch-lua52)
+ (eepitch-kill)
+ (eepitch-lua52)
+loadlpegrex \"/tmp/show2-elpeg1\"
+Path.addLUAtopath()
+require \"Tos2\"
+PPC(lpegrex)
+
+
+
+
+Environment variables
+=====================
+;; (find-code-show2 \"/tmp/Show2.tex\")
+
+
+
+(show2)
+(show2 \"$SHOW2LATEXDIR/Show2.lua\")
+# (find-luarocks-links \"lpegrex\")
+
+
+(show2)
+=======
+
+
+
+" pos-spec-list)))
+
+;; (find-show2-intro)
+
+
+
 
 
 
diff --git a/eev-testblocks.el b/eev-testblocks.el
index 0280921b48..d687b45c7e 100644
--- a/eev-testblocks.el
+++ b/eev-testblocks.el
@@ -19,7 +19,7 @@
 ;;
 ;; Author:     Eduardo Ochs <eduardoochs@gmail.com>
 ;; Maintainer: Eduardo Ochs <eduardoochs@gmail.com>
-;; Version:    20230127
+;; Version:    20231214
 ;; Keywords:   e-scripts
 ;;
 ;; Latest version: <http://anggtwu.net/eev-current/eev-testblocks.el>
@@ -224,7 +224,7 @@ dofile \"%s\"
   (insert (ee-adjust-red-stars (format "
 # See: (find-eepitch-intro \"3.3. `eepitch-preprocess-line'\")
 # (setq eepitch-preprocess-regexp \"^\")
-# (setq eepitch-preprocess-regexp \"^#T \")
+# (setq eepitch-preprocess-regexp \"^#T ?\")
 #
 #T  (eepitch-shell)
 #T  (eepitch-kill)
@@ -238,7 +238,7 @@ dofile \"%s\"
   (insert (ee-adjust-red-stars (format "
 # See: (find-eepitch-intro \"3.3. `eepitch-preprocess-line'\")
 # (setq eepitch-preprocess-regexp \"^\")
-# (setq eepitch-preprocess-regexp \"^#T \")
+# (setq eepitch-preprocess-regexp \"^#T ?\")
 #
 #T  (eepitch-shell)
 #T  (eepitch-kill)
diff --git a/eev-tlinks.el b/eev-tlinks.el
index 289375e710..597077603e 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:    20231205
+;; Version:    20231216
 ;; Keywords:   e-scripts
 ;;
 ;; Latest version: <http://anggtwu.net/eev-current/eev-tlinks.el>
@@ -155,7 +155,11 @@
 ;; «.find-mbe-links»                   (to "find-mbe-links")
 ;; «.find-melpa-links»                 (to "find-melpa-links")
 ;; «.find-emacsclient-links»           (to "find-emacsclient-links")
-;; «.code-show2»                       (to "code-show2")
+;; «.find-show2-links»                 (to "find-show2-links")
+;;   «.show2»                          (to "show2")
+;;   «.code-show2»                     (to "code-show2")
+;;   «.find-luatb»                     (to "find-luatb")
+;; «.code-brappend»                    (to "code-brappend")
 ;; «.find-maximamsg-links»             (to "find-maximamsg-links")
 ;; «.find-maximamsg»                   (to "find-maximamsg")
 
@@ -4303,10 +4307,79 @@ emacsclient --eval '(find-livesofanimalspage 3)'
 ;;   (find-1stclassvideo-links "eev2023repls")
 ;;   (find-1stclassvideodef    "eev2023repls")
 ;;
+;; «find-show2-links»  (to ".find-show2-links")
+;; Skel: (find-find-links-links-new "show2" "texfile" "texdir texfile0")
+;; Test: (find-show2-links)
+;;
+(defun find-show2-links (&optional texfile &rest pos-spec-list)
+"Visit a temporary buffer containing hyperlinks for show2."
+  (interactive)
+  (setq texfile (or texfile "/tmp/Show2.tex"))
+  (let* ((texdir   (file-name-directory    texfile))
+         (texfile0 (file-name-nondirectory texfile)))
+    (apply
+     'find-elinks
+     `((find-show2-links ,texfile ,@pos-spec-list)
+       (find-show2-links "/tmp/Show2.tex" ,@pos-spec-list)
+       (find-show2-links "~/LATEX/Show2.tex" ,@pos-spec-list)
+       ;; Convention: the first sexp always regenerates the buffer.
+       (find-efunction 'find-show2-links)
+       (find-efunction 'show2)
+       ""
+       ,(ee-template0 "\
+ (find-angg \"LUA/Show2.lua\" \"texbody\")
+ (find-code-show2 \"{texfile}\")
+       (code-show2 \"{texfile}\")
+ (eepitch-lua51)
+ (eepitch-kill)
+ (eepitch-lua51)
+loadshow2()
+
+defs.repl = true
+usepackages.lipsum = [=[ \\usepackage{<}lipsum{>} ]=]
+
+body = [[
+  \\section{<}SA{>} \\lipsum[1-4]
+  \\section{<}SB{>} \\lipsum[5-8]
+  \\section{<}SC{>} \\lipsum[9-12]
+  \\condrepl
+]]
+= body:show0()
+= body:show()
+ (etv)
+= Show.log
+= Show.bigstr
+
+texbody = Dang.from \"Bla\\n<<body>>\"
+= show0()
+= show()
+ (etv)
+
+ (eepitch-shell)
+ (eepitch-kill)
+ (eepitch-shell)
+cd {texdir} && REPL=1 lualatex {texfile0}
+printmeaning \"newpage\"
+printmeaning \"@oddfoot\"
+")
+       )
+     pos-spec-list)
+    ))
+
+
+;; «show2»  (to ".show2")
+;; (find-eev "eev-tlinks.el" "code-show2")
+;; (find-es "show2")
+(defun show2 (&optional fname0)
+  (interactive)
+  (find-2a nil '(find-show2-links fname0)))
+
+
 ;; «code-show2»  (to ".code-show2")
 ;; Skel:  (find-code-xxx-links "show2" "fname0" "")
 ;; Tests: (find-code-show2)
 ;;        (find-code-show2 "./foo")
+;;        (find-code-show2 "/tmp/")
 ;;        (find-code-show2 "./foo.tex")
 ;; See:   (find-angg "LUA/Show2.lua")
 ;;        (find-angg "LUA/Show2.lua" "Show")
@@ -4318,12 +4391,13 @@ emacsclient --eval '(find-livesofanimalspage 3)'
   (find-estring-elisp (ee-code-show2 fname0)))
 (defun   ee-code-show2 (&optional fname0)
   (let* ((fname (ee-expand (or fname0 "/tmp/Show2.tex")))
-        (dir  (file-name-directory fname))
-        (stem (file-name-nondirectory
-               (file-name-sans-extension fname)))
-        (tex (concat stem ".tex"))
-        (pdf (concat stem ".pdf"))
-        (cmd (format "cd %s && lualatex %s.tex < /dev/null" dir stem)))
+        (dir   (file-name-directory fname))
+        (stem0 (file-name-nondirectory
+                (file-name-sans-extension fname)))
+        (stem  (if (equal stem0 "") "Show2" stem0))
+        (tex   (concat stem ".tex"))
+        (pdf   (concat stem ".pdf"))
+        (cmd   (format "cd %s && lualatex %s.tex < /dev/null" dir stem)))
     (ee-template0 "\
 ;; (find-code-show2 \"{fname}\")
 ;;      (code-show2 \"{fname}\")
@@ -4361,6 +4435,7 @@ emacsclient --eval '(find-livesofanimalspage 3)'
 ;; Arg1:  fname0 -> {(ee-S fname0)}
 ;; Vars:   fname -> {(ee-S fname)}
 ;;           dir -> {(ee-S dir)}
+;;         stem0 -> {(ee-S stem0)}
 ;;          stem -> {(ee-S stem)}
 ;;           tex -> {(ee-S tex)}
 ;;           pdf -> {(ee-S pdf)}
@@ -4401,6 +4476,64 @@ emacsclient --eval '(find-livesofanimalspage 3)'
 
 
 
+;;;   __ _           _       _             _   _     
+;;;  / _(_)_ __   __| |     | |_   _  __ _| |_| |__  
+;;; | |_| | '_ \ / _` |_____| | | | |/ _` | __| '_ \ 
+;;; |  _| | | | | (_| |_____| | |_| | (_| | |_| |_) |
+;;; |_| |_|_| |_|\__,_|     |_|\__,_|\__,_|\__|_.__/ 
+;;;                                                  
+;; «find-luatb»  (to ".find-luatb")
+;; See: (find-angg "LUA/PrintFunction1.lua")
+;; Tests: (find-luatb "~/LUA/lua50init.lua 1072 1075  ")
+;;        (find-luatb "~/LUA/lua50init.lua 914 915 field atlevel")
+;;
+(defun find-luatb0 (&optional fname linedef linenow &rest rest)
+  "An internal function used by `find-luatb'."
+  (find-fline fname)
+  (let* ((ld (and (stringp linedef) (string-to-number linedef)))
+         (ln (and (stringp linenow) (string-to-number linenow)))
+         (ldpos (progn (ee-goto-position ld) (ee-bol)))
+         (pos   (progn (ee-goto-position ln) (ee-eol)))
+         (lnpos (progn (ee-goto-position (+ ln 1)) (ee-bol))))
+    (eeflash ldpos lnpos ee-highlight-spec)
+    (goto-char pos)))
+
+(defun find-luatb (str &rest rest)
+  "See: (find-show2-intro)
+Some of the Lua modules in (find-show2-intro) use `find-luatb'."
+  (find-2a nil `(apply 'find-luatb0 (ee-split ,str))))
+
+
+
+;;;  _                                          _ 
+;;; | |__  _ __ __ _ _ __  _ __   ___ _ __   __| |
+;;; | '_ \| '__/ _` | '_ \| '_ \ / _ \ '_ \ / _` |
+;;; | |_) | | | (_| | |_) | |_) |  __/ | | | (_| |
+;;; |_.__/|_|  \__,_| .__/| .__/ \___|_| |_|\__,_|
+;;;                 |_|   |_|                     
+;;
+;; «code-brappend»  (to ".code-brappend")
+;; Skel: (find-code-xxx-links "brappend" "c url f" "")
+
+(defun      code-brappend (c url &optional f)
+  (eval (ee-read      (ee-code-brappend c url f))))
+(defun find-code-brappend (c url &optional f)
+  (find-estring-elisp (ee-code-brappend c url f)))
+(defun   ee-code-brappend (c url &optional f)
+  (setq f (or f 'brg))
+  (ee-template0 "\
+;; (find-code-brappend \"{<}c{>}\" \"{<}url{>}\")
+;; (find-code-brappend \"{<}c{>}\" \"{<}url{>}\" 'brgl)
+;;
+(defun find-{c} (&optional anchor &rest rest)
+  (interactive)
+  ({f} (concat \"{url}\"
+               (or anchor \"\"))))
+"))
+
+
+
+
 ;;;  __  __            _                 __  __           
 ;;; |  \/  | __ ___  _(_)_ __ ___   __ _|  \/  |___  __ _ 
 ;;; | |\/| |/ _` \ \/ / | '_ ` _ \ / _` | |\/| / __|/ _` |
diff --git a/eev-videolinks.el b/eev-videolinks.el
index a5a2dc6383..c49f17f82a 100644
--- a/eev-videolinks.el
+++ b/eev-videolinks.el
@@ -19,7 +19,7 @@
 ;;
 ;; Author:     Eduardo Ochs <eduardoochs@gmail.com>
 ;; Maintainer: Eduardo Ochs <eduardoochs@gmail.com>
-;; Version:    20231203
+;; Version:    20231216
 ;; Keywords:   e-scripts
 ;;
 ;; Latest version: <http://anggtwu.net/eev-current/eev-videolinks.el>
@@ -1126,6 +1126,7 @@ For more info on this particular video, run:
      :yt    "http://www.youtube.com/watch?v=IDBQo_YYfA8";
      :page  "http://anggtwu.net/emacsconf2023.html";
      :date    "2023dec02"
+     :subs    ".vtt"
      :length  "59:11"
      :comment "My presentation at the EmacsConf2023.")
     ))
diff --git a/eev.el b/eev.el
index ea5215ae61..cff587e1a8 100644
--- a/eev.el
+++ b/eev.el
@@ -6,7 +6,7 @@
 ;; Package-Requires: ((emacs "24.4"))
 ;; Keywords: lisp e-scripts
 ;; URL: http://anggtwu.net/#eev
-;; Version: 20230127
+;; Version: 20231216
 
 ;; 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



reply via email to

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