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

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

[elpa] externals/eev 97ade1b: Added `find-mupdf-page' and `find-pdf-txt'


From: ELPA Syncer
Subject: [elpa] externals/eev 97ade1b: Added `find-mupdf-page' and `find-pdf-txt'.
Date: Fri, 18 Jun 2021 00:57:08 -0400 (EDT)

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

    Added `find-mupdf-page' and `find-pdf-txt'.
---
 ChangeLog           |  14 ++++++++
 README.org          |  17 +++++++--
 VERSION             |   4 +--
 eev-audiovideo.el   |   5 +--
 eev-compose-hash.el |   2 +-
 eev-pdflike.el      |  29 +++++++++++++++
 eev-tla.el          | 100 +++++++++++++++++++++++++++++++++++++++++++++++++++-
 eev.el              |   2 +-
 8 files changed, 163 insertions(+), 10 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index c99ba5b..2ea91c3 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,19 @@
+2021-06-18  Eduardo Ochs  <eduardoochs@gmail.com>
+
+       * eev-tla.el (find-pdf-txt, find-pdf-txt-links)
+       (ee-fnamepdf-to-fnametxt, find-pdf-text-insert): new functions.
+
+       * eev-audiovideo.el (ee-find-mpv-audio): use "--start=mm:ss"
+       instead of "--start mm:ss" (thanks to Erich Ruff for the bug fix!)
+
 2021-06-08  Eduardo Ochs  <eduardoochs@gmail.com>
 
