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

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

[elpa] externals/eev dba503edd9: Rewrote `ee-code=show2'.


From: ELPA Syncer
Subject: [elpa] externals/eev dba503edd9: Rewrote `ee-code=show2'.
Date: Mon, 6 Nov 2023 21:57:57 -0500 (EST)

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

    Rewrote `ee-code=show2'.
---
 ChangeLog     |  22 ++++++
 VERSION       |   4 +-
 eev-blinks.el |   4 +-
 eev-brxxx.el  |   6 +-
 eev-elinks.el |   4 +-
 eev-intro.el  |   2 +-
 eev-plinks.el |  12 +++-
 eev-tlinks.el | 211 +++++++++++++++++++++++++++++++++++++++++++++++++++-------
 8 files changed, 230 insertions(+), 35 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 9ee81f95fc..fd5b97bcaf 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,25 @@
+2023-11-06  Eduardo Ochs  <eduardoochs@gmail.com>
+
+       * eev-tlinks.el (ee-code-show2): rewritten.
+
+       * eev-elinks.el (ee-find-grep-links1): added an `ee-find-grep'.
+
+       * eev-blinks.el (find-node): use `ee-goto-rest' instead of
+       `ee-goto-position' (for `find-maximanode').
+
+2023-07-19  Eduardo Ochs  <eduardoochs@gmail.com>
+
+       * eev-brxxx.el (ee-dired-to-fname): added a `file-name-unquote'.
+
+2023-07-17  Eduardo Ochs  <eduardoochs@gmail.com>
+
+       * eev-tlinks.el (find-mbe-links, ee-grim): new functions.
+       (find-wgetrecursive-links): new function.
+
+       * eev-plinks.el (find-callprocessregion): the argument "input" was
+       missing; fixed.
+       (ee-callprocessregion): new function.
+
 2023-05-21  Eduardo Ochs  <eduardoochs@gmail.com>
 
        * eev-tlinks.el (code-etv2, find-code-etv2, ee-code-etv2):
diff --git a/VERSION b/VERSION
index 1858322870..bf271a1b6c 100644
--- a/VERSION
+++ b/VERSION
@@ -1,2 +1,2 @@
-Sun May 21 08:46:56 GMT 2023
-Sun May 21 05:46:56 -03 2023
+Tue Nov  7 01:10:36 GMT 2023
+Mon Nov  6 22:10:36 -03 2023
diff --git a/eev-blinks.el b/eev-blinks.el
index 6eb39da262..0296aceae1 100644
--- a/eev-blinks.el
+++ b/eev-blinks.el
@@ -21,7 +21,7 @@
 ;;
 ;; Author:     Eduardo Ochs <eduardoochs@gmail.com>
 ;; Maintainer: Eduardo Ochs <eduardoochs@gmail.com>
-;; Version:    20230421
+;; Version:    20231106
 ;; Keywords:   e-scripts
 ;;
 ;; Latest version: <http://anggtwu.net/eev-current/eev-blinks.el>
@@ -263,7 +263,7 @@ Examples:\n
   (info \"(emacs)Lisp Eval\")
   (find-node \"(emacs)Lisp Eval\" \"C-x C-e\")"
   (info nodestr)
-  (apply 'ee-goto-position pos-spec-list))
+  (ee-goto-rest pos-spec-list))
 
 
 
diff --git a/eev-brxxx.el b/eev-brxxx.el
index 1d6d4666c5..faf6c69192 100644
--- a/eev-brxxx.el
+++ b/eev-brxxx.el
@@ -19,7 +19,7 @@
 ;;
 ;; Author:     Eduardo Ochs <eduardoochs@gmail.com>
 ;; Maintainer: Eduardo Ochs <eduardoochs@gmail.com>
-;; Version:    20230127
+;; Version:    20230719
 ;; Keywords:   e-scripts
 ;;
 ;; Latest version: <http://anggtwu.net/eev-current/eev-brxxx.el>
@@ -192,7 +192,9 @@ This should be made smarter - file:// urls should be 
returned unchanged."
 (defun ee-dired-to-fname (&optional no-error-if-not-filep)
   "Convert the file name at point (in dired mode) to an absolute file name."
   (if (eq major-mode 'dired-mode)
-      (file-name-sans-versions (dired-get-filename nil no-error-if-not-filep) 
t)
+      (file-name-unquote
+       (file-name-sans-versions
+       (dired-get-filename nil no-error-if-not-filep) t))
     (error "Not in dired mode")))
 
 (defun ee-dired-to-url (&optional no-error-if-not-filep)
diff --git a/eev-elinks.el b/eev-elinks.el
index c40c6c3d9e..2b5d167604 100644
--- a/eev-elinks.el
+++ b/eev-elinks.el
@@ -19,7 +19,7 @@
 ;;
 ;; Author:     Eduardo Ochs <eduardoochs@gmail.com>
 ;; Maintainer: Eduardo Ochs <eduardoochs@gmail.com>
-;; Version:    20230513
+;; Version:    20231106
 ;; Keywords:   e-scripts
 ;;
 ;; Latest version: <http://anggtwu.net/eev-current/eev-elinks.el>
@@ -947,6 +947,8 @@ when this is true remove the prefix D from FNAME, and put 
the sexp
   "An internal function used by `find-grep-links'."
   (let ((dir (ee-shorten-file-name default-directory)))
     (list (ee-template0 "
+# (ee-find-grep {(ee-S dir)} {(ee-S (car grep-history))})
+
 (let ((default-directory {(ee-S dir)}))
   (grep {(ee-S (car grep-history))})
   )
diff --git a/eev-intro.el b/eev-intro.el
index f8dc1a13ac..667075e6da 100644
--- a/eev-intro.el
+++ b/eev-intro.el
@@ -317,7 +317,7 @@ point to positions in that video; to learn how to use links 
like
 those, visit this URL:
 
   http://anggtwu.net/eev-intros/find-video-links-intro.html
-                                (find-video-links-intro)
+                               (find-video-links-intro)
 
 Installing eev does NOT activate eev-mode. To activate eev-mode
 and open this tutorial, run `M-x eev-beginner'.
diff --git a/eev-plinks.el b/eev-plinks.el
index 721291ac66..c512101698 100644
--- a/eev-plinks.el
+++ b/eev-plinks.el
@@ -19,7 +19,7 @@
 ;;
 ;; Author:     Eduardo Ochs <eduardoochs@gmail.com>
 ;; Maintainer: Eduardo Ochs <eduardoochs@gmail.com>
-;; Version:    20230127
+;; Version:    20230717
 ;; Keywords:   e-scripts
 ;;
 ;; Latest version: <http://anggtwu.net/eev-current/eev-plinks.el>
@@ -227,6 +227,7 @@
 ;; To do: write examples and test cases for this.
 ;; See: (find-efunctiondescr 'call-process-region)
 ;;      (find-elnode "Synchronous Processes" "Function: call-process-region")
+;; Test: (find-callprocessregion "grep a" "a \n b \n aa \n c \n aaa")
 ;;
 (defun find-callprocessregion-ne (program-and-args input)
   (let ((argv (ee-split program-and-args)))
@@ -238,7 +239,14 @@
       (buffer-substring (point-min) (point-max)))))
 
 (defun find-callprocessregion (program-and-args input)
-  (find-callprocessregion-ne (ee-split-and-expand program-and-args)))
+  (find-callprocessregion-ne (ee-split-and-expand program-and-args) input))
+
+(defun ee-callprocessregion (cmd)
+  (interactive "sShell command: ")
+  "Run CMD on the region and display the output in a temporary buffer.
+This is similar to `shell-command-on-region'."
+  (find-estring (find-callprocessregion cmd (ee-region))))
+
 
 
 
diff --git a/eev-tlinks.el b/eev-tlinks.el
index a72678901b..a008ed9126 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:    20230521
+;; Version:    20231106
 ;; Keywords:   e-scripts
 ;;
 ;; Latest version: <http://anggtwu.net/eev-current/eev-tlinks.el>
@@ -151,6 +151,8 @@
 ;; «.find-rstdoc-links»                        (to "find-rstdoc-links")
 ;; «.find-mpv-links»                   (to "find-mpv-links")
 ;; «.find-try-sly-links»               (to "find-try-sly-links")
+;; «.find-wgetrecursive-links»         (to "find-wgetrecursive-links")
+;; «.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")
@@ -3741,12 +3743,13 @@ N should be either a number or a symbol; SEXP should be 
a sexp."
          (def     (ee-wrap-eejump strn strsexp)))
     (apply
      'find-elinks-elisp
-     `((find-eejump-links ,n ,sexp ,@pos-spec-list)
-       (find-eejump-links 999 '(find-elnode ""))
-       (find-eejump-links 'el '(find-elisp-intro))
+     `((find-eejump-links ,(ee-add-quote n) ,(ee-add-quote sexp) 
,@pos-spec-list)
        ;; Convention: the first sexp always regenerates the buffer.
        (find-efunction 'find-eejump-links)
        ""
+       ";; Try: (find-eejump-links 999 '(find-elnode \"\"))"
+       ";;      (find-eejump-links 'el '(find-elisp-intro))"
+       ""
        ";; See:"
        (find-eev-quick-intro "7. Quick access to one-liners")
        (find-eev-quick-intro "7.3. Defining eejump targets")
@@ -4097,6 +4100,118 @@ load(\"startsly\");
 
 
 
+;; «find-wgetrecursive-links»  (to ".find-wgetrecursive-links")
+;; Skel:  (find-find-links-links-new "wgetrecursive" "url" "lurl")
+;; Tests: (find-wgetrecursive-links)
+;;        (find-wgetrecursive-links "https://home.csulb.edu/~woollett/";)
+;;
+(defun find-wgetrecursive-links (&optional url &rest pos-spec-list)
+"Visit a temporary buffer containing a script for using wget --recursive."
+  (interactive)
+  (setq url (or url "{url}"))
+  (let* ((lurl (ee-url-to-fname0 url)))
+    (apply
+     'find-elinks
+     `((find-wgetrecursive-links ,url ,@pos-spec-list)
+       ;; Convention: the first sexp always regenerates the buffer.
+       (find-efunction 'find-wgetrecursive-links)
+       ""
+       (find-node "(wget)Recursive Download")
+       (find-node "(wget)Directory-Based Limits" "--no-parent")
+       (find-node "(wget)Recursive Retrieval Options" "--recursive")
+       (find-sh "wget --help" "--recursive")
+       (find-sh "wget --help" "--no-parent")
+       (find-es "wget" "recursive")
+       ""
+       ,(ee-H url)
+       (find-fline ,lurl)
+       ""
+       ,(ee-template0 "\
+ (eepitch-shell)
+ (eepitch-kill)
+ (eepitch-shell)
+rm -Rv /tmp/wget-recursive.tar
+rm -Rv /tmp/wget-recursive/
+mkdir  /tmp/wget-recursive/
+cd     /tmp/wget-recursive/
+
+wget --recursive --no-parent \\
+  {url}
+find | sort
+du -c
+du -ch
+
+# (find-fline     \"/tmp/wget-recursive/\")
+# (find-sh-at-dir \"/tmp/wget-recursive/\" \"find * | sort\")
+
+cd     /tmp/wget-recursive/
+tar              -cvf /tmp/wget-recursive.tar .
+tar -C $S/https/ -xvf /tmp/wget-recursive.tar
+
+# (find-fline \"{lurl}\")
+")
+       )
+     pos-spec-list)))
+
+
+
+
+;; «find-mbe-links»  (to ".find-mbe-links")
+;; Skel: (find-find-links-links-new "mbe" "ch page pos-spec" "nch")
+;; Test: (find-mbe-links)
+;;       (find-mbe-links 1)
+;;       (find-mbe-links 1 35 "1.8.11 Taylor and Laurent")
+;;
+(defun find-mbe-links (&optional ch page pos-spec &rest pos-spec-list)
+"Visit a temporary buffer containing hyperlinks for Maxima by Example."
+  (interactive)
+  (setq ch (or ch "{ch}"))
+  (setq page (or page "{page}"))
+  (setq pos-spec (or pos-spec "{pos-spec}"))
+  (let* ((nch (if (numberp ch) (format "%02d" ch) "{nch}")))
+    (apply
+     'find-elinks
+     `((find-mbe-links ,ch ,page ,pos-spec ,@pos-spec-list)
+       ,(ee-template0 "# (find-mbe{nch}page   {page} {(ee-S pos-spec)})")
+       ,(ee-template0 "# (find-mbe{nch}text   {page} {(ee-S pos-spec)})")
+       ,(ee-template0 "# (find-mbefile \"\" \"mbe{nch}\")")
+       ,(ee-template0 "# (find-mbefile \"\" \"mbe{ch}\")")
+       ;; Convention: the first sexp always regenerates the buffer.
+       (find-efunction 'find-mbe-links)
+       ""
+       ,(ee-H "https://home.csulb.edu/~woollett/mbe.html";)
+       (find-es "maxima" "maxima-by-example-eev")
+       (find-es "mbe")
+       ""
+       (find-angg ".emacs.papers" "maxima-by-example")
+       (find-mbetext 1 ,pos-spec)
+       ""
+       (find-eepitch-intro "3.3. `eepitch-preprocess-line'")
+       (setq eepitch-preprocess-regexp "^ *(%i[0-9]+) ?")
+       (defalias 'grim 'ee-grim)
+       ""
+       ,(ee-template0 "\
+ (eepitch-maxima)
+ (eepitch-kill)
+ (eepitch-maxima)
+")
+       )
+     pos-spec-list)))
+
+;; See the explanation here:
+;;   (find-es "mbe" "grim")
+(defun ee-grim ()
+  "<GR>ep the <I>nput lines in <M>axima code.
+This greps the lines containing strings like (%i1), (%i2), etc in
+the region and displays the output in a temporary buffer."
+  (interactive)
+  (ee-callprocessregion '("grep" "(%i")))
+
+
+
+
+
+
 ;; «find-melpa-links»  (to ".find-melpa-links")
 ;; Skel: (find-find-links-links-new "melpa" "" "")
 ;; Test: (find-melpa-links)
@@ -4171,21 +4286,21 @@ emacsclient --eval '(find-livesofanimalspage 3)'
 
 
 ;; «code-show2»  (to ".code-show2")
-;; Skel:  (find-code-xxx-links "show2" "fname" "")
+;; Skel:  (find-code-xxx-links "show2" "fname0" "")
 ;; Tests: (find-code-show2)
 ;;        (find-code-show2 "./foo")
 ;;        (find-code-show2 "./foo.tex")
 ;; See:   (find-angg "LUA/Show2.lua")
 ;;        (find-angg "LUA/Show2.lua" "Show")
 ;;
-(defun      code-show2 (&optional fname)
-  (eval (ee-read      (ee-code-show2 fname))))
-(defun find-code-show2 (&optional fname)
-  (find-estring-elisp (ee-code-show2 fname)))
-(defun   ee-code-show2 (&optional fname)
-  (setq fname (or fname "/tmp/Show2.tex"))
-  (setq fname (ee-expand fname))
-  (let* ((dir  (file-name-directory fname))
+(defun      code-show2 (&optional fname0)
+  (eval (ee-read      (ee-code-show2 fname0))))
+(defun find-code-show2 (&optional fname0)
+  (interactive)
+  (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"))
@@ -4194,29 +4309,75 @@ emacsclient --eval '(find-livesofanimalspage 3)'
     (ee-template0 "\
 ;; (find-code-show2 \"{fname}\")
 ;;      (code-show2 \"{fname}\")
-;; (find-efunction 'ee-code-show2)
+;;  (find-efunction 'code-show2)
+;;
 ;;
-;; See: http://anggtwu.net/LUA/Show2.lua.html
-;;             (find-angg \"LUA/Show2.lua\")
-;;             (find-angg \"LUA/Show2.lua\" \"Show\")
+;; Part 1: Lua
+;; ===========
+;; With the arguments above `code-show2' will set the
+;; environment variables SHOW2DIR and SHOW2STEM to:
+;;
+(setenv \"SHOW2DIR\"  \"{dir}\")
+(setenv \"SHOW2STEM\" \"{stem}\")
+;;
+;; These variables will be used by Show2.lua to determine which
+;; directory and which file to work on. The values above mean
+;; that Show2.lua will save the TeX code in this file,
 ;;
-;; Show2.lua will save the TeX code in:
 ;;                {dir}{stem}.tex
 ;;   (find-fline \"{dir}{stem}.tex\")
+;;
 ;; and will run this command to compile that .tex:
-;;   {cmd}
-;; Show2.lua uses the environment vars SHOW2DIR and SHOW2STEM
-;; to determine with directory and which file to use. When these
-;; environment variables are both nil it uses /tmp/Show2.lua.
 ;;
-(setenv \"SHOW2DIR\"  \"{dir}\")
-(setenv \"SHOW2STEM\" \"{stem}\")
+;;   {cmd}
 ;;
-;; The elisp functions `v' and `etv' will display this PDF:
+;; When both SHOW2DIR and SHOW2STEM are undefined Show2.lua
+;; will use /tmp/ and /tmp/Show2.lua.
+;;
+;; To understand how the argument to `code-show2' works, try:
+;;        (find-code-show2)
+;;        (find-code-show2 \"DIR/STEM.ext\")
+;;        (find-code-show2 \"/tmp/Show2.pdf\")
+;;        (find-code-show2 \"/tmp/Show2.tex\")
+;;        (find-code-show2 \"~/LATEX/Foo.tex\")
+;; Arg1:  fname0 -> {(ee-S fname0)}
+;; Vars:   fname -> {(ee-S fname)}
+;;           dir -> {(ee-S dir)}
+;;          stem -> {(ee-S stem)}
+;;           tex -> {(ee-S tex)}
+;;           pdf -> {(ee-S pdf)}
+;;           cmd -> {(ee-S cmd)}
+;;
+;; The logic is here:
+;;   (find-efunction    'code-show2)
+;;   (find-efunction 'ee-code-show2)
+;;   (find-angg \"LUA/Show2.lua\" \"Show\")
+;;   (find-angg \"LUA/Show2.lua\" \"texbody\")
+;;   (find-angg \"LUA/Show2.lua\" \"Dang\")
+;;
+;;
+;; Part 2: Emacs
+;; =============
+;; Eepitch-ing a line like this one
+;;
+;;    (etv)
+;;
+;; should create a 3-window setting like this:
+;;   _________________
+;;  |        |        |
+;;  |        | target |
+;;  |  edit  |________|
+;;  |        |        |
+;;  |        |  view  |
+;;  |________|________|
+;;
+;; The defuns below configure `v', `D' and `etv' to make them
+;; display the PDF produced by Show2.lua, that will be here:
 ;;   {dir}{stem}.pdf
 ;;
 (defun tb  () (interactive) (find-ebuffer (eepitch-target-buffer)))
 (defun v   () (interactive) (find-pdftools-page \"{dir}{stem}.pdf\"))
+(defun D   () (interactive) (find-pdf-page \"{dir}{stem}.pdf\"))
 (defun etv () (interactive) (find-wset \"13o2_o_o\" '(tb) '(v)))
 ")))
 



reply via email to

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