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

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

[elpa] externals/eev a0fb35ffa9: Added more functions and docs related t


From: ELPA Syncer
Subject: [elpa] externals/eev a0fb35ffa9: Added more functions and docs related to the EmacsConf2023.
Date: Sun, 17 Dec 2023 03:57:51 -0500 (EST)

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

    Added more functions and docs related to the EmacsConf2023.
---
 ChangeLog         |   9 +++
 VERSION           |   4 +-
 eev-intro.el      | 172 ++++++++++++++++++++++++++++++++++++++++++++++++------
 eev-tlinks.el     |  18 +++---
 eev-videolinks.el |  53 ++++++++++++++++-
 5 files changed, 228 insertions(+), 28 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index a08686c2c9..d08b73205f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2023-12-17  Eduardo Ochs  <eduardoochs@gmail.com>
+
+       * eev-videolinks.el (ee-all-cs-with-subs, code-lsubs)
+       (find-code-lsubs, ee-code-lsubs, code-all-lsubs)
+       (find-code-all-lsubs, ee-code-all-lsubs): new functions.
+
+       * eev-tlinks.el (find-angg-es-links): added a definition for
+       `find-anggfile'.
+
 2023-12-16  Eduardo Ochs  <eduardoochs@gmail.com>
 
        * eev.el: bumped the version.
diff --git a/VERSION b/VERSION
index d5390e11d9..1a704bc547 100644
--- a/VERSION
+++ b/VERSION
@@ -1,2 +1,2 @@
-Sun Dec 17 01:01:43 GMT 2023
-Sat Dec 16 22:01:43 -03 2023
+Sun Dec 17 06:21:30 GMT 2023
+Sun Dec 17 03:21:30 -03 2023
diff --git a/eev-intro.el b/eev-intro.el
index df9c21b928..6c260023cb 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:    20231216
+;; Version:    20231217
 ;; Keywords:   e-scripts
 ;;
 ;; Latest version: <http://anggtwu.net/eev-current/eev-intro.el>
@@ -15998,8 +15998,9 @@ It is meant as both a tutorial and a sandbox.
 
 
 
-Introduction
-============
+
+1. Introduction
+===============
 My presentation at the EmacsConf2023 was titled \"REPLs in
 strange places: Lua, LaTeX, LPeg, LPegRex, TikZ\". My page about
 it is here,
@@ -16010,7 +16011,7 @@ and its video is here:
 
   Info: (find-1stclassvideo-links \"eev2023repls\")
   Play: (find-eev2023replsvideo \"0:00\")
-  Subs: (find-1stclassvideolsubs \"eev2023repls\")
+  Subs: (find-eev2023replslsubs \"0:00\")
         http://anggtwu.net/emacsconf2023-repls.html
 
 The presentation was about a family of small Lua programs that
@@ -16053,15 +16054,26 @@ that are displayed in a format like this one:
                                   |              |     |     |
                                   0              y     +     1
 
-Installation (on Debian)
-========================
 
+
+2. Installation (on Debian)
+===========================
+
+ Make sure that you have pdf-tools installed in Emacs.
+ Note: some of the sexps below take a long time - many seconds!
+ (find-epackage-links 'pdf-tools)
+  (package-initialize)
+  (package-refresh-contents)
+  (package-install 'pdf-tools)
+ (find-epackage   'pdf-tools)
+
+ Make sure that we have the Debian packages that we need
  (eepitch-shell)
  (eepitch-kill)
  (eepitch-shell)
-sudo apt-get install lua5.1 lua5.1-doc lua5.2 lua5.2-doc 
+sudo apt-get install lua5.1 lua5.1-doc lua5.1-dev
+sudo apt-get install lua5.2 lua5.2-doc lua5.2-dev
 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
@@ -16071,7 +16083,8 @@ 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\"\")
+       (find-show2 \"\")
+       (find-show2 \"README.org\")
 
  Links to some manuals
  (code-brappend \"lua51manual\"  
\"file:///usr/share/doc/lua5.1-doc/doc/manual.html\")
@@ -16134,19 +16147,144 @@ PPC(lpegrex)
 
 
 
-Environment variables
-=====================
-;; (find-code-show2 \"/tmp/Show2.tex\")
+3. Show2.lua
+============
+Remember that Show2.lua uses a 3-window setting like this:
+   ___________________________
+  |           |               |
+  |           |  [t]arget     |
+  | the file  |   buffer      |
+  |   being   |_______________|
+  | [e]dited  |               |
+  | (a .lua)  |  [v]iew the   |
+  |           | resulting PDF |
+  |___________|_______________|
 
+Let's see how that works in practice.
 
 
-(show2)
-(show2 \"$SHOW2LATEXDIR/Show2.lua\")
-# (find-luarocks-links \"lpegrex\")
 
+3.1. A minimal example
+----------------------
+This is a minimal example of how to use Show2.lua:
 
-(show2)
-=======
+ (code-show2 \"/tmp/Show2.tex\")
+ (eepitch-lua51)
+ (eepitch-kill)
+ (eepitch-lua51)
+loadshow2()
+body = [[ HELLO ]]
+= body:show()
+ (etv)
+
+The `(code-show2 ...)' in the beginning makes Emacs and Show2.lua
+use the directory \"/tmp/\" and the files \"/tmp/Show2.tex\" and
+\"/tmp/Show2.pdf\"; the
+
+  = body:show()
+
+runs lualatex on \"/tmp/Show2.tex\" and then prints either
+
+  Show: /tmp/Show2.tex => ?
+
+or:
+
+  Show: /tmp/Show2.tex => Success!
+
+and the \" (etv)\" at the end displays the resulting PDF in the
+lower right window. To keep the code simple the `(etv)' doesn't
+wait for the PDF to be produced; after typing an <f8> in the line
+with the
+
+  = body:show()
+
+you will have to wait until it prints a result -
+\"...Success!!!\" or \"...?\" - and only then type an <f8> on the
+line with the \" (etv)\".
+
+Try to run the \"minimal example\" at the beginning of this
+section with <f8>s. Don't forget to wait after the \":show()\"!
+
+
+
+
+3.2. An example with extra lines
+--------------------------------
+Try to run the example below with <f8>s - and don't forget to
+wait a bit after the \":show()\":
+
+ (find-code-show2 \"/tmp/Show2.tex\")
+       (code-show2 \"/tmp/Show2.tex\")
+ (eepitch-lua51)
+ (eepitch-kill)
+ (eepitch-lua51)
+loadshow2()
+body = [[ \\HELLO ]]
+body = [[  HELLO ]]
+= body:show00 {scale=4}
+= body:show0  {scale=4}
+= body:show   {scale=4}
+ (etv)
+= Show.log
+= Show.bigstr
+
+The \"\" in the first line makes the <f8> treat it as comment,
+but if you execute it with `M-e' you will get a temporary buffer
+with a detailed explanation of what the `(code-show2 ...)' does.
+
+The two \"body = ...\" lines let you choose between \"HELLO\",
+that is valid LaTeX code, and \"\\HELLO\", that will yield an
+error. Choosing is explained here:
+
+  (find-elisp-intro \"5. Variables\")
+  (find-elisp-intro \"5. Variables\" \"choosing the right order\")
+
+The \"{scale=4}\" is a Lua table with options for \":show\". The
+lines with \":show00\" and \":show0\" can be used to inspect the
+first steps of what the \":show\" would do: the \":show00\" just
+applies the options in the \"{scale=4}\" on the \"body\", and the
+\":show0\" does that and returns the contents of (what would be)
+the full .tex file.
+
+The \":show\" saves the log of running lualatex in Show.log and
+saves the contexts of the .tex file in Show.bigstr. Try to run
+the block above again, but now run the
+
+  body = [[ \\HELLO ]]
+
+and skip the:
+
+  body = [[  HELLO ]]
+
+Now the \":show\" will return a \"?\" indicating an error, and
+the \" (etv)\" will fail. You can use the \"= Show.log\" and the
+\"= Show.bigstr\" to see the exact error message and the LaTeX
+code that caused it.
+
+
+
+3.3. ParseTree2.lua
+-------------------
+Now try to run the example in this test block:
+
+  (find-show2 \"LUA/ParseTree2.lua\" \"ParseTree-tests\")
+
+You should get something very similar to example that I used at
+the beginning and at the end of my presentation at the
+EmacsConf2023:
+
+  (find-eev2023replsvideo \"0:00\")
+  (find-eev2023replslsubs \"0:00\")
+  (find-eev2023replsvideo \"56:58\")
+  (find-eev2023replslsubs \"56:58\")
+
+
+
+4. ELpeg1.lua
+=============
+To be written! See:
+
+  (find-show2 \"LUA/ELpeg1.lua\")
 
 
 
diff --git a/eev-tlinks.el b/eev-tlinks.el
index 597077603e..82d12e1e46 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:    20231216
+;; Version:    20231217
 ;; Keywords:   e-scripts
 ;;
 ;; Latest version: <http://anggtwu.net/eev-current/eev-tlinks.el>
@@ -3108,9 +3108,9 @@ This function is used by `ee-0x0-upload-region'."
      ,(ee-template0 "\
 
 
-;; The `progn' below is how I (edrx) define `find-angg' and
-;; `find-es' in my machine to point to local files. Note that the
-;; sexps
+;; The `progn' below is how I (edrx) define `find-angg',
+;; `find-anggfile' and `find-es' in my machine to point to local
+;; files. Note that the sexps
 ;;
 ;;   (find-angg \"foo\" \"anchor\")
 ;;   (find-es   \"foo\" \"anchor\")
@@ -3133,14 +3133,16 @@ This function is used by `ee-0x0-upload-region'."
 
 
 
-;; The `progn' below defines versions of `find-angg' and
-;; `find-es' that use `find-wget' to access the
-;; public copies of my files at anggtwu.net:
+;; The `progn' below defines versions of `find-angg',
+;; `find-anggfile' and `find-es' that use `find-wget' to access
+;; the public copies of my files at anggtwu.net:
 ;;
 (progn
 
   (defun find-angg (fname &rest rest)
     (apply 'find-wgeta (format \"http://anggtwu.net/%s\"; fname) rest))
+  (defun find-anggfile (fname &rest rest)
+    (apply 'find-wget  (format \"http://anggtwu.net/%s\"; fname) rest))
   (defun find-es (fname &rest rest)
     (apply 'find-wgeta (format \"http://anggtwu.net/e/%s.e\"; fname) rest))
 
@@ -4424,7 +4426,7 @@ printmeaning \"@oddfoot\"
 ;;   {cmd}
 ;;
 ;; When both SHOW2DIR and SHOW2STEM are undefined Show2.lua
-;; will use /tmp/ and /tmp/Show2.lua.
+;; will use /tmp/ and /tmp/Show2.tex.
 ;;
 ;; To understand how the argument to `code-show2' works, try:
 ;;        (find-code-show2)
diff --git a/eev-videolinks.el b/eev-videolinks.el
index c49f17f82a..5d6b054c20 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:    20231216
+;; Version:    20231217
 ;; Keywords:   e-scripts
 ;;
 ;; Latest version: <http://anggtwu.net/eev-current/eev-videolinks.el>
@@ -110,6 +110,8 @@
 ;; «.second-class-videos»              (to "second-class-videos")
 ;;   «.code-eevvideo»                  (to "code-eevvideo")
 ;;   «.code-youtubevideo»              (to "code-youtubevideo")
+;; «.code-lsubs»                       (to "code-lsubs")
+;;   «.code-all-lsubs»                 (to "code-all-lsubs")
 
 ;;; Commentary:
 
@@ -1287,6 +1289,55 @@ For more info on this particular video, run:
 
 
 
+;;;                _            _           _         
+;;;   ___ ___   __| | ___      | |___ _   _| |__  ___ 
+;;;  / __/ _ \ / _` |/ _ \_____| / __| | | | '_ \/ __|
+;;; | (_| (_) | (_| |  __/_____| \__ \ |_| | |_) \__ \
+;;;  \___\___/ \__,_|\___|     |_|___/\__,_|_.__/|___/
+;;;                                                   
+;; «code-lsubs»  (to ".code-lsubs")
+;; Tests: (find-eppp (ee-all-cs-with-subs))
+;;        (find-code-lsubs "eev2023repls")
+;;        (find-code-all-lsubs '("eev2019" "eevnav"))
+;;        (find-code-all-lsubs)
+;;
+(defun ee-all-cs-with-subs ()
+  (cl-loop for entry in ee-1stclassvideos-info
+           if (ee-1stclassvideos-field (car entry) :subs)
+          collect (car entry)))
+
+;; Skels: (find-code-xxx-links "lsubs" "c" "")
+;;        (find-code-xxx-links "all-lsubs" "cs" "")
+;;    
+(defun      code-lsubs (c)
+  (eval (ee-read      (ee-code-lsubs c))))
+(defun find-code-lsubs (c)
+  (find-estring-elisp (ee-code-lsubs c)))
+(defun   ee-code-lsubs (c)
+  (ee-template0 "\
+;; (find-code-lsubs \"{c}\")
+;;      (code-lsubs \"{c}\")
+;;
+;; Tests: (find-{c}lsubs)
+;;        (find-{c}lsubs \"00:00\")
+;;        (find-1stclassvideo-links \"{c}\")
+;;
+(defun find-{c}lsubs (&rest pos-spec-list)
+  (apply 'find-1stclassvideolsubs \"{c}\" pos-spec-list))
+"))
+
+(defun      code-all-lsubs (&optional cs)
+  (eval (ee-read      (ee-code-all-lsubs cs))))
+(defun find-code-all-lsubs (&optional cs)
+  (find-estring-elisp (ee-code-all-lsubs cs)))
+(defun   ee-code-all-lsubs (&optional cs)
+  (mapconcat 'ee-code-lsubs (or cs (ee-all-cs-with-subs)) "\n\n"))
+
+;; «code-all-lsubs»  (to ".code-all-lsubs")
+;; This defines lots of functions with names like `find-<c>lsubs'.
+;; Try: (find-code-all-lsubs)
+             (code-all-lsubs)
+
 
 
 



reply via email to

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