+       * eev-pdflike.el (ee-find-xpdf-colon): new variable.
+       (ee-find-xpdf-colon): new function.
+       (ee-find-xpdf-page): use `ee-find-xpdf-colon'.
+       (find-mupdf-page, ee-find-mupdf-page): new functions.
+       (ee-find-mupdf-page-options): new variable.
+
        * eev-blinks.el (ee-struct-class, ee-struct-slot-names)
        (ee-struct-slot-names+, ee-struct-index-table)
        (ee-struct-to-string, find-estruct): new functions.
diff --git a/README.org b/README.org
index 80608d9..76c8ae4 100644
--- a/README.org
+++ b/README.org
@@ -30,9 +30,12 @@ The best introductions to eev are:
   video starting at 
[[http://www.youtube.com/watch?v=86yiRG8YJD0#t=13m10s][13:10]]; the demo of 
eepitch starts at 
[[http://www.youtube.com/watch?v=86yiRG8YJD0#t=15m11s][15:11]],
 
 - "[[http://angg.twu.net/emacsconf2020.html][On why most of the best features 
in eev look like 5-minute hacks]]":
-  my talk at the EmacsConf 2020. It is mostly about design decisions,
-  but at [[http://www.youtube.com/watch?v=hOAqBc42Gg8#t=21m02s][21:02]] it 
shows how I use M-j to teach Emacs and eev to total
-  beginners, and at 
[[https://www.youtube.com/watch?v=hOAqBc42Gg8#t=18m47s][18:47]] it explains the 
design decisions behind M-j.
+  my talk at the EmacsConf 2020. It is mostly about design decisions;
+  for example, starting at 
[[http://www.youtube.com/watch?v=hOAqBc42Gg8#t=30m40s][30:40]] it explains why 
eev implements a
+  variant of 
[[http://www.gnu.org/software/emacs/manual/html_node/emacs/Key-Help.html][M-x 
describe-key]] that it much more hacker-friendly than
+  the standard one. At 
[[http://www.youtube.com/watch?v=hOAqBc42Gg8#t=21m02s][21:02]] it shows how I 
use M-j to teach Emacs and
+  eev to total beginners, and at 
[[https://www.youtube.com/watch?v=hOAqBc42Gg8#t=18m47s][18:47]] it explains the 
design
+  decisions behind M-j.
 
 - "[[http://www.youtube.com/watch?v=kxBjiUo88_U][How to install eev with M-x 
list-packages and how to navigate its
   tutorials]]". This is a video tutorial accessible to total beginners -
@@ -43,15 +46,23 @@ The best introductions to eev are:
 
 - its homepage: [[http://angg.twu.net/#eev]] .
 
+The "[Video links:]" blocks in the sandboxed tutorials are explained
+[[http://angg.twu.net/eev-intros/find-videos-intro.html#2][here]]; that link 
also has a list of the videos. See also 
[[https://lists.gnu.org/archive/html/emacs-devel/2021-05/msg00527.html][this
+announcement]] on emacs-devel.
+
 # (find-eev-quick-intro "3. Elisp hyperlinks")
 # (find-eev-quick-intro "6. Controlling shell-like programs")
 # (find-eev2019video "13:10" "Demo: patching xpdf")
 # (find-eev2019video "15:11" "Demo: the eepitch block (in red star lines)")
 # (find-eev2020video "18:47" "M-j - design decisions")
 # (find-eev2020video "21:02" "M-j itself")
+# (find-eev2020video "30:40" "their targets are not visible")
 # (ecop 8 "prehistory-7" "several megabytes")
 # (eco    "prehistory-7" "several megabytes")
 
+# http://angg.twu.net/eev-intros/find-videos-intro.html#2
+# (find-videos-intro "2. Short links to eev video tutorials")
+
 # (ecop 10 "prehistory-9" "users should not be forced to see Lisp")
 # (eco     "prehistory-9" "users should not be forced to see Lisp")
 
diff --git a/VERSION b/VERSION
index 4a5dddb..c3339bd 100644
--- a/VERSION
+++ b/VERSION
@@ -1,2 +1,2 @@
-Tue Jun  8 15:43:21 GMT 2021
-Tue Jun  8 12:43:21 -03 2021
+Fri Jun 18 04:22:33 GMT 2021
+Fri Jun 18 01:22:33 -03 2021
diff --git a/eev-audiovideo.el b/eev-audiovideo.el
index df0a22d..84352ba 100644
--- a/eev-audiovideo.el
+++ b/eev-audiovideo.el
@@ -19,7 +19,7 @@
 ;;
 ;; Author:     Eduardo Ochs <eduardoochs@gmail.com>
 ;; Maintainer: Eduardo Ochs <eduardoochs@gmail.com>
-;; Version:    20210512
+;; Version:    20210618
 ;; Keywords:   e-scripts
 ;;
 ;; Latest version: <http://angg.twu.net/eev-current/eev-audiovideo.el>
@@ -499,7 +499,8 @@ See: (find-audiovideo-intro \"`eev-avadj-mode'\")"
   `(,@ee-mpv-term-options
     "mpv"
     ,fname
-    ,@(if pos `("--start" ,(ee-secs-to-mm:ss pos)))
+    ;; ,@(if pos `("--start" ,(ee-secs-to-mm:ss pos)))
+    ,@(if pos (list (format "--start=%s" (ee-secs-to-mm:ss pos))))
     ,@ee-mpv-audio-options
     ))
 (defun    find-mpv-audio (fname &optional pos &rest rest)
diff --git a/eev-compose-hash.el b/eev-compose-hash.el
index 5e06967..aaca6c4 100644
--- a/eev-compose-hash.el
+++ b/eev-compose-hash.el
@@ -83,7 +83,7 @@
 ;; currently using these terms:
 ;;
 ;;   a "keys" means "a pair of easy-to-type characters" (that have an
-;;     unicode character associated to them,
+;;     unicode character associated to them),
 ;;
 ;;   a "pos" means this unicode character,
 ;;
diff --git a/eev-pdflike.el b/eev-pdflike.el
index e19a3b2..1bd7e56 100644
--- a/eev-pdflike.el
+++ b/eev-pdflike.el
@@ -183,6 +183,7 @@
 ;; «.find-xdvi-page»                   (to "find-xdvi-page")
 ;; «.find-djview-page»                 (to "find-djview-page")
 ;; «.find-evince-page»                 (to "find-evince-page")
+;; «.find-mupdfpage»                   (to "find-mupdfpage")
 ;; «.find-gv-page»                     (to "find-gv-page")
 ;; «.find-djvutxt-text»                        (to "find-djvutxt-text")
 ;; «.find-googlechrome-page»           (to "find-googlechrome-page")
@@ -853,6 +854,34 @@ may want to put here code that cleans up that page 
information.")
 
 
 
+
+;;;                            _  __ 
+;;;  _ __ ___  _   _ _ __   __| |/ _|
+;;; | '_ ` _ \| | | | '_ \ / _` | |_ 
+;;; | | | | | | |_| | |_) | (_| |  _|
+;;; |_| |_| |_|\__,_| .__/ \__,_|_|  
+;;;                 |_|              
+;;
+;; «find-mupdfpage»  (to ".find-mupdfpage")
+;; By Erich Ruff. See:
+;; https://lists.gnu.org/archive/html/eev/2021-06/msg00008.html
+
+(defun     find-mupdf-page (fname &optional page &rest rest)
+  (find-bgprocess (ee-find-mupdf-page fname page)))
+(defvar ee-find-mupdf-page-options '())
+(defun  ee-find-mupdf-page (fname &optional page &rest rest)
+  `("mupdf"
+    ,@ee-find-mupdf-page-options
+    ,fname
+    ,@(if page `(,(format "%s" page)))
+    ))
+
+;; (find-code-pdfbackend "mupdf-page")
+        (code-pdfbackend "mupdf-page")
+
+
+
+
 ;;;   ____       
 ;;;  / ___|_   __
 ;;; | |  _\ \ / /
diff --git a/eev-tla.el b/eev-tla.el
index b1450bb..b84db30 100644
--- a/eev-tla.el
+++ b/eev-tla.el
@@ -19,7 +19,7 @@
 ;;
 ;; Author:     Eduardo Ochs <eduardoochs@gmail.com>
 ;; Maintainer: Eduardo Ochs <eduardoochs@gmail.com>
-;; Version:    20210524
+;; Version:    20210618
 ;; Keywords:   e-scripts
 ;;
 ;; Latest version: <http://angg.twu.net/eev-current/eev-tla.el>
@@ -136,6 +136,9 @@
 ;; «.code-tla»                 (to "code-tla")
 ;; «.find-tla-def-links»       (to "find-tla-def-links")
 ;; «.find-tla-links»           (to "find-tla-links")
+;;
+;; «.find-pdf-txt»             (to "find-pdf-txt")
+;; «.find-pdf-txt-links»       (to "find-pdf-txt-links")
 
 
 
@@ -373,6 +376,101 @@ See: (find-eevfile \"eev-tla.el\" \";; Commentary:\")"
 
 
 
+;;;   __ _           _                 _  __       _        _   
+;;;  / _(_)_ __   __| |      _ __   __| |/ _|     | |___  _| |_ 
+;;; | |_| | '_ \ / _` |_____| '_ \ / _` | |_ _____| __\ \/ / __|
+;;; |  _| | | | | (_| |_____| |_) | (_| |  _|_____| |_ >  <| |_ 
+;;; |_| |_|_| |_|\__,_|     | .__/ \__,_|_|        \__/_/\_\\__|
+;;;                         |_|                                 
+;;
+;; «find-pdf-txt»  (to ".find-pdf-txt")
+;; This is a variant of `find-pdf-text' that implements a part of what
+;; Erich Ruff suggested here:
+;;   https://lists.gnu.org/archive/html/eev/2021-06/msg00013.html
+;;
+;; These two sexps are similar, but the second uses a saved ".txt":
+;;   (find-pdf-text "~/Coetzee99.pdf" 3 "LECTURE I")
+;;   (find-pdf-txt  "~/Coetzee99.pdf" 3 "LECTURE I")
+;;
+;; This is a VERY EARLY prototype.
+;; I haven't yet tried to integrate this with `code-tla' or with:
+;;
+;;   (find-pdf-like-intro "7. Shorter hyperlinks to PDF files")
+;;   (find-pdf-like-intro "8. `find-pdf'-pairs")
+;;   (code-pdf-page "livesofanimals" "~/Coetzee99.pdf")
+;;   (code-pdf-text "livesofanimals" "~/Coetzee99.pdf" -110)
+;;
+;; TODO: a `code-pdf-txt' that works like `code-pdf-text' but uses
+;; `find-pdf-txt' instead of `find-pdf-text'.
+
+
+;; Test: (find-pdf-text   "~/Coetzee99.pdf")
+;;       (find-pdf-text   "~/Coetzee99.pdf" 1)
+;;       (find-pdf-text   "~/Coetzee99.pdf" 3)
+;;       (find-pdf-text   "~/Coetzee99.pdf" 3 "LECTURE I")
+;;       (find-sh0 "rm -fv ~/Coetzee99.txt ~/Coetzee99.txt~")
+;;       (find-pdf-txt    "~/Coetzee99.pdf")
+;;       (find-pdf-txt    "~/Coetzee99.pdf" 3)
+;;       (find-pdf-txt    "~/Coetzee99.pdf" 3 "LECTURE I")
+;;  See: (find-efunctionpp          'find-pdf-text)
+;;       (find-efunctionpp          'find-pdftotext-text)
+;;       (find-eev "eev-pdflike.el" "find-pdftotext-text")
+;;       (find-eev "eev-pdflike.el" "find-sh-page")
+;;       (find-eev "eev-pdflike.el" "ee-goto-position-page")
+;;
+(defun find-pdf-txt (fnamepdf &rest pos-spec-list)
+"Open the .txt associated to FNAMEPDF or run `find-pdf-txt-links' to create 
it."
+  (let ((fnametxt (ee-fnamepdf-to-fnametxt fnamepdf)))
+    (if (file-exists-p fnametxt)
+       (progn (find-fline fnametxt)
+              (apply 'ee-goto-position-page pos-spec-list))
+      (find-pdf-txt-links fnamepdf))))
+
+;; «find-pdf-txt-links»  (to ".find-pdf-txt-links")
+;; Test: (find-sh0    "rm -fv ~/Coetzee99.txt ~/Coetzee99.txt~")
+;;       (find-pdf-txt-links "~/Coetzee99.pdf")
+;; Skel: (find-find-links-links-new "pdf-txt" "fnamepdf" "fnametxt")
+;;
+(defun find-pdf-txt-links (&optional fnamepdf &rest pos-spec-list)
+"`find-pdf-txt' runs this when the .txt file for FNAMEPDF does not exist."
+  (interactive)
+  (setq fnamepdf (or fnamepdf "{fnamepdf}"))
+  (let* ((fnametxt (or (ee-fnamepdf-to-fnametxt fnamepdf) "{fnametxt}")))
+    (apply
+     'find-elinks
+     `((find-pdf-txt-links ,fnamepdf ,@pos-spec-list)
+       ;; Convention: the first sexp always regenerates the buffer.
+       (find-efunction 'find-pdf-txt-links)
+       ""
+       (find-pdf-text-insert 3 ,fnamepdf)
+       (ee-copy-rest 1 '(find-fline ,fnametxt))
+       )
+     pos-spec-list)))
+
+;; Tests: (ee-fnamepdf-to-fnametxt "~/Coetzee99.pdf")
+;;        (ee-fnamepdf-to-fnametxt "~/Coetzee99.FOO")
+;;
+(defun ee-fnamepdf-to-fnametxt (fnamepdf)
+  (if (string-match ".pdf$" fnamepdf)
+      (replace-regexp-in-string ".pdf$" ".txt" fnamepdf)))
+
+;; Tests: (ee-find-pdftotext-text "~/Coetzee99.pdf")
+;;        (find-estring "(find-pdf-text-insert 2 \"~/Coetzee99.pdf\")")
+;;   See: (find-efunctionpp          'find-pdf-text)
+;;        (find-efunctionpp          'find-pdftotext-text)
+;;        (find-eev "eev-pdflike.el" "find-pdftotext-text")
+;;        (find-efunction         'ee-find-pdftotext-text)
+;;        (find-eev "eev-plinks.el"  "find-callprocess")
+;;
+(defun find-pdf-text-insert (nlines fnamepdf)
+  "Move down NLINES and insert FNAMEPDF converted to text."
+  (save-excursion
+    (let ((next-line-add-newlines t))
+      (dotimes (i nlines) (next-line 1)))
+    (insert (find-callprocess00 (ee-find-pdftotext-text fnamepdf)))))
+
+
+
 
 (provide 'eev-tla)
 
diff --git a/eev.el b/eev.el
index 96da6bd..144f2da 100644
--- a/eev.el
+++ b/eev.el
@@ -6,7 +6,7 @@
 ;; Package-Requires: ((emacs "24.4"))
 ;; Keywords: lisp e-scripts
 ;; URL: http://angg.twu.net/#eev
-;; Version: 20210608
+;; Version: 20210618
 
 ;; 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]