[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/eev 7496e86 1/2: New file: eev-videolinks.el.
From: |
ELPA Syncer |
Subject: |
[elpa] externals/eev 7496e86 1/2: New file: eev-videolinks.el. |
Date: |
Sun, 7 Nov 2021 21:59:27 -0500 (EST) |
branch: externals/eev
commit 7496e864e44532f1c03d934898474fbec45158d5
Author: Eduardo Ochs <eduardoochs@gmail.com>
Commit: Eduardo Ochs <eduardoochs@gmail.com>
New file: eev-videolinks.el.
---
ChangeLog | 70 ++++++++
VERSION | 4 +-
eev-audiovideo.el | 261 +++++++++++++++-------------
eev-elinks.el | 50 +++---
eev-explain.el | 15 +-
eev-intro.el | 495 ++++++++++++++++++++++++++++++------------------------
eev-load.el | 6 +-
eev-template0.el | 76 +++++++--
eev-testblocks.el | 13 +-
eev-tlinks.el | 166 ++++++++++--------
eev-videolinks.el | 468 +++++++++++++++++++++++++++++++++++++++++++++++++++
11 files changed, 1157 insertions(+), 467 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 654abd4..f16edf9 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,73 @@
+2021-11-07 Eduardo Ochs <eduardoochs@gmail.com>
+
+ * eev-videolinks.el (ee-use-eevyoutube-video)
+ (ee-use-eevlocal-video): new functions.
+
+ * eev-audiovideo.el (ee-use-find-youtube-video)
+ (ee-use-find-eevvideo-links): deleted.
+
+ * eev-tlinks.el (code-eevvideo, find-code-eevvideo)
+ (ee-code-eevvideo, code-eevvideo-local)
+ (find-code-eevvideo-local, ee-code-eevvideo-local): deleted.
+
+ * eev-videolinks.el (find-code-eev{mod}video)
+ (code-eev{mod}video, ee-code-eev{mod}video): new functions.
+ (find-code-eevvideo, code-eevvideo): new functions.
+ (find-code-eevlocalvideo, code-eevlocalvideo): new functions.
+ (find-code-eevlinksvideo, code-eevlinksvideo): new functions.
+
+ * eev-intro.el (find-video-links-intro): new intro.
+ (find-videos-intro): deleted the old material.
+ (find-audiovideo-intro): small changes in section 4.
+
+ * eev-videolinks.el: new file.
+ (ee-find-eev-video-function): new variable.
+ (find-eev-video, find-eevyoutube-video, find-eevlocal-video)
+ (find-eevlinks-video): new functions.
+ (find-eevlocal-links, ee-eevlocal-body)
+ (ee-eevlocal-youtube-comment, ee-eevlocal-psne)
+ (ee-eevlocal-findmpvvideo): new functions.
+
+ * eev-videolinks.el (find-eev2019video, find-eev2020video)
+ (find-eevnavvideo, find-eevtemplvideo, find-eevfherelvideo)
+ (find-eevtestblsvideo, find-eevvlinksvideo): new functions. They
+ are new versions of the functions with the same names that were in
+ eev-audiovideo.el, but they use `find-eev-video'.
+
+ * eev-audiovideo.el (find-eev2019video, find-eev2020video)
+ (find-eevnavvideo, find-eevtemplvideo, find-eevfherelvideo)
+ (find-eevtestblsvideo, find-eevvlinksvideo): deleted.
+
+ * eev-tlinks.el (find-eevshortvideo-links): use `find-eev-video'.
+
+ * eev-audiovideo.el (ee-find-youtube-url): new function.
+ (ee-find-youtube-video): use `ee-find-youtube-url'.
+ (ee-time-to-arg): accept nil.
+
+ * eev-tlinks.el (ee-psne-downloaded-p): new function.
+ (ee-psne-if-needed): use `ee-psne-downloaded-p'.
+ (ee-psne-url-comment): new function.
+ (ee-time-to-arg): moved to the file eev-audiovideo.el.
+ (ee-psne-download0): use `file-name-nondirectory'.
+
+2021-11-04 Eduardo Ochs <eduardoochs@gmail.com>
+
+ * eev-testblocks.el (ee-insert-test-block): new alias.
+
+ * eev-elinks.el (find-eface-links): small changes.
+
+2021-11-03 Eduardo Ochs <eduardoochs@gmail.com>
+
+ * eev-tlinks.el (find-eeit-links): use `ee-adjust-red-stars'.
+
+2021-11-02 Eduardo Ochs <eduardoochs@gmail.com>
+
+ * eev-testblocks.el (ee-insert-test-tcl-mode): use "lindex {{}
+ {test block}} 0".
+
+ * eev-template0.el (ee-dynlex-test): new test function. It is
+ commented out on purpose, but the comments explain how to use it.
+
2021-11-01 Eduardo Ochs <eduardoochs@gmail.com>
* eev-audiovideo.el (ee-find-youtube-video-program): new variable.
diff --git a/VERSION b/VERSION
index b151623..b534621 100644
--- a/VERSION
+++ b/VERSION
@@ -1,2 +1,2 @@
-Mon Nov 1 07:34:08 GMT 2021
-Mon Nov 1 04:34:08 -03 2021
+Mon Nov 8 02:48:11 GMT 2021
+Sun Nov 7 23:48:11 -03 2021
diff --git a/eev-audiovideo.el b/eev-audiovideo.el
index 787ae84..f2ce828 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: 20211101
+;; Version: 20211107
;; Keywords: e-scripts
;;
;; Latest version: <http://angg.twu.net/eev-current/eev-audiovideo.el>
@@ -258,6 +258,17 @@ default is \"#\", but in some situations we need \"&\"
instead."
(format "%st=%sh%sm%ss" c (match-string 1 str) (match-string 2 str)
(match-string 2 str))))))
+;; Tests: (ee-time-to-arg "")
+;; (ee-time-to-arg nil)
+;; (ee-time-to-arg "{time}")
+;; (ee-time-to-arg "1:23")
+;; See: (find-efunction 'ee-time-to-youtube-time)
+;;
+(defun ee-time-to-arg (time)
+ (setq time (or time ""))
+ (if (ee-time-to-youtube-time time)
+ (format " \"%s\"" time)
+ ""))
@@ -588,22 +599,27 @@ See: (find-audiovideo-intro \"`eev-avadj-mode'\")"
;;
;; «find-youtube-video» (to ".find-youtube-video")
;; Play a video on youtube using a browser.
-;; Tests: (ee-find-youtube-video "xQqWufQgzVY")
+;; Tests: (ee-find-youtube-url "xQqWufQgzVY" nil)
+;; (ee-find-youtube-url "xQqWufQgzVY" "1:23")
+;; (ee-find-youtube-video "xQqWufQgzVY")
;; (ee-find-youtube-video "xQqWufQgzVY" "1:23")
;; (ee-find-youtube-video "xQqWufQgzVY" "1:23" "Bla")
;; (find-youtube-video "xQqWufQgzVY" "1:23")
;;
(defvar ee-find-youtube-video-program 'find-googlechrome)
-(defun ee-find-youtube-video (youtubeid &optional time &rest rest)
- (let* ((youtubeurl (format "http://www.youtube.com/watch?v=%s" youtubeid))
- (youtubetime (ee-time-to-youtube-time (or time "")))
- (url (concat youtubeurl youtubetime)))
- (list ee-find-youtube-video-program url)))
-
(defun find-youtube-video (youtubeid &optional time &rest rest)
(eval (ee-find-youtube-video youtubeid time)))
+(defun ee-find-youtube-video (youtubeid &optional time &rest rest)
+ (list ee-find-youtube-video-program
+ (ee-find-youtube-url youtubeid time)))
+
+(defun ee-find-youtube-url (youtubeid time)
+ (format "http://www.youtube.com/watch?v=%s%s"
+ youtubeid (or (ee-time-to-youtube-time (or time "")) "")))
+
+
@@ -682,119 +698,122 @@ will try to download local copies of the videos.
Compare with
-;;; __ ___ _ _ _ _ _
-;;; \ \ / (_) __| | ___ ___ | |_ _ _| |_ ___ _ __(_) __ _| |___
-;;; \ \ / /| |/ _` |/ _ \/ _ \ | __| | | | __/ _ \| '__| |/ _` | / __|
-;;; \ V / | | (_| | __/ (_) | | |_| |_| | || (_) | | | | (_| | \__ \
-;;; \_/ |_|\__,_|\___|\___/ \__|\__,_|\__\___/|_| |_|\__,_|_|___/
-;;;
-;; «video-tutorials» (to ".video-tutorials")
-;; See: (find-videos-intro "2. Short links to eev video tutorials")
-
-;; Skel: (find-eevshortvideo-links "eev2019" "emacsconf2019" "86yiRG8YJD0")
-;; See: (find-videos-intro "1. Some videos" "emacsconf2019")
-;; Index: http://angg.twu.net/.emacs.videos.html#eev2019
-;; Test: (find-eev2019video "0:00")
-(defun find-eev2019video (&optional time &rest rest)
- "Play one of the video tutorials of eev starting at TIME.
-See: (find-videos-intro \"1. Some videos\" \"emacsconf2019\")
- http://angg.twu.net/emacsconf2019.html
- for more info on this particular video,
-and: (find-videos-intro \"2. Short links to eev video tutorials\")
- or: http://angg.twu.net/eev-intros/find-videos-intro.html#2
- for more info on these video tutorials."
- (interactive)
- (find-eevvideo-links "eev2019" "emacsconf2019" "86yiRG8YJD0" time))
-
-;; Skel: (find-eevshortvideo-links "eev2020" "emacsconf2020" "hOAqBc42Gg8")
-;; See: (find-videos-intro "1. Some videos" "emacsconf2020")
-;; Index: http://angg.twu.net/.emacs.videos.html#eev2020
-;; Test: (find-eev2020video "0:00")
-(defun find-eev2020video (&optional time &rest rest)
- "Play one of the video tutorials of eev starting at TIME.
-See: (find-videos-intro \"1. Some videos\" \"emacsconf2020\")
- http://angg.twu.net/emacsconf2020.html
- for more info on this particular video,
-and: (find-videos-intro \"2. Short links to eev video tutorials\")
- or: http://angg.twu.net/eev-intros/find-videos-intro.html#2
- for more info on these video tutorials."
- (interactive)
- (find-eevvideo-links "eev2020" "emacsconf2020" "hOAqBc42Gg8" time))
-
-;; Skel: (find-eevshortvideo-links "eevnav" "2020-list-packages-eev-nav"
"kxBjiUo88_U")
-;; See: (find-videos-intro "1. Some videos" "2020-list-packages-eev-nav")
-;; Index: http://angg.twu.net/.emacs.videos.html#eevnav
-;; Test: (find-eevnavvideo "0:00")
-(defun find-eevnavvideo (&optional time &rest rest)
- "Play one of the video tutorials of eev starting at TIME.
-See: (find-videos-intro \"1. Some videos\" \"2020-list-packages-eev-nav\")
- http://angg.twu.net/2020-list-packages-eev-nav.html
- for more info on this particular video,
-and: (find-videos-intro \"2. Short links to eev video tutorials\")
- or: http://angg.twu.net/eev-intros/find-videos-intro.html#2
- for more info on these video tutorials."
- (interactive)
- (find-eevvideo-links "eevnav" "2020-list-packages-eev-nav" "kxBjiUo88_U"
time))
-
-;; Skel: (find-eevshortvideo-links "eevtempl" "2020-some-template-based"
"91-9YfRPsuk")
-;; See: (find-videos-intro "1. Some videos" "2020-some-template-based")
-;; Index: http://angg.twu.net/.emacs.videos.html#eevtempl
-;; Test: (find-eevtemplvideo "0:00")
-(defun find-eevtemplvideo (&optional time &rest rest)
- "Play one of the video tutorials of eev starting at TIME.
-See: (find-videos-intro \"1. Some videos\" \"2020-some-template-based\")
- http://angg.twu.net/2020-some-template-based.html
- for more info on this particular video,
-and: (find-videos-intro \"2. Short links to eev video tutorials\")
- or: http://angg.twu.net/eev-intros/find-videos-intro.html#2
- for more info on these video tutorials."
- (interactive)
- (find-eevvideo-links "eevtempl" "2020-some-template-based" "91-9YfRPsuk"
time))
-
-;; Skel: (find-eevshortvideo-links "eevfherel" "2020-find-here-links"
"8jtiBlaDor4")
-;; See: (find-videos-intro "1. Some videos" "2020-find-here-links")
-;; Index: http://angg.twu.net/.emacs.videos.html#eevfherel
-;; Test: (find-eevfherelvideo "0:00")
-(defun find-eevfherelvideo (&optional time &rest rest)
- "Play one of the video tutorials of eev starting at TIME.
-See: (find-videos-intro \"1. Some videos\" \"2020-find-here-links\")
- http://angg.twu.net/2020-find-here-links.html
- for more info on this particular video,
-and: (find-videos-intro \"2. Short links to eev video tutorials\")
- or: http://angg.twu.net/eev-intros/find-videos-intro.html#2
- for more info on these video tutorials."
- (interactive)
- (find-eevvideo-links "eevfherel" "2020-find-here-links" "8jtiBlaDor4" time))
-
-;; Skel: (find-eevshortvideo-links "eevtestbls" "2021-test-blocks"
"fpsF_M55W4o")
-;; See: (find-videos-intro "1. Some videos" "2021-test-blocks")
-;; Index: http://angg.twu.net/.emacs.videos.html#eevtestbls
-;; Test: (find-eevtestblsvideo "0:00")
-(defun find-eevtestblsvideo (&optional time &rest rest)
- "Play one of the video tutorials of eev starting at TIME.
-See: (find-videos-intro \"1. Some videos\" \"2021-test-blocks\")
- http://angg.twu.net/2021-test-blocks.html
- for more info on this particular video,
-and: (find-videos-intro \"2. Short links to eev video tutorials\")
- or: http://angg.twu.net/eev-intros/find-videos-intro.html#2
- for more info on these video tutorials."
- (interactive)
- (find-eevvideo-links "eevtestbls" "2021-test-blocks" "fpsF_M55W4o" time))
-
-;; Skel: (find-eevshortvideo-links "eevvlinks" "2021-video-links"
"xQqWufQgzVY")
-;; See: (find-videos-intro "1. Some videos" "2021-video-links")
-;; Index: http://angg.twu.net/.emacs.videos.html#eevvlinks
-;; Test: (find-eevvlinksvideo "0:00")
-(defun find-eevvlinksvideo (&optional time &rest rest)
- "Play one of the video tutorials of eev starting at TIME.
-See: (find-videos-intro \"1. Some videos\" \"2021-video-links\")
- http://angg.twu.net/2021-video-links.html
- for more info on this particular video,
-and: (find-videos-intro \"2. Short links to eev video tutorials\")
- or: http://angg.twu.net/eev-intros/find-videos-intro.html#2
- for more info on these video tutorials."
- (interactive)
- (find-eevvideo-links "eevvlinks" "2021-video-links" "xQqWufQgzVY" time))
+;; Moved to:
+;; (find-eev "eev-videolinks.el" "video-tutorials")
+
+;; ;;; __ ___ _ _ _ _ _
+;; ;;; \ \ / (_) __| | ___ ___ | |_ _ _| |_ ___ _ __(_) __ _| |___
+;; ;;; \ \ / /| |/ _` |/ _ \/ _ \ | __| | | | __/ _ \| '__| |/ _` | / __|
+;; ;;; \ V / | | (_| | __/ (_) | | |_| |_| | || (_) | | | | (_| | \__ \
+;; ;;; \_/ |_|\__,_|\___|\___/ \__|\__,_|\__\___/|_| |_|\__,_|_|___/
+;; ;;;
+;; ;; «video-tutorials» (to ".video-tutorials")
+;; ;; See: (find-videos-intro "2. Short links to eev video tutorials")
+;;
+;; ;; Skel: (find-eevshortvideo-links "eev2019" "emacsconf2019" "86yiRG8YJD0")
+;; ;; See: (find-videos-intro "1. Some videos" "emacsconf2019")
+;; ;; Index: http://angg.twu.net/.emacs.videos.html#eev2019
+;; ;; Test: (find-eev2019video "0:00")
+;; (defun find-eev2019video (&optional time &rest rest)
+;; "Play one of the video tutorials of eev starting at TIME.
+;; See: (find-videos-intro \"1. Some videos\" \"emacsconf2019\")
+;; http://angg.twu.net/emacsconf2019.html
+;; for more info on this particular video,
+;; and: (find-videos-intro \"2. Short links to eev video tutorials\")
+;; or: http://angg.twu.net/eev-intros/find-videos-intro.html#2
+;; for more info on these video tutorials."
+;; (interactive)
+;; (find-eevvideo-links "eev2019" "emacsconf2019" "86yiRG8YJD0" time))
+;;
+;; ;; Skel: (find-eevshortvideo-links "eev2020" "emacsconf2020" "hOAqBc42Gg8")
+;; ;; See: (find-videos-intro "1. Some videos" "emacsconf2020")
+;; ;; Index: http://angg.twu.net/.emacs.videos.html#eev2020
+;; ;; Test: (find-eev2020video "0:00")
+;; (defun find-eev2020video (&optional time &rest rest)
+;; "Play one of the video tutorials of eev starting at TIME.
+;; See: (find-videos-intro \"1. Some videos\" \"emacsconf2020\")
+;; http://angg.twu.net/emacsconf2020.html
+;; for more info on this particular video,
+;; and: (find-videos-intro \"2. Short links to eev video tutorials\")
+;; or: http://angg.twu.net/eev-intros/find-videos-intro.html#2
+;; for more info on these video tutorials."
+;; (interactive)
+;; (find-eevvideo-links "eev2020" "emacsconf2020" "hOAqBc42Gg8" time))
+;;
+;; ;; Skel: (find-eevshortvideo-links "eevnav" "2020-list-packages-eev-nav"
"kxBjiUo88_U")
+;; ;; See: (find-videos-intro "1. Some videos" "2020-list-packages-eev-nav")
+;; ;; Index: http://angg.twu.net/.emacs.videos.html#eevnav
+;; ;; Test: (find-eevnavvideo "0:00")
+;; (defun find-eevnavvideo (&optional time &rest rest)
+;; "Play one of the video tutorials of eev starting at TIME.
+;; See: (find-videos-intro \"1. Some videos\" \"2020-list-packages-eev-nav\")
+;; http://angg.twu.net/2020-list-packages-eev-nav.html
+;; for more info on this particular video,
+;; and: (find-videos-intro \"2. Short links to eev video tutorials\")
+;; or: http://angg.twu.net/eev-intros/find-videos-intro.html#2
+;; for more info on these video tutorials."
+;; (interactive)
+;; (find-eevvideo-links "eevnav" "2020-list-packages-eev-nav" "kxBjiUo88_U"
time))
+;;
+;; ;; Skel: (find-eevshortvideo-links "eevtempl" "2020-some-template-based"
"91-9YfRPsuk")
+;; ;; See: (find-videos-intro "1. Some videos" "2020-some-template-based")
+;; ;; Index: http://angg.twu.net/.emacs.videos.html#eevtempl
+;; ;; Test: (find-eevtemplvideo "0:00")
+;; (defun find-eevtemplvideo (&optional time &rest rest)
+;; "Play one of the video tutorials of eev starting at TIME.
+;; See: (find-videos-intro \"1. Some videos\" \"2020-some-template-based\")
+;; http://angg.twu.net/2020-some-template-based.html
+;; for more info on this particular video,
+;; and: (find-videos-intro \"2. Short links to eev video tutorials\")
+;; or: http://angg.twu.net/eev-intros/find-videos-intro.html#2
+;; for more info on these video tutorials."
+;; (interactive)
+;; (find-eevvideo-links "eevtempl" "2020-some-template-based" "91-9YfRPsuk"
time))
+;;
+;; ;; Skel: (find-eevshortvideo-links "eevfherel" "2020-find-here-links"
"8jtiBlaDor4")
+;; ;; See: (find-videos-intro "1. Some videos" "2020-find-here-links")
+;; ;; Index: http://angg.twu.net/.emacs.videos.html#eevfherel
+;; ;; Test: (find-eevfherelvideo "0:00")
+;; (defun find-eevfherelvideo (&optional time &rest rest)
+;; "Play one of the video tutorials of eev starting at TIME.
+;; See: (find-videos-intro \"1. Some videos\" \"2020-find-here-links\")
+;; http://angg.twu.net/2020-find-here-links.html
+;; for more info on this particular video,
+;; and: (find-videos-intro \"2. Short links to eev video tutorials\")
+;; or: http://angg.twu.net/eev-intros/find-videos-intro.html#2
+;; for more info on these video tutorials."
+;; (interactive)
+;; (find-eevvideo-links "eevfherel" "2020-find-here-links" "8jtiBlaDor4"
time))
+;;
+;; ;; Skel: (find-eevshortvideo-links "eevtestbls" "2021-test-blocks"
"fpsF_M55W4o")
+;; ;; See: (find-videos-intro "1. Some videos" "2021-test-blocks")
+;; ;; Index: http://angg.twu.net/.emacs.videos.html#eevtestbls
+;; ;; Test: (find-eevtestblsvideo "0:00")
+;; (defun find-eevtestblsvideo (&optional time &rest rest)
+;; "Play one of the video tutorials of eev starting at TIME.
+;; See: (find-videos-intro \"1. Some videos\" \"2021-test-blocks\")
+;; http://angg.twu.net/2021-test-blocks.html
+;; for more info on this particular video,
+;; and: (find-videos-intro \"2. Short links to eev video tutorials\")
+;; or: http://angg.twu.net/eev-intros/find-videos-intro.html#2
+;; for more info on these video tutorials."
+;; (interactive)
+;; (find-eevvideo-links "eevtestbls" "2021-test-blocks" "fpsF_M55W4o" time))
+;;
+;; ;; Skel: (find-eevshortvideo-links "eevvlinks" "2021-video-links"
"xQqWufQgzVY")
+;; ;; See: (find-videos-intro "1. Some videos" "2021-video-links")
+;; ;; Index: http://angg.twu.net/.emacs.videos.html#eevvlinks
+;; ;; Test: (find-eevvlinksvideo "0:00")
+;; (defun find-eevvlinksvideo (&optional time &rest rest)
+;; "Play one of the video tutorials of eev starting at TIME.
+;; See: (find-videos-intro \"1. Some videos\" \"2021-video-links\")
+;; http://angg.twu.net/2021-video-links.html
+;; for more info on this particular video,
+;; and: (find-videos-intro \"2. Short links to eev video tutorials\")
+;; or: http://angg.twu.net/eev-intros/find-videos-intro.html#2
+;; for more info on these video tutorials."
+;; (interactive)
+;; (find-eevvideo-links "eevvlinks" "2021-video-links" "xQqWufQgzVY" time))
diff --git a/eev-elinks.el b/eev-elinks.el
index 21e187a..848d066 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: 20211022
+;; Version: 20211104
;; Keywords: e-scripts
;;
;; Latest version: <http://angg.twu.net/eev-current/eev-elinks.el>
@@ -1073,7 +1073,7 @@ See the comments in the source code."
;;; |_| |_|_| |_|\__,_| \___|_| \__,_|\___\___| |_|_|_| |_|_|\_\___/
;;;
;; «find-eface-links» (to ".find-eface-links")
-;; Skel: (find-find-links-links-new "eface" "face-symbol" "")
+;; Skel: (find-find-links-links-new "eface" "face-symbol" "fg bg")
;; Test: (find-eface-links 'eepitch-star-face)
;; Key binding:
;; (find-eev "eev-mode.el" "eev-mode-map-set")
@@ -1086,26 +1086,32 @@ See the documentation for `ee-face-at-point' to
understand what that
means."
(interactive (list (ee-face-at-point current-prefix-arg)))
(setq face-symbol (or face-symbol "{face-symbol}"))
- (apply
- 'find-elinks
- `((find-eface-links ',face-symbol ,@pos-spec-list)
- ;; Convention: the first sexp always regenerates the buffer.
- (find-efunction 'find-eface-links)
- ""
- (find-efacedescr ',face-symbol)
- ;; (find-efaces ,(format "\n%S " face-symbol))
- (find-efaces ',face-symbol)
- (find-eface ',face-symbol)
- (customize-face ',face-symbol)
- (set-face-foreground ',face-symbol ,(face-foreground face-symbol))
- (set-face-background ',face-symbol ,(face-background face-symbol))
- (face-id ',face-symbol)
- (find-epp (mapcar (lambda (face) (cons (face-id face) face)) (face-list)))
- (find-ecolors)
- (find-efaces)
- (find-efaces ,(symbol-name face-symbol))
- )
- pos-spec-list))
+ (let* ((fg (face-foreground face-symbol))
+ (bg (face-background face-symbol)))
+ (apply
+ 'find-elinks
+ `((find-eface-links ,face-symbol ,@pos-spec-list)
+ ;; Convention: the first sexp always regenerates the buffer.
+ (find-efunction 'find-eface-links)
+ ""
+ (find-efacedescr ',face-symbol)
+ (find-efaces ',face-symbol)
+ (find-eface ',face-symbol)
+ (customize-face ',face-symbol)
+ (set-face-foreground ',face-symbol ,fg)
+ (set-face-background ',face-symbol ,bg)
+ ""
+ (find-ecolor-links ,fg)
+ (find-ecolor-links ,bg)
+ (find-ecolors)
+ ""
+ (face-id ',face-symbol)
+ (find-epp (mapcar (lambda (face) (cons (face-id face) face))
(face-list)))
+ )
+ pos-spec-list)))
+
+
+
(defun ee-face-at-point (&optional arg)
"Return the face at point as a symbol; ARG determines what that means.
diff --git a/eev-explain.el b/eev-explain.el
index fc54318..d640637 100644
--- a/eev-explain.el
+++ b/eev-explain.el
@@ -22,7 +22,7 @@
;;
;; Author: Eduardo Ochs <eduardoochs@gmail.com>
;; Maintainer: Eduardo Ochs <eduardoochs@gmail.com>
-;; Version: 20190806
+;; Version: 20211101
;; Keywords: e-scripts
;;
;; Latest version: <http://angg.twu.net/eev-current/eev-explain.el>
@@ -33,15 +33,20 @@
;;; Commentary:
-;; (load "eev-explain.el")
-
-;; This is very new. Everything is going to change.
+;; This file is not loaded by default - see:
+;;
+;; (find-eev "eev-load.el")
+;;
+;; It contains some code for "explaining sexps" that I wrote in 2019
+;; but then abandoned.
;;
;; Terminology: a "bet" is a triple of the form (begin end text); the
;; global variable `ee-bets' holds a list of bets.
;;
;; The tests below show some of the things we do with ee-bets:
;;
+;; (load "eev-explain.el")
+;;
;; (defun eejump-100 () (set-frame-font "nil2"))
;; (progn (eek " <up> C-e") (ee-bets-set))
;; (progn (eek "2*<up> C-e") (cdr (ee-bets-set)))
@@ -58,6 +63,8 @@
;;
;; (ee-explain-eejump)
;; (eev-explain)
+;;
+;; Everything below this point is from 2019.
diff --git a/eev-intro.el b/eev-intro.el
index f26f908..cd22bb2 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: 20211031
+;; Version: 20211107
;; Keywords: e-scripts
;;
;; Latest version: <http://angg.twu.net/eev-current/eev-intro.el>
@@ -86,6 +86,7 @@
;; «.find-bounded-intro» (to "find-bounded-intro")
;; «.find-channels-intro» (to "find-channels-intro")
;; «.find-videos-intro» (to "find-videos-intro")
+;; «.find-video-links-intro» (to "find-video-links-intro")
;; «.find-defun-intro» (to "find-defun-intro")
;; «.find-emacs-intro» (to "find-emacs-intro")
@@ -587,6 +588,8 @@ The best way to learn how to create very quickly these
our notes is explained in a separate tutorial:
(find-here-links-intro)
+ (find-here-links-intro \"3. `find-here-links'\")
+ (find-here-links-intro \"3. `find-here-links'\" \"beginners\")
Cutting and pasting is explained briefly in section 5.2, below.
A way to go quickly to \"~/TODO\" is explained in section 7.1.
@@ -2657,55 +2660,56 @@ recommended reading order. These are the basic ones:
5. (find-pdf-like-intro)
6. (find-eepitch-intro)
7. (find-audiovideo-intro)
- 8. (find-videos-intro)
- 9. (find-psne-intro)
- 10. (find-rcirc-intro)
- 11. (find-elisp-intro)
- 12. (find-lexical-intro)
- 13. (find-eev-install-intro)
+ 8. (find-video-links-intro)
+ 9. (find-videos-intro)
+ 10. (find-psne-intro)
+ 11. (find-rcirc-intro)
+ 12. (find-elisp-intro)
+ 13. (find-lexical-intro)
+ 14. (find-eev-install-intro)
This is a very basic tutorial intended mainly for M$ Windows
users:
- 14. (find-windows-beginner-intro)
+ 15. (find-windows-beginner-intro)
These ones explain ideas, conventions, and usage patterns:
- 15. (find-escripts-intro)
- 16. (find-links-conv-intro)
+ 16. (find-escripts-intro)
+ 17. (find-links-conv-intro)
These are older and more technical versions of sections of the
eev-quick-intro:
- 17. (find-eval-intro)
- 18. (find-links-intro)
- 19. (find-brxxx-intro)
- 20. (find-wrap-intro)
- 21. (find-eejump-intro)
- 22. (find-anchors-intro)
- 23. (find-code-c-d-intro)
+ 18. (find-eval-intro)
+ 19. (find-links-intro)
+ 20. (find-brxxx-intro)
+ 21. (find-wrap-intro)
+ 22. (find-eejump-intro)
+ 23. (find-anchors-intro)
+ 24. (find-code-c-d-intro)
These are etcs:
- 24. (find-multiwindow-intro)
- 25. (find-templates-intro)
- 26. (find-org-intro)
- 27. (find-git-intro)
+ 25. (find-multiwindow-intro)
+ 26. (find-templates-intro)
+ 27. (find-org-intro)
+ 28. (find-git-intro)
These ones explain advanced features that require extra setup:
- 28. (find-prepared-intro)
- 29. (find-bounded-intro)
- 30. (find-channels-intro)
+ 29. (find-prepared-intro)
+ 30. (find-bounded-intro)
+ 31. (find-channels-intro)
This one is used in a video:
- 31. (find-three-main-keys-intro)
+ 32. (find-three-main-keys-intro)
These ones are obsolete:
- 32. (find-emacs-intro)
- 33. (find-defun-intro)
+ 33. (find-emacs-intro)
+ 34. (find-defun-intro)
Item 25 is an index of old video tutorials, with scripts for
downloading local copies of them and links to important positions
@@ -7821,9 +7825,9 @@ For more realistic examples, see:
============================================
This sexp
- (code-video \"eev2020video\" \"~/eev-videos/emacsconf2020.mp4\")
+ (code-video \"ec2020video\" \"~/eev-videos/emacsconf2020.mp4\")
-defines a function `find-eev2020video'. The function `code-video'
+defines a function `find-ec2020video'. The function `code-video'
is similar to the functions `code-c-d' and `code-pdf-page', that
we saw in:
@@ -7832,7 +7836,7 @@ we saw in:
After running the `(code-video ...)' above, this sexp
- (find-eev2020video \"8:20\" \"defines several functions\")
+ (find-ec2020video \"8:20\" \"defines several functions\")
becomes a shorthand for:
@@ -7843,15 +7847,15 @@ comment, and is ignored - as in `find-pdf-page'.
If we run the second sexp below instead of the first one,
- (code-video \"eev2020video\" \"~/eev-videos/emacsconf2020.mp4\")
- (find-code-video \"eev2020video\" \"~/eev-videos/emacsconf2020.mp4\")
+ (code-video \"ec2020video\" \"~/eev-videos/emacsconf2020.mp4\")
+ (find-code-video \"ec2020video\" \"~/eev-videos/emacsconf2020.mp4\")
we get a temporary buffer with the code that the
sexp `(code-video ...)' would execute. Try it - and note that the
-definition of `find-eev2020video' in the temporary buffer
+definition of `find-ec2020video' in the temporary buffer
contains a line like this:
- (setq ee-audiovideo-last 'find-eev2020video)
+ (setq ee-audiovideo-last 'find-ec2020video)
This line will be explained in the section 4.4.
@@ -10405,239 +10409,293 @@ The function `find-eevvideo-links' is explained
here:
(find-audiovideo-intro \"7.2. `find-eevvideo-links'\")
+" pos-spec-list)))
+;; (find-videos-intro)
-Everything below this point is VERY old!!!
+;; «find-video-links-intro» (to ".find-video-links-intro")
+;; Skel: (find-intro-links "video-links")
+;; Test: (find-video-links-intro)
+(defun find-video-links-intro (&rest pos-spec-list) (interactive)
+ (let ((ee-buffer-name "*(find-video-links-intro)*"))
+ (apply 'find-eintro "\
+\(Re)generate: (find-video-links-intro)
+Source code: (find-efunction 'find-video-links-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.
-4. What we have now
-===================
-I am producing a series of videos about eev - but at this moment
-only two very broad introductions are ready 8-(. I have plans for
-several short videos about specific usage patterns, but don't
-hold your breath yet... also, these are my first videos EVER - so
-please excuse any stutterings, hesitations and false starts...
-The videos are uploaded to Youtube to make them very easy to
-find, but Youtube reduces the resolution of the original videos
-and makes them blurry and almost unreadable - so the best way to
-watch them is to fetch local copies of the high-res .mp4 files.
+1. Introduction
+===============
+Many of the tutorials of eev have \"[Video links:]\" blocks.
+For example:
+ (find-eev-quick-intro \"4. Creating Elisp Hyperlinks\")
+ (find-eev-quick-intro \"4. Creating Elisp Hyperlinks\" \"[Video links:]\")
+ (find-eev-quick-intro \"6. Controlling shell-like programs\")
+ (find-eev-quick-intro \"6. Controlling shell-like programs\" \"[Video
links:]\")
+They contain links like these,
+ (find-eevnavvideo \"10:36\" \"if I type <f8> six times here\")
+ (find-eev2019video \"15:11\" \"Demo: the eepitch block (in red star lines)\")
+ (find-eevtestblsvideo \"2:33\" \"if I run f8 here I start a new Lua
interpreter\")
-4. Hyperlinks to positions
-==========================
-The first argument to `find-eepitchvideo' and to other similar
-functions is a time offset; it is optional, and it defaults to
-\"0:00\". Any further arguments are ignored, and this allows us
-to use them as comments. So these two sexps are equivalent:
+that are \"short links to eev video tutorials\". These functions
+with names like `find-eev*video' are _sort of_ expanded to
+functions that specify explicitly which video on youtube to play,
+or where is the file with the local copy of that video. For the
+general idea of how this expansion is implemented, see:
- (find-eepitchvideo \"0:16\")
- (find-eepitchvideo \"0:16\" \"the eepitch-to-shell-and-python example\")
+ (find-eev-quick-intro \"9. Shorter hyperlinks\")
+ (find-eev-quick-intro \"9.1. `code-c-d'\")
+ (find-eev-quick-intro \"9.1. `code-c-d'\" \"{c}\")
-We could use a series of `find-eepitchvideo' sexps to create a
-\"table of contents\" for a video, similarly to what we do for
-written documents...
+The strings \"eevnav\", \"eev2019\", and \"eevtestbls\" in the
+names of the functions correspond to the argument \"c\" of
+`code-c-d'.
-5. Time offsets as hyperlinks to positions
-==========================================
-In some cases using sexps creates too much visual clutter, and we
-would like to be able to create an index or table of contents
-writing lines just like this,
- 0:16 the eepitch-to-shell-and-python example
+2. From the HTML
+================
+The \"intros\" of eev can be read both from Emacs and from a
+browser. For example, the HTMLized version of this intro is at:
-instead of using explicit elisp hyperlinks.
+ http://angg.twu.net/eev-intros/find-video-links-intro.html
-There is a way to do this, but it is tricky. It involves
-activating a mode, called `eev-avadj-mode', in which `M-p' is
-bound to a command that locates the first thing looking like a
-time offset in the current line, and calls the video player to
-make it play the *current default video* starting from that time
-offset; a sexp like
+In the HTMLized version each \"short link to a video tutorial\"
+has two hyperlinks, like this:
- (find-eepitchvideo t)
+ (find-eev2020video \"6:25\" \"`find-video'\")
+ \\---------------/ \\--/
+ function name: time:
+ points to here points to
+ (this section) YouTube
-just sets the current default video, but does not invoke the
-player. All this is explained here:
+the function name, \"find-eev2020video\", points to a place -
+this section! - with help about how these links work, and the
+timestamp, \"6:25\", points to YouTube; in this example, the
+\"6:25\" points to my presentation about eev in the
+EmacsConf2020, and it plays that video starting from 6:25. More
+precisely, the \"6:25\" points to:
- (find-audiovideo-intro \"The time-from-bol\")
+ https://www.youtube.com/watch?v=hOAqBc42Gg8#t=6m25s
+ \\---------/ \\---/
+ \"hash\" time
+We call the string \"hOAqBc42Gg8\" the \"hash\" of the video;
+calling it the \"youtube id\" of the video would be more precise,
+but longer. The \"6:25\" is converted to a \"#t=6m25s\", that
+makes youtube start playing the video from the right position.
-6. Eepitch video: table of contents
-===================================
-\(find-eev-video-links \"eepitchvideo\" \"video4-eepitch\" \"Lj_zKC5BR64\")
-\(eev-avadj-mode 1)
-\(find-eepitchvideo t)
-
-0:16 the eepitch-to-shell-and-python example, very quickly
-1:18 executing eepitch scripts with `f8's; f8 on red star lines and normal
lines
-2:33 the eepitch-to-shell-and-python example - what each line does
-3:15 the first three lines use advanced features
-3:52 eepitch scripts are made to be executed interactively
-5:25 the eepitch-to-shell-and-python example again, more slowly
-
-5:58 what happens when the eepitch target is being shown
-7:13 the default is to use two windows
-7:33 what happens when the target does not exist
-8:25 how to send commands to a new shell
-8:54 how an eepitch block (like eepitch-shell/kill/shell) works
-
-9:38 an example with shell comments (which eev uses as hyperlinks)
-12:35 refining hyperlinks
-12:35 converting shell commands into hyperlinks (by wrapping - by hand)
-13:04 wrapping commands - bound to meta-uppercase-letters
-13:53 M-M wraps the current line into a hyperlink to a manpage
-14:12 demonstrating M-M, M-S and M-T with eek sexps
-14:40 M-T wraps the current linto an eepitch-xxx/kill/xxx triple
-15:47 introduction to the sandboxed tutorials and to M-j (eejump)
-16:17 the default numeric arguments for eejump
-16:35 M-5 M-j jumps to the index for the documentation for eev
-17:15 temp. eev buffers usually start with a sexp that regenerates the buffer
-18:23 where the eepitch-to-shell-and-python example is in the documentation
-
-18:58 Other examples
-19:07 pdf-like documents
-20:43 a tutorial for Lua based on eepitch
-22:26 that's it - last comments, where to find more info, how to get in touch
-
-
-
-7. Eev video: table of contents
-===============================
-\(find-eev-video-links \"eevvideo\" \"video2\" \"doeyn5MOaB8\")
-\(eev-avadj-mode 1)
-\(find-eevvideo t)
-
- 0:00 introduction
- 2:45 unpack the tarball and invoke Emacs
- 5:07 and make the cursor stop blinking
-
- 5:11 Emacs as a Lisp environment
-11:48 Open the file \"VERSION\" (TAB completes)
-12:15 (eek \"C-x C-f VERSION\") is not very readable
-12:35 (find-file \".../VERSION\") is more readable
-12:43 to follow it we type M-e, and M-k to go back
-14:00 parts for humans and more or less for humans; passive sexps
-14:34 variations of M-e that split the screen
-15:09 left side is \"before\", right side is \"after\"
-
-16:00 help on a key sequence
-16:28 C-h k gives us help on a key sequence
-17:46 (eek \"C-h k C-x C-f\") is an unreadble way to get help on a key
-17:55 (describe-function 'find-file) is even messier
-18:28 (find-efunctiondescr 'find-file) is cleaner - and why
-
-20:14 introduction the eev documentation in \"intro\"s
-22:30 (eek \"M-h M-k C-x C-f\") generates a list of hyperlinks
-24:15 the first line regenerates the buffer
-24:40 the intros are temporary buffers
-25:07 we can play without destroying the documentation of eev
-25:40 we can copy the hyperlinks to intros to other places
-
-25:53 introduction to eejump
-26:44 a plain M-j goes to the index of eejumps
-28:00 M-5 M-j goes to the top level of the documentation in intros
-28:22 M-2 M-j goes to (find-emacs-intro)
-28:36 ...which has lots of links to the emacs manuals
-
-28:54 (find-eev-update-links)
-29:47 I could have done that with just instructions in English
-30:01 ...but it was more interesting to do that in an executable way.
-30:21 remember that the first line regenerates the buffer...
-31:07 we use that to select a directory for installation.
-31:40 an eepitch block
-31:53 emacs is made to handle anything that looks like text...
-32:38 running terminals inside Emacs
-32:52 the best of both worlds
-33:50 f8
-35:48 [oops - I forgot to unpack]
-
-
-
-
-8. In Portuguese
-================
- (find-eev-video-links \"eevvideopt\" \"video2pt\" \"yztYD9Y7Iz4\")
- (code-video \"eevvideopt\" \"$S/http/angg.twu.net/eev-videos/video2pt.mp4\")
- (eev-avadj-mode 1)
- (find-eevvideopt t)
+3. `find-youtube-video'
+=======================
+In some situations - see the section 7 - running
+
+ (find-eev2020video \"6:25\" \"`find-video'\")
+
+makes Emacs run this:
+
+ (find-youtube-video \"hOAqBc42Gg8\" \"6:25\")
+
+Note that running this sexp
+
+ (ee-find-youtube-video \"hOAqBc42Gg8\" \"6:25\")
+
+returns one of these sexps,
+
+ (find-googlechrome \"http://www.youtube.com/watch?v=hOAqBc42Gg8#t=6m25s\")
+ (find-firefox \"http://www.youtube.com/watch?v=hOAqBc42Gg8#t=6m25s\")
-;; (find-eepitchvideo)
-;; (find-eevvideo)
-;; (find-eevvideopt)
+according to the variable `ee-find-youtube-video-program'; you
+can configure it to use one of the most common browsers with:
+ (setq ee-find-youtube-video-program 'find-googlechrome)
+ (setq ee-find-youtube-video-program 'find-firefox)
-9. Comparison with youtube
+
+4. Configuring the browser
==========================
-Note that Youtube has a trick that lets we use URLs that point to
-specific positions in videos. For example, this,
+The variables `ee-firefox-program' and `ee-googlechrome-program'
+determine the programs that `find-firefox' and
+`find-googlechrome' should try to execute. You can test if they
+are correct by trying:
+
+ (find-firefox \"http://www.lua.org/start.html\")
+ (find-googlechrome \"http://www.lua.org/start.html\")
- http://www.youtube.com/watch?v=Lj_zKC5BR64&t=0m16s
+Typically on GNU/Linux systems the right values are:
-makes the video about eepitch start at 0:16 instead of from the
-beginning. Also, each video at Youtube can have uploader comments
-and a discussion, and in the text of these comments things like
-\"12:34\" become links that make the current video skip to that
-position.
+ (setq ee-firefox-program \"firefox\")
+ (setq ee-googlechrome-program \"google-chrome\")
- (find-audiovideo-intro)
+and on M$ Windows typically what works is something like:
+
+ (setenv \"FIREFOXDIR\" \"c:/Program Files/Mozilla Firefox\")
+ (setenv \"GOOGLECHROMEDIR\" \"c:/Program Files/Google/Chrome/Application\")
+ (setq ee-firefox-program \"$FIREFOXDIR/firefox.exe\")
+ (setq ee-googlechrome-program \"$GOOGLECHROMEDIR/chrome.exe\")
+but people usually have to adjust the paths by hand. One way to
+test if the paths are right is to open the directories in dired
+and see if the files \"firefox.exe\" and \"chrome.exe\" are there
+- i.e., run these sexps and see if they find the right files in
+the right directories:
+ (find-fline \"$FIREFOXDIR/\" \"firefox.exe\")
+ (find-fline \"$GOOGLECHROMEDIR/\" \"chrome.exe\")
-10. Video2pt: Uma introducao ao eev2 (2012nov15)
-================================================
-This is a version in Portuguese of the video above.
-It is slightly longer than the version in English because it's
-intended mostly for non-Emacsers, so some things are explained
-\(much) more slowly...
+If you've never heard of dired, then read this:
+
+ (find-enode \"Dired\")
+
-At youtube: http://www.youtube.com/watch?v=yztYD9Y7Iz4
- http://www.youtube.com/watch?v=yztYD9Y7Iz4&t=1h07m40s
-Hi-res mp4: http://angg.twu.net/eev-videos/video2pt.mp4
- (128228339 bytes, 122MB. Duration: 1:09:42)
-# (find-eevvideopt)
-# (find-eevvideopt \"1:07:40\" \"eepitch pro shell e pro Python\")
+5. Local copies
+===============
+In some situations - see section 7 - a sexp like
+ (find-eev2020video \"6:25\" \"`find-video'\")
+will try to play a local copy of the video file. In the case of
+`find-eev2020video' this means a local copy of this file,
+
+ http://angg.twu.net/eev-videos/emacsconf2020.mp4
+
+downloaded by `psne'-ing, as explained here:
+
+ (find-psne-intro)
+
+The local copy will be played with Mpv, with:
+
+ (find-mpv-video \"$S/http/angg.twu.net/eev-videos/emacsconf2020.mp4\"
\"6:25\")
+
+
+
+
+6. Configuring Mpv
+==================
+After installing Mpv you may have to configure its path. On
+GNU/Linux this typically works,
+
+ (setq ee-mpv-program \"mpv\")
+
+and on M$ Windows you will need something like this, but you will
+have to adjust the path:
+
+ (setenv \"MPVDIR\" \"c:/Users/myusername/path/to/mpv\")
+ (setq ee-mpv-program \"$MPVDIR/mpv.exe\")
+
+You can test if the path is right with the two sexps below. Note
+that the first is for M$ Windows only, and that the second one
+will display the basic command-line options of mpv.
+
+ (find-fline \"$MPVDIR/\" \"mpv.exe\")
+ (find-callprocess `(,ee-mpv-program \"--help\"))
+
+
+
+
+7. `find-eev-video'
+===================
+All the standard functions for short links to video tutorials are
+implemented using a function called `find-eev-video'. For
+example, `find-eev2020video' is defined as:
+
+ ;; For the real definition, see:
+ ;; (find-eev \"eev-audiovideo.el\" \"video-tutorials\")
+ ;; (find-eev \"eev-audiovideo.el\" \"video-tutorials\" \"eev2020\")
+ ;;
+ (defun find-eev2020video (&optional time &rest rest)
+ \"[Long docstring omitted]\"
+ (interactive)
+ (find-eev-video \"emacsconf2020\" \"hOAqBc42Gg8\" time))
+
+Calling:
+
+ (find-eev2020video \"6:25\" \"`find-video'\")
+
+runs:
+
+ (find-eev-video \"emacsconf2020\" \"hOAqBc42Gg8\" \"6:25\")
+
+that runs one of these sexps, depending on the current settings:
+
+ (find-youtube-video \"hOAqBc42Gg8\" \"6:25\")
+ (find-eevlocal-video \"emacsconf2020\" \"hOAqBc42Gg8\" \"6:25\")
+ (find-eevlinks-video \"emacsconf2020\" \"hOAqBc42Gg8\" \"6:25\")
+
+The one with `find-eevlocal-video' plays the local copy of
+
+ http://angg.twu.net/eev-videos/emacsconf2020.mp4
+
+if it has already been downloaded, and if the local copy is not
+found it displays a temporary buffer with links and an e-script
+for downloading - i.e., psne-ing - the video from the URL above.
+The sexp with `find-eevlinks-video' works very similarly to the
+one with `find-eevlocal-video', but it always displays the
+temporary buffer with links and an e-script.
+
+You can select the behavior of `find-eev-video' - and thus the
+behavior of all short links to video tutorials, as they all call
+`find-eev-video' - by running one of the `setq's below:
+
+ (setq ee-find-eev-video-function 'find-eevyoutube-video)
+ (setq ee-find-eev-video-function 'find-eevlocal-video)
+ (setq ee-find-eev-video-function 'find-eevlinks-video)
+
+`find-eevyoutube-video' is like `find-eev-video', but it discards
+its first argument.
+
+The default is `find-eevlocal-video', but for Windows users
+starting with `find-eevyoutube-video' makes more sense.
+
+
+
+
+8. Windows
+==========
+This is my n-th different implementation of the innards of the
+short links to video tutorials. This one - from nov/2021 - was
+inspired by feedback of the Windows users that participated in
+this workshop:
+
+ https://lists.gnu.org/archive/html/help-gnu-emacs/2021-10/msg00037.html
+ https://lists.gnu.org/archive/html/help-gnu-emacs/2021-10/msg00045.html
+ http://angg.twu.net/2021-oficina.html (<- in Portuguese)
+
+My original implementation was the one described here:
+
+ http://angg.twu.net/2021-video-links.html
+
+I'm trying to making the short links to video tutorials work from
+Emacs _in a way that is convenient for both long-time users and
+total beginners_. This is quite a challenge - especially because
+since oct/2021 my notion of \"total beginners\" includes \"people
+who use Windows and who have never used terminals in their
+lives\".
-Long story short
-================
-You may want to copy the block of elisp below to your .emacs. You can
-use this sexp to help you:
-
- (ee-copy-rest 0 '(find-fline \"~/.emacs\"))
-
-;; Hyperlinks to videos about eev.
-;; See: (find-videos-intro)
-;; (find-eev-video-links \"eepitchvideo\" \"video4-eepitch\" \"Lj_zKC5BR64\")
-;; (find-eev-video-links \"eevvideo\" \"video2\" \"doeyn5MOaB8\")
-;; (find-eev-video-links \"eevvideopt\" \"video2pt\" \"yztYD9Y7Iz4\")
-\(code-video \"eepitchvideo\"
\"$S/http/angg.twu.net/eev-videos/video4-eepitch.mp4\")
-\(code-video \"eevvideo\" \"$S/http/angg.twu.net/eev-videos/video2.mp4\")
-\(code-video \"eevvideopt\" \"$S/http/angg.twu.net/eev-videos/video2pt.mp4\")
-;; (find-eepitchvideo)
-;; (find-eevvideo)
-;; (find-eevvideopt)
-;; (find-ebuffer \"*Messages*\")
" pos-spec-list)))
-;; (find-videos-intro)
+;; (find-video-links-intro)
+
@@ -13833,7 +13891,8 @@ should, and this is just an embarassingly small
collection of
links, tests, and examples...
See:
- (find-eevfile \"eev-template0.el\" \"intrinsically INCOMPATIBLE with
lexical\")
+ (find-eevfile \"eev-template0.el\" \"INCOMPATIBLE WITH LEXICAL BINDING\")
+ (find-eev \"eev-template0.el\" \"lexical-binding\")
diff --git a/eev-load.el b/eev-load.el
index 83af9f3..6f5070e 100644
--- a/eev-load.el
+++ b/eev-load.el
@@ -20,7 +20,7 @@
;;
;; Author: Eduardo Ochs <eduardoochs@gmail.com>
;; Maintainer: Eduardo Ochs <eduardoochs@gmail.com>
-;; Version: 20211024
+;; Version: 20211107
;; Keywords: e-scripts
;;
;; Supersedes: (find-eev "eev-all.el")
@@ -142,10 +142,12 @@
(require 'eev-edit) ; (find-eev "eev-edit.el")
(require 'eev-testblocks) ; (find-eev "eev-testblocks.el")
;;
-;; Hyperlinks to audio, video, and IRC. Not well documented. See:
+;; Hyperlinks to audio, video, and IRC:
+;; (find-video-links-intro)
;; (find-audiovideo-intro)
;; (find-rcirc-intro)
(require 'eev-audiovideo) ; (find-eev "eev-audiovideo.el")
+(require 'eev-videolinks) ; (find-eev "eev-videolinks.el")
(require 'eev-rcirc) ; (find-eev "eev-rcirc.el")
;;
;; Advanced (and hard to use) features that may require creating a
diff --git a/eev-template0.el b/eev-template0.el
index 6bb878a..6a05bb0 100644
--- a/eev-template0.el
+++ b/eev-template0.el
@@ -19,7 +19,7 @@
;;
;; Author: Eduardo Ochs <eduardoochs@gmail.com>
;; Maintainer: Eduardo Ochs <eduardoochs@gmail.com>
-;; Version: 20210925
+;; Version: 20211102
;; Keywords: e-scripts
;;
;; Latest version: <http://angg.twu.net/eev-current/eev-template0.el>
@@ -72,23 +72,7 @@
;; (find-code-brfile 'find-bar :local 'brbarl :dired 'brbard)
;; (find-latex-links "FOO")
;;
-;; Note that `ee-template0' is intrinsically INCOMPATIBLE with lexical
-;; binding - it is common to have `{VAR}'s in the string referring to
-;; names of arguments of a `defun's, or to names of variables defined
-;; in an enclosing `let' block, or to names of global variables.
-;;
-;; Here are some messages in help-gnu-emacs about dynamic binding
-;; being deprecated:
-;; https://lists.gnu.org/archive/html/help-gnu-emacs/2021-06/msg00054.html
-;; https://lists.gnu.org/archive/html/help-gnu-emacs/2021-06/msg00085.html
-;; https://lists.gnu.org/archive/html/help-gnu-emacs/2021-06/msg00095.html
-;; https://lists.gnu.org/archive/html/help-gnu-emacs/2021-06/msg00096.html
-;;
-;; Here is a tutorial on lexical-versus-dynamic binding:
-;;
-;; (find-lexical-intro)
-;;
-;; And here are some links to places where the documentation of eev
+;; Here are some links to places where the documentation of eev
;; mentions uses of `ee-template0':
;;
;; (find-eevgrep "grep --color -nH -e ee-template0 *.el")
@@ -96,6 +80,11 @@
;; (find-eev-quick-intro "8.4. Creating e-script blocks" "`M-B'")
;; (find-eev-quick-intro "9.2. Extra arguments to `code-c-d'")
;; (find-eev-quick-intro "9.3. Hyperlinks to PDF files")
+;;
+;; Important: `ee-template0' is _INCOMPATIBLE WITH LEXICAL BINDING_.
+;; See the comments at the end of this file.
+;;
+;; «.lexical-binding» (to "lexical-binding")
@@ -138,6 +127,57 @@ Example: (ee-template0 \"{<} a{(+ 2 3)} {>}\")
+
+
+
+;;; _ _ _ _ _ _ _
+;;; | | _____ _(_) ___ __ _| | | |__ (_)_ __ __| (_)_ __ __ _
+;;; | |/ _ \ \/ / |/ __/ _` | | | '_ \| | '_ \ / _` | | '_ \ / _` |
+;;; | | __/> <| | (_| (_| | | | |_) | | | | | (_| | | | | | (_| |
+;;; |_|\___/_/\_\_|\___\__,_|_| |_.__/|_|_| |_|\__,_|_|_| |_|\__, |
+;;; |___/
+;; «lexical-binding» (to ".lexical-binding")
+;;
+;; Here is a demo of what fails in lexical binding.
+;; Note that the defun below is commented out with an initial "'".
+'
+(defun ee-dynlex-test (a b)
+ (let* ((aa (concat a a))
+ (bb (concat b b)))
+ (ee-template0 "<{a} {aa} {b} {bb}>")))
+;;
+;; Tests:
+;;
+;; 1) Run the defun above with `M-e'.
+;; Then try this test:
+;; (ee-dynlex-test "Aa" "Bb")
+;; It will returns this:
+;; "<Aa AaAa Bb BbBb>"
+;;
+;; 2) Run the defun above in lexical binding mode with `M-1 M-1 M-e'.
+;; Then try this test:
+;; (ee-dynlex-test "Aa" "Bb")
+;; You will get this error:
+;; "format: Symbol's value as variable is void: a"
+;;
+;; See:
+;; (find-lexical-intro "0. How to use this")
+;; (find-lexical-intro "0. How to use this" "`M-1 M-1 M-e'")
+;; (find-lexical-intro "5. A thread")
+;;
+;; Here are some messages in help-gnu-emacs and in emacs-devel about
+;; dynamic binding being deprecated:
+;; https://lists.gnu.org/archive/html/help-gnu-emacs/2021-06/msg00054.html
+;; https://lists.gnu.org/archive/html/help-gnu-emacs/2021-06/msg00085.html
+;; https://lists.gnu.org/archive/html/help-gnu-emacs/2021-06/msg00095.html
+;; https://lists.gnu.org/archive/html/help-gnu-emacs/2021-06/msg00096.html
+;; https://lists.gnu.org/archive/html/emacs-devel/2021-09/msg01854.html
+
+
+
+
+
+
(provide 'eev-template0)
diff --git a/eev-testblocks.el b/eev-testblocks.el
index c8fbe77..a2226ef 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: 20211023
+;; Version: 20211104
;; Keywords: e-scripts
;;
;; Latest version: <http://angg.twu.net/eev-current/eev-testblocks.el>
@@ -38,6 +38,7 @@
;; (find-eepitch-intro "3. Test blocks")
;; (find-eepitch-intro "3.1. `find-eeit-links'")
;; http://angg.twu.net/emacsconf2021.html
+;; http://angg.twu.net/LATEX/2021emacsconf.pdf
;; «.ee-insert-test» (to "ee-insert-test")
;; «.examples» (to "examples")
@@ -56,8 +57,8 @@
;; See: (find-eepitch-intro "3. Test blocks")
;; Insert a "test block" in a Lua/Python/Ruby/shell/Tcl/etc script.
-
-(defalias 'eeit 'ee-insert-test)
+(defalias 'eeit 'ee-insert-test)
+(defalias 'ee-insert-test-block 'ee-insert-test)
(defun ee-insert-test ()
"Insert a \"test block\" - an eepitch block in a multiline comment."
@@ -242,13 +243,13 @@ load \"%s\"
(defun ee-insert-test-tcl-mode ()
(interactive)
(insert (ee-adjust-red-stars (format "
-set THIS_IS_A_TEST_BLOCK {
+lindex {{} {This is a test block:
(eepitch-tclsh)
(eepitch-kill)
(eepitch-tclsh)
-source %s
+ source %s
-}
+}} 0 ;# End of the test block
" (buffer-name)))))
(defun ee-insert-test-tuareg-mode ()
diff --git a/eev-tlinks.el b/eev-tlinks.el
index c513fa5..498e295 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: 20211027
+;; Version: 2021nov07
;; Keywords: e-scripts
;;
;; Latest version: <http://angg.twu.net/eev-current/eev-tlinks.el>
@@ -468,6 +468,7 @@ See: (find-eev \"eev-intro.el\")"
;; <find-{stem}-intro>
;; Skel: (find-intro-links \"{stem}\")
+;; Test: (find-{stem}-intro)
\(defun find-{stem}-intro (&rest pos-spec-list) (interactive)
(let ((ee-buffer-name \"*(find-{stem}-intro)*\"))
@@ -1572,17 +1573,6 @@ netcat -l -p {tgtport}
))
-;; Tests: (ee-time-to-arg "")
-;; (ee-time-to-arg "{time}")
-;; (ee-time-to-arg "1:23")
-;; (ee-time-to-arg nil)
-;; See: (find-efunction 'ee-time-to-youtube-time)
-;;
-(defun ee-time-to-arg (time)
- (if (ee-time-to-youtube-time time)
- (format " \"%s\"" time)
- ""))
-
;; «ee-psne-if-needed» (to ".ee-psne-if-needed")
@@ -1593,10 +1583,13 @@ netcat -l -p {tgtport}
;; (find-estring (ee-psne-download0 "http://www.foo.org/bar.html"))
;;
(defun ee-psne-if-needed (url)
- (if (file-exists-p (ee-expand (ee-url-to-fname url)))
+ (if (ee-psne-downloaded-p url)
"# Local file found. No need to download it again.\n"
(ee-adjust-red-stars (ee-psne-download url))))
+(defun ee-psne-downloaded-p (url)
+ (file-exists-p (ee-expand (ee-url-to-fname url))))
+
(defun ee-psne-download (url)
(concat "\
# Local file not found!
@@ -1604,8 +1597,9 @@ netcat -l -p {tgtport}
" (ee-psne-download0 url)))
(defun ee-psne-download0 (url)
- (let* ((fname (ee-shorten-file-name (ee-url-to-fname url)))
- (dir (file-name-directory fname)))
+ (let* ((fname (ee-shorten-file-name (ee-url-to-fname url)))
+ (fname0 (file-name-nondirectory fname))
+ (dir (file-name-directory fname)))
(ee-template0 "\
(eepitch-shell)
(eepitch-kill)
@@ -1616,9 +1610,23 @@ wget -nc '{url}'
echo '{url}' >> ~/.psne.log
# (find-fline \"{dir}\")
+# (find-fline \"{dir}\" \"{fname0}\")
# See: (find-psne-intro)
")))
+;; Test: (find-estring (ee-psne-url-comment "http://www.foo.org/bar.html"))
+(defun ee-psne-url-comment (url)
+ (let* ((fname (ee-shorten-file-name (ee-url-to-fname url)))
+ (fname0 (file-name-nondirectory fname))
+ (dir (file-name-directory fname)))
+ (ee-template0 "\
+# URL, local file, and links to the directory of the local file:
+# {url}
+# {fname}
+# (find-fline \"{dir}\" \"{fname0}\")
+# (find-fline \"{dir}\")
+")))
+
@@ -1654,59 +1662,67 @@ echo '{url}' >> ~/.psne.log
"))
-;;; _ _ _
-;;; ___ ___ __| | ___ ___ _____ ____ _(_) __| | ___ ___
-;;; / __/ _ \ / _` |/ _ \_____ / _ \/ _ \ \ / /\ \ / / |/ _` |/ _ \/ _ \
-;;; | (_| (_) | (_| | __/_____| __/ __/\ V / \ V /| | (_| | __/ (_) |
-;;; \___\___/ \__,_|\___| \___|\___| \_/ \_/ |_|\__,_|\___|\___/
-;;;
-;; «code-eevvideo» (to ".code-eevvideo")
-;; See: (find-audiovideo-intro "7.1. `code-eevvideo'")
-;; Test: (find-code-eevvideo "eevnav" "M-x-list-packages-eev-nav")
-;; (code-eevvideo "eevnav" "M-x-list-packages-eev-nav")
-;; (find-eevnavvideo "0:00")
-;;
-(defun code-eevvideo (c stem &optional youtubeid)
- (eval (ee-read (ee-code-eevvideo c stem youtubeid))))
-(defun find-code-eevvideo (&optional c stem youtubeid &rest rest)
- (setq c (or c "{c}"))
- (setq stem (or stem "{stem}"))
- (setq youtubeid (or youtubeid "{youtubeid}"))
- (find-estring-elisp (apply 'ee-code-eevvideo c stem youtubeid rest)))
-(defun ee-code-eevvideo (c stem youtubeid)
- (ee-template0 "\
-;; (find-code-eevvideo \"{c}\" \"{stem}\" \"{youtubeid}\")
-;; (code-eevvideo \"{c}\" \"{stem}\" \"{youtubeid}\")
-;; (find-{c}video \"0:00\")
-;;
-;; See: (find-audiovideo-intro \"7.1. `code-eevvideo'\")
-(defun find-{c}video (&optional time &rest rest)
- (interactive)
- (find-eevvideo-links \"{c}\" \"{stem}\" \"{youtubeid}\" time))
-"))
-;; «code-eevvideo-local» (to ".code-eevvideo-local")
-;; Test: (code-eevvideo-local "vlinks" "2021-video-links" "xQqWufQgzVY")
-;; (find-code-eevvideo-local "vlinks" "2021-video-links" "xQqWufQgzVY")
-;;
-(defun code-eevvideo-local (c stem &optional youtubeid)
- (eval (ee-read (ee-code-eevvideo-local c stem youtubeid))))
-(defun find-code-eevvideo-local (&optional c stem youtubeid &rest rest)
- (setq c (or c "{c}"))
- (setq stem (or stem "{stem}"))
- (setq youtubeid (or youtubeid "{youtubeid}"))
- (find-estring-elisp (apply 'ee-code-eevvideo-local c stem youtubeid rest)))
-(defun ee-code-eevvideo-local (c stem youtubeid)
- (ee-template0 "\
-;; (find-code-eevvideo-local \"{c}\" \"{stem}\" \"{youtubeid}\")
-;; (code-eevvideo-local \"{c}\" \"{stem}\" \"{youtubeid}\")
-;;
-;; (find-fline \"$S/http/angg.twu.net/eev-videos/\"
\"{stem}\")
-;; (find-code-video \"{c}video\"
\"$S/http/angg.twu.net/eev-videos/{stem}.mp4\")
- (code-video \"{c}video\"
\"$S/http/angg.twu.net/eev-videos/{stem}.mp4\")
-;; (find-{c}video \"0:00\")
-"))
+
+;; The functions below were totally rewritten, and their new definions
+;; are here:
+
+;; ;;; _ _ _
+;; ;;; ___ ___ __| | ___ ___ _____ ____ _(_) __| | ___ ___
+;; ;;; / __/ _ \ / _` |/ _ \_____ / _ \/ _ \ \ / /\ \ / / |/ _` |/ _ \/ _ \
+;; ;;; | (_| (_) | (_| | __/_____| __/ __/\ V / \ V /| | (_| | __/ (_) |
+;; ;;; \___\___/ \__,_|\___| \___|\___| \_/ \_/ |_|\__,_|\___|\___/
+;; ;;;
+;; ;; «code-eevvideo» (to ".code-eevvideo")
+;; ;; TODO: rewrite this reusing parts of:
+;; ;; (find-eev "eev-videolinks.el" "find-eevlocal-links")
+;; ;; See: (find-audiovideo-intro "7.1. `code-eevvideo'")
+;; ;; Test: (find-code-eevvideo "eevnav" "M-x-list-packages-eev-nav")
+;; ;; (code-eevvideo "eevnav" "M-x-list-packages-eev-nav")
+;; ;; (find-eevnavvideo "0:00")
+;; ;;
+;; (defun code-eevvideo (c stem &optional youtubeid)
+;; (eval (ee-read (ee-code-eevvideo c stem youtubeid))))
+;; (defun find-code-eevvideo (&optional c stem youtubeid &rest rest)
+;; (setq c (or c "{c}"))
+;; (setq stem (or stem "{stem}"))
+;; (setq youtubeid (or youtubeid "{youtubeid}"))
+;; (find-estring-elisp (apply 'ee-code-eevvideo c stem youtubeid rest)))
+;; (defun ee-code-eevvideo (c stem youtubeid)
+;; (ee-template0 "\
+;; ;; (find-code-eevvideo \"{c}\" \"{stem}\" \"{youtubeid}\")
+;; ;; (code-eevvideo \"{c}\" \"{stem}\" \"{youtubeid}\")
+;; ;; (find-{c}video \"0:00\")
+;; ;;
+;; ;; See: (find-audiovideo-intro \"7.1. `code-eevvideo'\")
+;;
+;; (defun find-{c}video (&optional time &rest rest)
+;; (interactive)
+;; (find-eevvideo-links \"{c}\" \"{stem}\" \"{youtubeid}\" time))
+;; "))
+;;
+;; ;; «code-eevvideo-local» (to ".code-eevvideo-local")
+;; ;; Test: (code-eevvideo-local "vlinks" "2021-video-links" "xQqWufQgzVY")
+;; ;; (find-code-eevvideo-local "vlinks" "2021-video-links" "xQqWufQgzVY")
+;; ;;
+;; (defun code-eevvideo-local (c stem &optional youtubeid)
+;; (eval (ee-read (ee-code-eevvideo-local c stem youtubeid))))
+;; (defun find-code-eevvideo-local (&optional c stem youtubeid &rest rest)
+;; (setq c (or c "{c}"))
+;; (setq stem (or stem "{stem}"))
+;; (setq youtubeid (or youtubeid "{youtubeid}"))
+;; (find-estring-elisp (apply 'ee-code-eevvideo-local c stem youtubeid
rest)))
+;; (defun ee-code-eevvideo-local (c stem youtubeid)
+;; (ee-template0 "\
+;; ;; (find-code-eevvideo-local \"{c}\" \"{stem}\" \"{youtubeid}\")
+;; ;; (code-eevvideo-local \"{c}\" \"{stem}\" \"{youtubeid}\")
+;; ;;
+;; ;; (find-fline \"$S/http/angg.twu.net/eev-videos/\"
\"{stem}\")
+;; ;; (find-code-video \"{c}video\"
\"$S/http/angg.twu.net/eev-videos/{stem}.mp4\")
+;; (code-video \"{c}video\"
\"$S/http/angg.twu.net/eev-videos/{stem}.mp4\")
+;; ;; (find-{c}video \"0:00\")
+;; "))
@@ -1727,11 +1743,13 @@ echo '{url}' >> ~/.psne.log
;;; \___|\___| \_/ \_/ |_|\__,_|\___|\___/
;;;
;; «find-eev-video-links» (to ".find-eev-video-links")
-;; Obsolete? See: (find-audiovideo-intro "7.2. `find-eevvideo-links'")
-
+;; Obsolete?
+;; See: (find-audiovideo-intro "7.2. `find-eevvideo-links'")
+;; and: (find-video-links-intro)
+;;
;; Skel: (find-find-links-links "{k}" "eev-video" "c anggstem youtubehash")
;; (find-find-links-links-new "eev-video" "c anggstem youtubehash" "")
-
+;;
(defun find-eev-video-links (&optional c anggstem youtubehash &rest
pos-spec-list)
"Visit a temporary buffer containing a script for downloading an eev video.
See: (find-videos-intro)
@@ -1818,11 +1836,11 @@ echo
'http://angg.twu.net/eev-videos/{anggstem}.mp4' >> ~/.psne.log
See: (find-videos-intro \\\"1. Some videos\\\" \\\"{stem}\\\")
http://angg.twu.net/{stem}.html
for more info on this particular video,
-and: (find-videos-intro \\\"2. Short links to eev video tutorials\\\")
- or: http://angg.twu.net/eev-intros/find-videos-intro.html#2
+and: (find-video-links-intro \\\"7. `find-eev-video'\\\")
+ or: http://angg.twu.net/eev-intros/find-video-links-intro.html#7
for more info on these video tutorials.\"
(interactive)
- (find-eevvideo-links \"{c}\" \"{stem}\" \"{youtubeid}\" time))
+ (find-eev-video \"{stem}\" \"{youtubeid}\" time))
")
)
pos-spec-list))
@@ -2266,7 +2284,7 @@ wget -nc -O {yyyy}-{mm}-{dd}-emacs-news.org \\
;;
(defun {eeitfunstr} ()
(interactive)
- (insert (format \"
+ (insert (ee-adjust-red-stars (format \"
--[[
(eepitch-lua51)
(eepitch-kill)
@@ -2274,7 +2292,7 @@ wget -nc -O {yyyy}-{mm}-{dd}-emacs-news.org \\
dofile \\\"%s\\\"
--]]
-\" (buffer-name))))
+\" (buffer-name)))))
;; Test:
;; ({eeitfunstr})
diff --git a/eev-videolinks.el b/eev-videolinks.el
new file mode 100644
index 0000000..bc73fc4
--- /dev/null
+++ b/eev-videolinks.el
@@ -0,0 +1,468 @@
+;;; eev-videolinks.el --- support for [Video links:] blocks. -*-
lexical-binding: nil; -*-
+
+;; Copyright (C) 2021 Free Software Foundation, Inc.
+;;
+;; This file is part of GNU eev.
+;;
+;; GNU eev is free software: you can redistribute it and/or modify
+;; it under the terms of the GNU General Public License as published by
+;; the Free Software Foundation, either version 3 of the License, or
+;; (at your option) any later version.
+;;
+;; GNU eev is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+;; GNU General Public License for more details.
+;;
+;; You should have received a copy of the GNU General Public License
+;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
+;;
+;; Author: Eduardo Ochs <eduardoochs@gmail.com>
+;; Maintainer: Eduardo Ochs <eduardoochs@gmail.com>
+;; Version: 20211027
+;; Keywords: e-scripts
+;;
+;; Latest version: <http://angg.twu.net/eev-current/eev-videolinks.el>
+;; htmlized: <http://angg.twu.net/eev-current/eev-videolinks.el.html>
+;; See also: <http://angg.twu.net/eev-current/eev-readme.el.html>
+;; <http://angg.twu.net/eev-intros/find-eev-intro.html>
+;; <http://angg.twu.net/eev-intros/find-links-intro.html>
+;; (find-eev-intro)
+;; (find-links-intro)
+
+;; (load "eev-videolinks.el")
+
+;; «.find-eev-video» (to "find-eev-video")
+;; «.find-eevlocal-links» (to "find-eevlocal-links")
+;; «.select» (to "select")
+;; «.ee-use-eevyoutube-video» (to "ee-use-eevyoutube-video")
+;; «.ee-use-eevlocal-video» (to "ee-use-eevlocal-video")
+;; «.code-eevvideo» (to "code-eevvideo")
+;; «.first-class-videos» (to "first-class-videos")
+;; «.video-tutorials» (to "video-tutorials")
+;; «.find-eev2019video» (to "find-eev2019video")
+;; «.find-eev2020video» (to "find-eev2020video")
+;; «.find-eevnavvideo» (to "find-eevnavvideo")
+;; «.find-eevtemplvideo» (to "find-eevtemplvideo")
+;; «.find-eevfherelvideo» (to "find-eevfherelvideo")
+;; «.find-eevtestblsvideo» (to "find-eevtestblsvideo")
+;; «.find-eevvlinksvideo» (to "find-eevvlinksvideo")
+
+;;; Commentary:
+
+;; In may/2021 I implemented the "[Video links:]" blocks in the
+;; tutorials of eev, and I explained everything here:
+;;
+;; http://angg.twu.net/2021-video-links.html
+;;
+;; but the innards of that implementation were ugly, and I've changed
+;; them several times since then.
+;;
+;; This file - from nov/2021 - reimplements those innards in the way
+;; described here:
+;;
+;; (find-video-links-intro)
+;; (find-video-links-intro "7. `find-eev-video'")
+;; (find-audiovideo-intro "4. Short hyperlinks to audio and video files")
+
+
+
+
+;;; __ _ _ _ _
+;;; / _(_)_ __ __| | ___ _____ __ __ _(_) __| | ___ ___
+;;; | |_| | '_ \ / _` |_____ / _ \/ _ \ \ / /___\ \ / / |/ _` |/ _ \/ _ \
+;;; | _| | | | | (_| |_____| __/ __/\ V /_____\ V /| | (_| | __/ (_) |
+;;; |_| |_|_| |_|\__,_| \___|\___| \_/ \_/ |_|\__,_|\___|\___/
+;;;
+;; «find-eev-video» (to ".find-eev-video")
+;; See: (find-video-links-intro "7. `find-eev-video'")
+;; (find-video-links-intro "7. `find-eev-video'" "setq")
+;; Tests: (setq ee-find-eev-video-function 'find-eevyoutube-video)
+;; (setq ee-find-eev-video-function 'find-eevlocal-video)
+;; (setq ee-find-eev-video-function 'find-eevlinks-video)
+;; (find-eev-video "emacsconf2020" "hOAqBc42Gg8" "6:25")
+;;
+(defvar ee-find-eev-video-function 'find-eevlocal-video)
+
+(defun find-eev-video (mp4stem hash &optional time &rest rest)
+ (apply ee-find-eev-video-function mp4stem hash time rest))
+
+(defun find-eevyoutube-video (mp4stem hash &optional time &rest rest)
+ (find-youtube-video hash time))
+
+(defun find-eevlocal-video (mp4stem hash &optional time &rest rest)
+ (let* ((url (format "http://angg.twu.net/eev-videos/%s.mp4" mp4stem))
+ (fname (ee-shorten-file-name (ee-url-to-fname url))))
+ (if (ee-psne-downloaded-p url)
+ (find-mpv-video fname time)
+ (find-eevlocal-links stem hash time))))
+
+(defun find-eevlinks-video (mp4stem hash &optional time &rest rest)
+ (find-eevlocal-links mp4stem hash time))
+
+
+
+
+;;; _ _ _ _ _
+;;; ___ _____ _| | ___ ___ __ _| | | (_)_ __ | | _____
+;;; / _ \/ _ \ \ / / |/ _ \ / __/ _` | |_____| | | '_ \| |/ / __|
+;;; | __/ __/\ V /| | (_) | (_| (_| | |_____| | | | | | <\__ \
+;;; \___|\___| \_/ |_|\___/ \___\__,_|_| |_|_|_| |_|_|\_\___/
+;;;
+;; «find-eevlocal-links» (to ".find-eevlocal-links")
+;; Skel: (find-find-links-links-new "eevlocal" "stem hash time" "")
+;; Tests: (find-eevlocal-links "emacsconf1234")
+;; (find-eevlocal-links "emacsconf2020")
+;; (find-eevlocal-links "emacsconf2020" nil "1:23")
+;;
+(defun find-eevlocal-links (&optional stem hash time &rest pos-spec-list)
+"Visit a temporary buffer containing hyperlinks for eevlocal."
+ (interactive)
+ (setq stem (or stem "{stem}"))
+ (setq hash (or hash "{hash}"))
+ (setq time (or time "{time}"))
+ (apply
+ 'find-elinks
+ `((find-eevlocal-links ,stem ,hash ,time ,@pos-spec-list)
+ ;; Convention: the first sexp always regenerates the buffer.
+ ,(ee-eevlocal-findmpvvideo stem time)
+ ;; ""
+ ,(ee-H "See:")
+ (find-video-links-intro "7. `find-eev-video'")
+ (find-video-links-intro "7. `find-eev-video'" "find-eevlocal-video")
+ ""
+ ,(ee-eevlocal-body stem hash time)
+ )
+ pos-spec-list))
+
+;; Tests:
+;; (find-estring (ee-eevlocal-body "emacsconf2020" "0123456789a" nil))
+;; (find-estring (ee-eevlocal-body "emacsconf2020" "0123456789a" "1:23"))
+;; (find-estring (ee-eevlocal-body "emacsconf1234" "0123456789a" "1:23"))
+
+(defun ee-eevlocal-body (stem hash time)
+ "An internal function used by `find-eevlocal-links'."
+ (let ((url (format "http://angg.twu.net/eev-videos/%s.mp4" stem)))
+ (concat (ee-eevlocal-youtube-comment hash time)
+ "\n" (ee-psne-url-comment url)
+ "\n\n" (ee-eevlocal-psne stem time)
+ )))
+
+;; Tests:
+;; (find-estring (ee-eevlocal-youtube-comment "0123456789a" nil))
+;; (find-estring (ee-eevlocal-youtube-comment "0123456789a" ""))
+;; (find-estring (ee-eevlocal-youtube-comment "0123456789a" "1:23"))
+;;
+(defun ee-eevlocal-youtube-comment (hash time)
+ "An internal function used by `find-eevlocal-links'."
+ (let* ((youtubeurl (ee-find-youtube-url hash time))
+ (timearg (ee-time-to-arg time)))
+ (ee-template0 "\
+# Youtube:
+# (kill-new \"{youtubeurl}\")
+# {youtubeurl}\"
+# (find-youtube-video \"{hash}\"{timearg})
+")))
+
+;; Tests:
+;; (find-estring (ee-eevlocal-psne "emacsconf1234" nil))
+;; (find-estring (ee-eevlocal-psne "emacsconf2020" nil))
+;; (find-estring (ee-eevlocal-psne "emacsconf2020" "1:23"))
+;; (find-estring (ee-eevlocal-findmpvvideo "emacsconf2020" nil))
+;; (find-estring (ee-eevlocal-findmpvvideo "emacsconf2020" "{foo}"))
+;; (find-estring (ee-eevlocal-findmpvvideo "emacsconf2020" "1:23"))
+;;
+(defun ee-eevlocal-psne (stem time)
+ "An internal function used by `find-eevlocal-links'."
+ (let* ((url (format "http://angg.twu.net/eev-videos/%s.mp4" stem)))
+ (concat (ee-psne-if-needed url)
+ (if (not (ee-psne-downloaded-p url))
+ (concat "\n" (ee-eevlocal-findmpvvideo stem time))))))
+
+(defun ee-eevlocal-findmpvvideo (stem time)
+ "An internal function used by `find-eevlocal-links'."
+ (let* ((url (format "http://angg.twu.net/eev-videos/%s.mp4" stem))
+ (fname (ee-shorten-file-name (ee-url-to-fname url)))
+ (timearg (ee-time-to-arg time)))
+ (ee-template0 "\
+# (find-mpv-video \"{fname}\"{timearg})
+")))
+
+
+
+
+
+
+;;; ____ _ _
+;;; / ___| ___| | ___ ___| |_
+;;; \___ \ / _ \ |/ _ \/ __| __|
+;;; ___) | __/ | __/ (__| |_
+;;; |____/ \___|_|\___|\___|\__|
+;;;
+;; «select» (to ".select")
+;; Tests: (ee-use-eevvideo-links)
+;; (ee-use-eevyoutube-video)
+;; (find-eevtestblsvideo "2:33")
+;;
+;; «ee-use-eevyoutube-video» (to ".ee-use-eevyoutube-video")
+(defun ee-use-eevyoutube-video ()
+ "Make `find-eev-video' play videos on youtube using a browser.
+This is a quick hack inspired by a workshop for Windows users. On
+Windows it is hard to configure the mechanism that downloads
+local copies of videos and plays the local copies with mpv, and
+this makes the default behavior of the links in [Video links:]
+blocks very inconvenient for beginners. This hack redefines the
+function used by `find-eev-links', that is used by the links to
+videos that are used in [Video links:] blocks, to make those
+links use a browser to play the videos on youtube. To get back
+the default behavior, run `ee-use-find-eevlocal-links'."
+ (interactive)
+ (setq ee-find-eev-video-function 'find-eevyoutube-video))
+
+;; «ee-use-eevlocal-video» (to ".ee-use-eevlocal-video")
+(defun ee-use-eevlocal-video ()
+ "Use the default behavior for `find-eev-video'.
+With the default definition the links in the [Video links:]
+blocks of the tutorials of eev will try to download local copies
+of the videos and play them with mpv. Compare with
+`ee-use-find-eevyoutube-video'."
+ (interactive)
+ (setq ee-find-eev-video-function 'find-eevlocal-video))
+
+
+
+
+
+
+
+
+
+
+
+
+;;; _ _ _
+;;; ___ ___ __| | ___ ___ _____ ____ _(_) __| | ___ ___
+;;; / __/ _ \ / _` |/ _ \_____ / _ \/ _ \ \ / /\ \ / / |/ _` |/ _ \/ _ \
+;;; | (_| (_) | (_| | __/_____| __/ __/\ V / \ V /| | (_| | __/ (_) |
+;;; \___\___/ \__,_|\___| \___|\___| \_/ \_/ |_|\__,_|\___|\___/
+;;;
+;; «code-eevvideo» (to ".code-eevvideo")
+;; I store lots of videos in:
+;;
+;; http://angg.twu.net/eev-videos/
+;;
+;; besides the official video tutorials for eev. The functions to
+;; access the official video tutorials are defined in the next
+;; section, as real defuns with real docstrings, but for the videos
+;; that are not so important - my "second-class videos" - I prefer to
+;; use sexps like these to define the sexp hyperlinks to them:
+;;
+;; (code-eevvideo "2021daniel4" "2021-daniel-4")
+;; (code-eevlinksvideo "2021daniel4" "2021-daniel-4")
+;; (find-2021daniel4video "0:00")
+;;
+;; To understand how they work, try:
+;;
+;; (find-code-eevvideo "2021daniel4" "2021-daniel-4")
+;; (find-code-eevlinksvideo "2021daniel4" "2021-daniel-4")
+;; (find-code-eev{mod}video "M" "2021daniel4" "2021-daniel-4" "HASH")
+;;
+;; They are implemented using the three functions with "{mod}"s in
+;; their names, defined below.
+
+;; Test: (find-code-eev{mod}video "M" "2021daniel4" "2021-daniel-4" "HASH")
+;;
+(defun find-code-eev{mod}video (&optional mod c stem hash &rest rest)
+ (find-estring-elisp (apply 'ee-code-eev{mod}video mod c stem hash rest)))
+(defun code-eev{mod}video (mod c stem &optional hash)
+ (eval (ee-read (ee-code-eev{mod}video mod c stem hash))))
+(defun ee-code-eev{mod}video (&optional mod c stem hash)
+ (setq mod (or mod "{mod}"))
+ (setq c (or c "{c}"))
+ (setq stem (or stem "{stem}"))
+ (setq hash (or hash "{hash}"))
+ (ee-template0 "\
+;; (find-code-eev{<}mod{>}video \"{mod}\" \"{c}\" \"{stem}\" \"{hash}\")
+;; (code-eev{<}mod{>}video \"{mod}\" \"{c}\" \"{stem}\" \"{hash}\")
+;; (find-{c}video \"0:00\")
+;;
+;; See: (find-video-links-intro \"7. `find-eev-video'\"
\"`find-eevlocal-video'\")
+;; (find-video-links-intro \"7. `find-eev-video'\"
\"`find-eevlinks-video'\")
+;;
+(defun find-{c}video (time &rest comments)
+ (interactive)
+ (find-eev{mod}-video \"{stem}\" \"{hash}\" time))
+"))
+
+;; Tests:
+;; (find-code-eevvideo "2021daniel4" "2021-daniel-4" "HASH")
+;; (find-code-eevlocalvideo "2021daniel4" "2021-daniel-4" "HASH")
+;; (find-code-eevlinksvideo "2021daniel4" "2021-daniel-4" "HASH")
+;; (code-eevvideo "2021daniel4" "2021-daniel-4" "HASH")
+;; (code-eevlocalvideo "2021daniel4" "2021-daniel-4" "HASH")
+;; (code-eevlinksvideo "2021daniel4" "2021-daniel-4" "HASH")
+;; (find-2021daniel4video "0:00")
+;;
+(defun find-code-eevvideo (&optional c stem hash &rest rest)
+ (find-estring-elisp (apply 'ee-code-eev{mod}video "local" c stem hash rest)))
+(defun code-eevvideo (c stem &optional hash)
+ (eval (ee-read (ee-code-eev{mod}video "local" c stem hash))))
+
+(defun find-code-eevlocalvideo (&optional c stem hash &rest rest)
+ (find-estring-elisp (apply 'ee-code-eev{mod}video "local" c stem hash rest)))
+(defun code-eevlocalvideo (c stem &optional hash)
+ (eval (ee-read (ee-code-eev{mod}video "local" c stem hash))))
+
+(defun find-code-eevlinksvideo (&optional c stem hash &rest rest)
+ (find-estring-elisp (apply 'ee-code-eev{mod}video "links" c stem hash rest)))
+(defun code-eevlinksvideo (c stem &optional hash)
+ (eval (ee-read (ee-code-eev{mod}video "links" c stem hash))))
+
+
+
+
+
+
+
+
+;;; _ _ _ _ _ _
+;;; __ _(_) __| | ___ ___ | |_ _ _| |_ ___ _ __(_) __ _| |___
+;;; \ \ / / |/ _` |/ _ \/ _ \ _____| __| | | | __/ _ \| '__| |/ _` | / __|
+;;; \ V /| | (_| | __/ (_) |_____| |_| |_| | || (_) | | | | (_| | \__ \
+;;; \_/ |_|\__,_|\___|\___/ \__|\__,_|\__\___/|_| |_|\__,_|_|___/
+;;;
+;; «first-class-videos» (to ".first-class-videos")
+;; «video-tutorials» (to ".video-tutorials")
+;; The functions defined in this section correspond
+;; to the video tutorials listed in:
+;;
+;; (find-videos-intro "1. Some videos")
+;;
+;; If we defined them with `code-eevvideo' they wouldn't have
+;; docstrings and `find-efunction' wouldn't be able to find their
+;; definitions.
+
+;; «find-eev2019video» (to ".find-eev2019video")
+;; Skel: (find-eevshortvideo-links "eev2019" "emacsconf2019" "86yiRG8YJD0")
+;; See: (find-videos-intro "1. Some videos" "emacsconf2019")
+;; Index: http://angg.twu.net/.emacs.videos.html#eev2019
+;; Test: (find-eev2019video "0:00")
+(defun find-eev2019video (&optional time &rest rest)
+ "Play one of the video tutorials of eev starting at TIME.
+See: (find-videos-intro \"1. Some videos\" \"emacsconf2019\")
+ http://angg.twu.net/emacsconf2019.html
+ for more info on this particular video,
+and: (find-video-links-intro \"7. `find-eev-video'\")
+ or: http://angg.twu.net/eev-intros/find-video-links-intro.html#7
+ for more info on these video tutorials."
+ (interactive)
+ (find-eev-video "emacsconf2019" "86yiRG8YJD0" time))
+
+;; «find-eev2020video» (to ".find-eev2020video")
+;; Skel: (find-eevshortvideo-links "eev2020" "emacsconf2020" "hOAqBc42Gg8")
+;; See: (find-videos-intro "1. Some videos" "emacsconf2020")
+;; Index: http://angg.twu.net/.emacs.videos.html#eev2020
+;; Test: (find-eev2020video "0:00")
+(defun find-eev2020video (&optional time &rest rest)
+ "Play one of the video tutorials of eev starting at TIME.
+See: (find-videos-intro \"1. Some videos\" \"emacsconf2020\")
+ http://angg.twu.net/emacsconf2020.html
+ for more info on this particular video,
+and: (find-video-links-intro \"7. `find-eev-video'\")
+ or: http://angg.twu.net/eev-intros/find-video-links-intro.html#7
+ for more info on these video tutorials."
+ (interactive)
+ (find-eev-video "emacsconf2020" "hOAqBc42Gg8" time))
+
+;; «find-eevnavvideo» (to ".find-eevnavvideo")
+;; Skel: (find-eevshortvideo-links "eevnav" "2020-list-packages-eev-nav"
"kxBjiUo88_U")
+;; See: (find-videos-intro "1. Some videos" "2020-list-packages-eev-nav")
+;; Index: http://angg.twu.net/.emacs.videos.html#eevnav
+;; Test: (find-eevnavvideo "0:00")
+(defun find-eevnavvideo (&optional time &rest rest)
+ "Play one of the video tutorials of eev starting at TIME.
+See: (find-videos-intro \"1. Some videos\" \"2020-list-packages-eev-nav\")
+ http://angg.twu.net/2020-list-packages-eev-nav.html
+ for more info on this particular video,
+and: (find-video-links-intro \"7. `find-eev-video'\")
+ or: http://angg.twu.net/eev-intros/find-video-links-intro.html#7
+ for more info on these video tutorials."
+ (interactive)
+ (find-eev-video "2020-list-packages-eev-nav" "kxBjiUo88_U" time))
+
+;; «find-eevtemplvideo» (to ".find-eevtemplvideo")
+;; Skel: (find-eevshortvideo-links "eevtempl" "2020-some-template-based"
"91-9YfRPsuk")
+;; See: (find-videos-intro "1. Some videos" "2020-some-template-based")
+;; Index: http://angg.twu.net/.emacs.videos.html#eevtempl
+;; Test: (find-eevtemplvideo "0:00")
+(defun find-eevtemplvideo (&optional time &rest rest)
+ "Play one of the video tutorials of eev starting at TIME.
+See: (find-videos-intro \"1. Some videos\" \"2020-some-template-based\")
+ http://angg.twu.net/2020-some-template-based.html
+ for more info on this particular video,
+and: (find-video-links-intro \"7. `find-eev-video'\")
+ or: http://angg.twu.net/eev-intros/find-video-links-intro.html#7
+ for more info on these video tutorials."
+ (interactive)
+ (find-eev-video "2020-some-template-based" "91-9YfRPsuk" time))
+
+;; «find-eevfherelvideo» (to ".find-eevfherelvideo")
+;; Skel: (find-eevshortvideo-links "eevfherel" "2020-find-here-links"
"8jtiBlaDor4")
+;; See: (find-videos-intro "1. Some videos" "2020-find-here-links")
+;; Index: http://angg.twu.net/.emacs.videos.html#eevfherel
+;; Test: (find-eevfherelvideo "0:00")
+(defun find-eevfherelvideo (&optional time &rest rest)
+ "Play one of the video tutorials of eev starting at TIME.
+See: (find-videos-intro \"1. Some videos\" \"2020-find-here-links\")
+ http://angg.twu.net/2020-find-here-links.html
+ for more info on this particular video,
+and: (find-video-links-intro \"7. `find-eev-video'\")
+ or: http://angg.twu.net/eev-intros/find-video-links-intro.html#7
+ for more info on these video tutorials."
+ (interactive)
+ (find-eev-video "2020-find-here-links" "8jtiBlaDor4" time))
+
+;; «find-eevtestblsvideo» (to ".find-eevtestblsvideo")
+;; Skel: (find-eevshortvideo-links "eevtestbls" "2021-test-blocks"
"fpsF_M55W4o")
+;; See: (find-videos-intro "1. Some videos" "2021-test-blocks")
+;; Index: http://angg.twu.net/.emacs.videos.html#eevtestbls
+;; Test: (find-eevtestblsvideo "0:00")
+(defun find-eevtestblsvideo (&optional time &rest rest)
+ "Play one of the video tutorials of eev starting at TIME.
+See: (find-videos-intro \"1. Some videos\" \"2021-test-blocks\")
+ http://angg.twu.net/2021-test-blocks.html
+ for more info on this particular video,
+and: (find-video-links-intro \"7. `find-eev-video'\")
+ or: http://angg.twu.net/eev-intros/find-video-links-intro.html#7
+ for more info on these video tutorials."
+ (interactive)
+ (find-eev-video "2021-test-blocks" "fpsF_M55W4o" time))
+
+;; «find-eevvlinksvideo» (to ".find-eevvlinksvideo")
+;; Skel: (find-eevshortvideo-links "eevvlinks" "2021-video-links"
"xQqWufQgzVY")
+;; See: (find-videos-intro "1. Some videos" "2021-video-links")
+;; Index: http://angg.twu.net/.emacs.videos.html#eevvlinks
+;; Test: (find-eevvlinksvideo "0:00")
+(defun find-eevvlinksvideo (&optional time &rest rest)
+ "Play one of the video tutorials of eev starting at TIME.
+See: (find-videos-intro \"1. Some videos\" \"2021-video-links\")
+ http://angg.twu.net/2021-video-links.html
+ for more info on this particular video,
+and: (find-video-links-intro \"7. `find-eev-video'\")
+ or: http://angg.twu.net/eev-intros/find-video-links-intro.html#7
+ for more info on these video tutorials."
+ (interactive)
+ (find-eev-video "2021-video-links" "xQqWufQgzVY" time))
+
+
+
+
+
+(provide 'eev-videolinks)
+
+
+
+;; Local Variables:
+;; coding: utf-8-unix
+;; no-byte-compile: t
+;; End: