Warning: this is an htmlized version!
The original is here, and
the conversion rules are here.
;; This file:
;;    http://angg.twu.net/.emacs.templates
;;    http://angg.twu.net/.emacs.templates.html
;; file:///home/edrx/TH/L/.emacs.templates.html
;; (find-angg ".emacs.templates")
;;
;; (load (buffer-file-name))

;; (find-angg ".emacs")
;; (find-angg ".emacs" ".emacs.papers")
;; (find-angg ".emacs" ".emacs.templates")

;; «.ee-template»			(to "ee-template")
;; «.ee-template-expand»		(to "ee-template-expand")
;; «.ee-match-data-replace»		(to "ee-match-data-replace")
;; «.find-edrx-update-links»		(to "find-edrx-update-links")
;; «.find-qtdemo-links»			(to "find-qtdemo-links")
;; «.find-dn4tex-links»			(to "find-dn4tex-links")
;; «.find-beamer-links»			(to "find-beamer-links")
;; «.s2008a»				(to "s2008a")
;; «.find-blogme3-links»		(to "find-blogme3-links")
;; «.find-blogme3-curso-links»		(to "find-blogme3-curso-links")
;; «.find-curso-links»			(to "find-curso-links")
;; «.find-curso-makefile-links»		(to "find-curso-makefile-links")
;; «.find-quadro-links»			(to "find-quadro-links")
;; «.find-baudio-links»			(to "find-baudio-links")
;; «.bsec»				(to "bsec")
;; «.ee-bsec»				(to "ee-bsec")
;; «.ee-mkdl»				(to "ee-mkdl")
;; «.find-mkdl»				(to "find-mkdl")
;; «.ee-ps2pdf-script»			(to "ee-ps2pdf-script")
;; «.class»				(to "class")
;; «.bname»				(to "bname")
;; «.find-scp-links»			(to "find-scp-links")
;; «.find-gigapedia-links»		(to "find-gigapedia-links")
;; «.find-dn5-file-links»		(to "find-dn5-file-links")
;; «.find-blogme4-file-links»		(to "find-blogme4-file-links")
;; «.find-dhmake-links»			(to "find-dhmake-links")
;; «.find-dhmake-old-links»		(to "find-dhmake-old-links")
;; «.find-escript-links»		(to "find-escript-links")
;; «.find-thttpd-links»			(to "find-thttpd-links")
;; «.find-gitclone-links»		(to "find-gitclone-links")
;; «.find-newhost-links»		(to "find-newhost-links")
;; «.find-newhost-links-old»		(to "find-newhost-links-old")
;; «.find-prince-links»			(to "find-prince-links")
;; «.find-youtubedl-links-old»		(to "find-youtubedl-links-old")
;; «.find-eepitch-def-links»		(to "find-eepitch-def-links")
;; «.find-wpa-links»			(to "find-wpa-links")
;; «.find-intro-links»			(to "find-intro-links")
;; «.diagskel»				(to "diagskel")
;; «.ee-latex-header»			(to "ee-latex-header")
;; «.find-tail-call-links»		(to "find-tail-call-links")
;; «.find-pdflikedef-links»		(to "find-pdflikedef-links")
;; «.find-eev-video-record-links» 	(to "find-eev-video-record-links")
;; «.find-eev-create-tar-links»		(to "find-eev-create-tar-links")
;; «.find-screencast-links»		(to "find-screencast-links")
;; «.find-angg-upload-links»		(to "find-angg-upload-links")
;; «.find-blogme-upload-links»		(to "find-blogme-upload-links")
;; «.find-a2html-upload-links»		(to "find-a2html-upload-links")
;; «.find-escript-upload-links»		(to "find-escript-upload-links")
;; «.find-latex-upload-links»		(to "find-latex-upload-links")
;; «.find-book-links»			(to "find-book-links")
;; «.find-lua-links»			(to "find-lua-links")
;; «.find-scast-links»			(to "find-scast-links")
;; «.find-python-links»			(to "find-python-links")
;; «.find-fbc-links»			(to "find-fbc-links")
;; «.find-lualatex-links»		(to "find-lualatex-links")
;; «.find-dlualatex-links»		(to "find-dlualatex-links")
;; «.find-br-links»			(to "find-br-links")
;; «.find-pastebin-links»		(to "find-pastebin-links")
;; «.find-texlive-links»		(to "find-texlive-links")
;; «.find-matplotlib-links»		(to "find-matplotlib-links")
;; «.find-C-links»			(to "find-C-links")
;; «.find-luarocks-links»		(to "find-luarocks-links")
;; «.find-luarocks-src-links»		(to "find-luarocks-src-links")
;; «.find-math-b-links»			(to "find-math-b-links")
;; «.find-defcsprefix-links»		(to "find-defcsprefix-links")
;; «.find-debian-version-links»		(to "find-debian-version-links")
;; «.find-sound-debug-links»		(to "find-sound-debug-links")
;; «.find-bradytdd-links»		(to "find-bradytdd-links")
;; «.find-dednat4-convert-links»	(to "find-dednat4-convert-links")
;; «.find-psne-article-links»		(to "find-psne-article-links")
;; «.find-psne-arxiv-links»		(to "find-psne-arxiv-links")
;; «.find-book-grep-links»		(to "find-book-grep-links")
;; «.find-my-this-file-links»		(to "find-my-this-file-links")
;; «.find-ebook-convert-links»		(to "find-ebook-convert-links")
;; «.find-lilypond-links»		(to "find-lilypond-links")
;; «.find-latexgimp-links»		(to "find-latexgimp-links")
;; «.find-latexinkscape-links»		(to "find-latexinkscape-links")
;; «.find-latexscan-links»		(to "find-latexscan-links")
;; «.find-C2-aula-links»		(to "find-C2-aula-links")
;; «.find-C3-aula-links»		(to "find-C3-aula-links")
;; «.ee-template0-file»			(to "ee-template0-file")
;; «.find-CN-aula-links»		(to "find-CN-aula-links")
;; «.find-ssr-links»			(to "find-ssr-links")
;; «.find-obs-links»			(to "find-obs-links")
;; «.find-emacs-test-links»		(to "find-emacs-test-links")
;; «.find-vimeodl-links»		(to "find-vimeodl-links")
;; «.find-repl-lualatex-links»		(to "find-repl-lualatex-links")
;; «.find-classroom-trab-links»		(to "find-classroom-trab-links")
;; «.find-emacsdevel-links»		(to "find-emacsdevel-links")
;; «.find-helpgnuemacs-links»		(to "find-helpgnuemacs-links")
;; «.find-emacsorgmode-links»		(to "find-emacsorgmode-links")
;; «.find-vscan-links»			(to "find-vscan-links")
;; «.find-LATEXpdf-links»		(to "find-LATEXpdf-links")
;; «.find-pdfpages-links»		(to "find-pdfpages-links")
;; «.find-sshot-links»			(to "find-sshot-links")
;; «.find-eevvideopage-links»		(to "find-eevvideopage-links")
;; «.find-eevvideopage-linkss»		(to "find-eevvideopage-linkss")
;; «.eev-videos-data»			(to "eev-videos-data")
;; «.code-youtube»			(to "code-youtube")
;; «.find-fossil-update-srf-links»	(to "find-fossil-update-srf-links")
;; «.find-code-xxx-links»		(to "find-code-xxx-links")
;; «.code-eec-LATEX»			(to "code-eec-LATEX")
;; «.find-cp-angg-links»		(to "find-cp-angg-links")
;; «.find-eevshortvideo-links»		(to "find-eevshortvideo-links")
;; «.find-telegram-save-log-links»	(to "find-telegram-save-log-links")
;; «.find-build-for-arxiv-links»	(to "find-build-for-arxiv-links")
;; «.find-mygitrepo-links»		(to "find-mygitrepo-links")
;; «.find-rcirc-quick-links»		(to "find-rcirc-quick-links")
;; «.find-anggwget-links»		(to "find-anggwget-links")
;; «.find-find-angg-links»		(to "find-find-angg-links")
;; «.find-find-es-links»		(to "find-find-es-links")
;; «.find-maclanemoerdijk-links»	(to "find-maclanemoerdijk-links")
;; «.find-cwm-links»			(to "find-cwm-links")
;; «.find-emacs28-bisect-by-hand-links»	(to "find-emacs28-bisect-by-hand-links")
;; «.find-agda-links»			(to "find-agda-links")
;; «.find-agdafile-links»		(to "find-agdafile-links")
;; «.find-emodeline-links»		(to "find-emodeline-links")
;; «.find-fvwmdoc-links»		(to "find-fvwmdoc-links")
;; «.find-agdalatex-links»		(to "find-agdalatex-links")
;; «.find-fsbot-links»			(to "find-fsbot-links")
;; «.find-mvideo-links»			(to "find-mvideo-links")
;; «.find-princeurl-links»		(to "find-princeurl-links")
;; «.find-luademo-links»		(to "find-luademo-links")
;; «.find-emlua-links»			(to "find-emlua-links")
;; «.find-pict2elua-links»		(to "find-pict2elua-links")
;; «.find-pip3-links»			(to "find-pip3-links")
;; «.find-yttranscript-links»		(to "find-yttranscript-links")
;; «.find-maximaindex-links»		(to "find-maximaindex-links")
;; «.find-maximamsg-links»		(to "find-maximamsg-links")
;; «.find-maximamsg»			(to "find-maximamsg")
;; «.find-editeevsubtitles-links»	(to "find-editeevsubtitles-links")
;; «.find-stream-links»			(to "find-stream-links")




;; «ee-template»  (to ".ee-template")
;; «ee-template-expand»  (to ".ee-template-expand")
;; (find-efunction 'replace-regexp-in-string)
;; (find-elnode "Index" "* replace-regexp-in-string:")
;; (find-elnode "Search and Replace")
;; (find-elnode "Association Lists")
;; (cadr (assoc "b" '(("a" "AA") ("b" "CC") ("c" "CC"))))
;; (find-efunction 'find-psne-links)

;; Moved to:
;; (find-eev "eev-insert.el")
;; (find-eev "eev-insert.el" "ee-template")
' (defun ee-template (pairs template)
  (let ((f (lambda (match)
	     (or (cadr (assoc (match-string 1 match) pairs))
		 match))))
    (replace-regexp-in-string "{\\([^{}]+\\)}" f template 'fixedcase)))

;; Two demos:

' (ee-template
    '(("a" "AA") ("b" "CC") ("c" "CC"))
    "foo{a}bar{bla}poo{b}bletch")

' (ee-template
    '(("http" "https") ("a/b/" "foo/bar/") ("c" "index.html"))
"* (eepitch-shell)
mkdir -p $S/{http}/{a/b/}
cd       $S/{http}/{a/b/}
wget     '{http}://{a/b/}{c}'
echo     '{http}://{a/b/}{c}' >> ~/.psne.log")



;; «ee-match-data-replace»  (to ".ee-match-data-replace")
;; (find-efunction 'replace-string)
;; (find-efunction 'replace-regexp-in-string)
;; (find-elnode "Search and Replace" "replace-regexp-in-string")
;; (find-elnode "Entire Match Data")
;; (find-elnode "Saving Match Data")
;; (find-elnode "Replacing Match")
;; (find-efunction 'set-match-data)
;; (find-efunction 'match-data)
;;
(defun ee-match-data-pairs (start strings)
  (if strings
      (let* ((len (length (car strings)))
	     (end (+ start len)))
	`(,start ,end . ,(ee-match-data-pairs end (cdr strings))))))

(defun ee-match-data-replace (strings replacement)
  (save-match-data
    (let* ((subj (apply 'concat strings))
	   (pairs (ee-match-data-pairs 0 strings)))
      (set-match-data `(0 ,(length subj) . ,pairs))
      (replace-match replacement 'fixedcase nil subj))))

;; Tests:
' (progn
    (string-match "<\\([a-z]+\\)_\\([a-z]+\\)>" "a<bc_def>g" 0)
    (match-data))
;;  --> (1 9  2 4  5 8)
' (ee-match-data-pairs 0 '("bc" "def"))
;;  -->      (0 2  2 5)
' (ee-match-data-replace '("bc" "def") "<\\1_\\2>")
;;  --> "<bc_def>"





;; «find-edrx-update-links»  (to ".find-edrx-update-links")
;; 2007dec27: new function, still dirty...
;; (find-edrx-update-links)
;; Based on:         (find-eev-update-links)
;;   (find-efunction 'find-eev-update-links)
(defun find-edrx-update-links (&rest rest)
  (interactive)
  (apply 'find-elinks `(
    (find-edrx-update-links ,@rest)
    (find-efunction 'find-edrx-update-links)
    ""
    ,(format "* (eepitch-shell)")
    ,(format "cd")
    ,(format "mv -v edrx.tgz edrx-old.tgz")
    ,(format "wget http://angg.twu.net/edrx.tgz")
    ,(format "tar -xvzf edrx.tgz")
    ""
    (find-es "emacs" "emacs-from-cvs")
    (find-es "lua5" "install-5.1.2")
    (find-es "lua5" "install-5.1.2" "mkdir")
    (find-es "lua5" "install-5.1.2" "cp -iv lua  ~/bin/lua51")
    (find-es "lua5" "lpeg-0.7")
    ) rest))






;; «find-qtdemo-links»  (to ".find-qtdemo-links")
;; (find-qtdemo-links)
(defun find-qtdemo-links (&optional name &rest rest)
  (interactive)
  (setq name (or name "{qtdemo}"))
  (find-elinks
   `((find-qtdemo-links ,name ,@rest)
     (find-angg ".emacs.templates" "find-qtdemo-links")
     (find-angg ".emacs" "qt")
     (find-qtprogrammingw3m "toc.html")
     (find-qt4docfile "")
     (find-es "qt")
     ""
     ,(ee-template
      `(("qtdemo" ,name))
      "#*
rm -Rv /tmp/{qtdemo}/
mkdir  /tmp/{qtdemo}/
cd     /tmp/{qtdemo}/
cat > {qtdemo}.pro <<'%%%'
TEMPLATE = app
CONFIG   += qt warn_on
HEADERS  =
SOURCES  = main.cpp
TARGET   = {qtdemo}
QTDIR_build:REQUIRES=\"contains(QT_CONFIG, small-config)\"
%%%

cat > main.cpp <<'%%%'
#include <QApplication>
#include <QPushButton>
int main(int argc, char *argv[]) {
  QApplication app(argc, argv);
  QPushButton hello(\"Hello world!\");
  hello.resize(100, 30);
  hello.show();
  return app.exec();
}
%%%

qmake-qt4 -project
qmake-qt4 {qtdemo}.pro
make CXX=\"gcc -g\" |& tee om

#*"))))



;; «find-dn4tex-links»  (to ".find-dn4tex-links")
;; (find-angg ".emacs" "find-dn4tex-links")
;; (define-key eev-mode-map "\M-h\M-u" 'find-dn4tex-links)
;; Test:
;; (find-dn4tex-links)
;;
(defun find-dn4tex-links (&optional stem &rest rest)
  "Visit a temporary buffer containing hyperlinks for dn4tex."
  (interactive)
  (setq stem (or stem "{stem}"))
  (apply 'find-elinks `(
    (find-dn4tex-links ,stem ,@rest)
    ;; ""
    ,(ee-template0 "\
# (kill-new \"  LATEX/{stem}.tex\\n\")
# (find-blogme3file \"anggmake.lua\" \"LATEX/\")
# (wrobak 2 ' (find-angg \"LATEX/{stem}.tex\"))

% (find-angg \"LATEX/{stem}.tex\")
% (find-dn4ex \"edrx08.sty\")
% (find-angg \".emacs.templates\" \"s2008a\")
% (defun c () (interactive) (find-zsh \"cd ~/LATEX/ && ~/dednat4/dednat41 {stem}.tex && latex    {stem}.tex\"))
% (defun c () (interactive) (find-zsh \"cd ~/LATEX/ && ~/dednat4/dednat41 {stem}.tex && pdflatex {stem}.tex\"))
% (eev \"cd ~/LATEX/ && Scp {stem}.{<}dvi,pdf{>} edrx@angg.twu.net:slow_html/LATEX/\")
% (defun d () (interactive) (find-dvipage \"~/LATEX/{stem}.dvi\"))
% (find-dvipage \"~/LATEX/{stem}.dvi\")
% (find-pspage  \"~/LATEX/{stem}.ps\")
% (find-pspage  \"~/LATEX/{stem}.pdf\")
% (find-xpdfpage \"~/LATEX/{stem}.pdf\")
% (find-zsh0 \"cd ~/LATEX/ && dvipdf         {stem}.dvi {stem}.pdf\")
% (find-zsh0 \"cd ~/LATEX/ && dvips -D 300 -o {stem}.ps {stem}.dvi\")
% (find-zsh0 \"cd ~/LATEX/ && dvips -D 600 -P pk -o {stem}.ps {stem}.dvi && ps2pdf {stem}.ps {stem}.pdf\")
% (find-zsh0 \"cd ~/LATEX/ && dvips -D 300 -o tmp.ps tmp.dvi\")
% (find-pspage  \"~/LATEX/tmp.ps\")
% (ee-cp \"~/LATEX/{stem}.pdf\" (ee-twupfile \"LATEX/{stem}.pdf\") 'over)
% (ee-cp \"~/LATEX/{stem}.pdf\" (ee-twusfile \"LATEX/{stem}.pdf\") 'over)
% (find-twusfile     \"LATEX/\" \"{stem}\")
% http://angg.twu.net/LATEX/{stem}.pdf")
    ;;
    "\\documentclass[oneside]{book}
\\usepackage[latin1]{inputenc}
\\usepackage{edrx08}       % (find-dn4ex \"edrx08.sty\")
%L process \"edrx08.sty\"  -- (find-dn4ex \"edrx08.sty\")
\\input edrxheadfoot.tex   % (find-dn4ex \"edrxheadfoot.tex\")
\\begin{document}\n
\\input {stem}.dnt\n
%*
% (eedn4-51-bounded)\n
Index of the slides:
\\msk
% To update the list of slides uncomment this line:
%\\makelos{tmp.los}
% then rerun LaTeX on this file, and insert the contents of \"tmp.los\"
% below, by hand (i.e., with \"insert-file\"):
% (find-fline \"tmp.los\")
% (insert-file \"tmp.los\")\n
%*\n
\\end{document}\n
% L\157cal Variables:
% coding:           raw-text-unix
% ee-anchor-format: \"«%s»\"
% End:\n"
    ) rest))




;; «find-beamer-links» (to ".find-beamer-links")
;; (find-find-links-links "{k}" "beamer" "stem")
;; A test: (find-beamer-links ___)

(defun find-beamer-links (&optional stem &rest pos-spec-list)
"Visit a temporary buffer containing hyperlinks for foo."
  (interactive)
  (setq stem (or stem "{stem}"))
  (let* ((bigstr0 (ee-read-file "~/LATEX/beamer-template.tex"))
	 (bigstr1 (replace-regexp-in-string "BSTEM" stem bigstr0 'fixedcase)))
    (apply 'find-elinks
     `((find-beamer-links ,stem ,@pos-spec-list)
       ;; Convention: the first sexp always regenerates the buffer.
       (find-efunction 'find-beamer-links)
       ""
       ,bigstr1
       )
     pos-spec-list)))

;; Test: (find-beamer-links "2099-foo")





;; «s2008a»  (to ".s2008a")
;; (find-angg ".emacs.templates" "s2008a")
;; Used to create section headers for some LaTeX files.
;; (find-LATEX "2008comprcat.tex")
;; (defalias 's 's2008a)
;; Example:
' (eesteps '(
    (find-estring (format "%% %S\n" '(s2008a "Slide: foo bar" "foo-bar")))
    "M-e"))

(defun ee-delete-and-extract-this-line (&optional adjust)
  (ee-no-trailing-nl
   (ee-no-properties
    (ee-delete-and-extract-line adjust))))

(defun mysection (sectioncommand spaces title tag)
  (insert (ee-template
   `(("_section" ,sectioncommand)
     (" "         ,spaces)
     ("title"     ,title)
     ("tag"       ,tag)
     ("line"      ,(ee-delete-and-extract-this-line))) "\
% { }«.{tag}»	(to \"{tag}\")
% --------------------
% «{tag}»  (to \".{tag}\")
{line}
{_section} {{title}} {{tag}}
")))

(defun slide  (title tag) (mysection "\\\\myslide"      ""     title tag))
(defun chap   (title tag) (mysection "\\\\mychapter"    ""     title tag))
(defun sec    (title tag) (mysection "\\\\mysection"    "  "   title tag))
(defun subsec (title tag) (mysection "\\\\mysubsection" "    " title tag))

;; (mysection "\\\\section" "  " "Foo Bar" "foo-bar")
;; (chap "Foo bar" "foo-bar")

(defalias 's2008a 'sec)
(defalias 's      'slide)
(defalias 'sec2008a 'sec)
(defalias 'chap2008a 'chap)




;; «find-blogme3-links»  (to ".find-blogme3-links")
;; Test: (find-blogme3-links)
;; (find-efunction 'find-find-links-links)
;; (find-efunction 'find-dn4tex-links)
;; (find-efunction 'blogme3-footer)
;; (find-efunction 'blogme3-lisp)
;; (find-find-links-links "blogme3")
;;
(defun find-blogme3-links (&optional stem &rest rest)
  "Visit a temporary buffer containing hyperlinks for blogme3."
  (interactive)
  (setq stem (or stem "{stem}"))
  (apply 'find-elinks `(
    (find-blogme3-links ,stem ,@rest)
    (find-efunction 'find-blogme3-links)
    (find-blogme3-curso-links)
    (find-blogme3file "blogme3.el")
    (find-blogme3file "")
    ""
    (kill-new ,stem)
    (find-blogme3 "anggmake.lua" "blogmestems")
    (find-TH ,stem)
    (ee-copy-rest 1 '(find-TH ,stem))
    ;; (wrobak 2 ' (find-TH ,stem))
    ;;
    ,(ee-template0 "
\[INCLUDE TH/speedbar.blogme]
\[SETFAVICON dednat4/dednat4-icon.png]
\[SETFAVICON IMAGES/forthsun.png]
\[# 
\(defun c () (interactive) (find-blogme3-sh0-if \"{stem}\"))
\(defun u () (interactive) (find-blogme-upload-links \"{stem}\"))
;;    http://angg.twu.net/{stem}.html
;; file:///home/edrx/TH/L/{stem}.html
#]
\[lua:
  require \"defs-2022\"    -- (find-blogme3 \"defs-2022.lua\")
]
\[SETHEADSTYLE [LUCIDA]]
\[htmlize [J (Title)]\n
]
\[#
 # Local Variables:
 # coding: raw-text-unix
 # modes: (fundamental-mode blogme-mode)
 # End:
#]")
    ) rest))



;; «find-blogme3-curso-links» (to ".find-blogme3-curso-links")
;; Test: (find-blogme3-curso-links)
;; Test: (find-blogme3-curso-links "2017" "2" "GA" "2017.1")
;; Test: (find-blogme3-curso-links "2017" "2" "C2" "2017.1")
;; Test: (find-blogme3-curso-links "2017" "2" "LA" "2017.1")
;; Test: (find-blogme3-curso-links "2020" "1" "C2" "2019.2")
;; Test: (find-blogme3-curso-links "2020" "1" "C3" "2019.2")
;; Test: (find-blogme3-curso-links "2020" "2" "C2" "2020.1")
;; Test: (find-blogme3-curso-links "2020" "2" "C3" "2020.1")
;;
(defun find-blogme3-curso-links (&optional year sem name prevsem &rest pos-spec-list)
  "Visit a temporary buffer containing hyperlinks for blogme3."
  (interactive)
  (setq year (or year "{year}"))
  (setq sem (or sem "{sem}"))
  (setq name (or name "{name}"))
  (setq prevsem (or prevsem "{prevsem}"))
  (let ((stem (format "%s.%s-%s" year sem name)))
    (apply 'find-elinks `(
      (find-blogme3-curso-links ,year ,sem ,name ,prevsem ,@pos-spec-list)
      (find-efunction 'find-blogme3-curso-links)
      ""
      (kill-new ,stem)
      (find-blogme3 "anggmake.lua" "blogmestems")
      (find-blogme3 "anggmake.lua" "blogmestems" "2017.1-LA")
      (find-TH ,stem)
      ""
      ,(ee-template0 "
# Create directories and makefiles

* (eepitch-shell)
* (eepitch-kill)
* (eepitch-shell)
mkdir   ~/{year}.{sem}-{name}/
cp -iv  ~/{prevsem}-{name}/Makefile ~/{year}.{sem}-{name}/
# (find-2b '(find-angg \"{prevsem}-{name}/Makefile\") '(find-angg \"{year}.{sem}-{name}/Makefile\"))
# (find-fline \"~/{year}.{sem}-{name}/Makefile\")

# (kill-new               \"{stem}\")
# (find-THfile \"Makefile\" \"2019.1-TD\")
# (kill-new                    \"\\n  {stem}/Makefile\")
# (find-blogme3file \"anggmake.lua\" \"2019.1-TD/Makefile\")

* (eepitch-Twu)
* (eepitch-kill)
* (eepitch-Twu)
mkdir ~/public_html/{year}.{sem}-{name}/
mkdir   ~/slow_html/{year}.{sem}-{name}/

# Create ___-material.tex:
# (find-lualatex-links \"{year}-{sem}-{name}-material\")

# Create {year}.{sem}.blogme:
# (find-2a '(find-TH \"{prevsem}\") '(find-TH \"{year}.{sem}\"))

# Adjust {stem}.blogme:
# (find-2a '(find-TH \"{prevsem}-{name}\") '(find-TH \"{stem}\"))



# Create {stem}.blogme:
# (ee-copy-rest 1 '(find-TH \"{stem}\"))

\[INCLUDE TH/speedbar.blogme]
\[SETFAVICON dednat4/dednat4-icon.png]
\[SETFAVICON IMAGES/forthsun.png]
\[# 
\(defun c () (interactive) (find-blogme3-sh0-if \"{stem}\"))
\(defun u () (interactive) (find-blogme-upload-links \"{stem}\"))
;;    http://angg.twu.net/{stem}.html
;; file:///home/edrx/TH/L/{stem}.html
;; (find-curso-links \"{year}\" \"{sem}\" \"{name}\" \"78\")
;;
;; (find-fline     \"~/{stem}/\")
;; (find-pdf-page  \"~/{stem}/{stem}.pdf\")
;; (find-sh0 \"cp -v ~/{stem}/{stem}.pdf /tmp/\")

#]
\[lua: LR = R ]
\[htmlize [J {name} {year}.{sem} - Eduardo Ochs]\n

\[P [R {year}.{sem}.html Salas, horários, etc]
\[BR] [R {prevsem}-{name}.html Página do semestre anterior]
\]

\[BE'
PDFs com todos os quadros:
http://angg.twu.net/{stem}/{stem}.pdf (este semestre)
http://angg.twu.net/{prevsem}-{name}/{prevsem}-{name}.pdf (semestre anterior)
Material para exercícios:
http://angg.twu.net/LATEX/{year}-{sem}-{name}-material.pdf (este semestre)
http://angg.twu.net/LATEX/{year}-{sem}-{name}-material.pdf (semestre anterior)

Fotos dos quadros:
\(ainda não\)
\]

\[#
Alunos:
#]

]
\[#
 # Local Variables:
 # coding: raw-text-unix
 # modes: (fundamental-mode blogme-mode)
 # End:
#]")
      ) pos-spec-list)))



;; «find-curso-links» (to ".find-curso-links")

(defun find-curso-links (&optional year sem name nlines variants &rest pos-spec-list)
"Visit a temporary buffer containing hyperlinks for foo."
  (interactive)
  (setq year     (or year "{year}"))
  (setq sem      (or sem "{sem}"))
  (setq name     (or name "{name}"))
  (setq nlines   (or nlines "{nlines}"))
  (setq variants (or variants ""))
  (apply 'find-elinks
   `((find-curso-links ,year ,sem ,name ,nlines ,@pos-spec-list)
     (find-curso-links "2016" "2" "GA" "20" ,@pos-spec-list)
     ;; Convention: the first sexp always regenerates the buffer.
     (find-efunction 'find-curso-links)
     ""
     ,(ee-find-curso-script year sem name nlines variants)
;;      ,(ee-template0 "\
;; ")
     )
   pos-spec-list))

;; (find-estring (ee-find-curso-script "2016" "1" "GA" "20"))
;;
(defun ee-find-curso-script (year sem name nlines variants)
  "Return a list of sexps and strings for curso.
This is an internal function used by `find-curso-links'."
  (ee-template0 "\
# Adjust nlines:
# (find-2a nil '(find-TH \"{year}.{sem}-{name}\"))
# (eek          \"M-o M-> {nlines}*<up> M-o\")

# (find-angg     \"{year}.{sem}-{name}/\")
# (find-twusfile \"{year}.{sem}-{name}/\")
# (find-fline    \"/tmp/\")

* (eepitch-shell)
* (eepitch-kill)
* (eepitch-shell)
cd /tmp/
# sudo chmod -v 644 {year}*{name}*.jpg
       chmod -v 644 {year}*{name}*.jpg
A=($(ls {year}*{name}*.jpg))
print -l $A
for i in $A; do
  echo convert $i -rotate 0 -auto-orient $i
       convert $i -rotate 0 -auto-orient $i
done
# (find-fline \"/tmp/\")
cp -iv $A ~/{year}.{sem}-{name}/
cd        ~/{year}.{sem}-{name}/
for i in $A; do
  echo \"http://angg.twu.net/{year}.{sem}-{name}/$i\"
done |& tee /tmp/o.{name}
#
* (kill-new (find-sh00 \"cat /tmp/o.{name}\"))
* (find-2a nil '(find-TH \"{year}.{sem}-{name}\"))
* (eek \"M-o M-> {nlines}*<up> M-o\")
** Now run this with M-e: (eek \"M-o C-y M-o\")
**
cd /tmp/
A=($(ls {year}*{name}*.jpg))
print -l $A
cd ~/{year}.{sem}-{name}/
laf $A
{
Scp-np $A edrx@angg.twu.net:/home/edrx/slow_html/{year}.{sem}-{name}/
Scp-np $A edrx@angg.twu.net:/home/edrx/public_html/{year}.{sem}-{name}/
}
# (find-twusfile \"{year}.{sem}-{name}/\")

** Make djvus
* (eepitch-shell)
* (eepitch-kill)
* (eepitch-shell2)
cd ~/{year}.{sem}-{name}/
make pngs
make djvus
make {year}.{sem}-{name}.djvu
make {year}.{sem}-{name}.pdf
make pdfs
{
Scp-np {year}.{sem}-{name}{variants}.{<}djvu,pdf{>} edrx@angg.twu.net:/home/edrx/slow_html/{year}.{sem}-{name}/
Scp-np {year}.{sem}-{name}{variants}.{<}djvu,pdf{>} edrx@angg.twu.net:/home/edrx/public_html/{year}.{sem}-{name}/
}
# http://angg.twu.net/{year}.{sem}-{name}/{year}.{sem}-{name}.pdf

# (find-fline       \"~/{year}.{sem}-{name}/\")
# (find-djvupage    \"~/{year}.{sem}-{name}/{year}.{sem}-{name}.djvu\")
# (find-xpdfpage    \"~/{year}.{sem}-{name}/{year}.{sem}-{name}.pdf\")

** Update html
* (find-2a nil '(find-TH \"{year}.{sem}-{name}\"))
* (eek \"M-o C-x C-s M-o\")
*
* (eepitch-shell)
* (eepitch-kill)
* (eepitch-shell)
# makeR
# touch ~/TH/{year}.{sem}-{name}.blogme
makeR1     {year}.{sem}-{name}.html
Scp-np     {year}.{sem}-{name}.html      $TWUP/{year}.{sem}-{name}.html
# Scp-np  TH/{year}.{sem}-{name}.blogme $TWUP/TH/{year}.{sem}-{name}.blogme
#    http://angg.twu.net/{year}.{sem}-{name}.html
# file:///home/edrx/TH/R/{year}.{sem}-{name}.html
"))





;; «find-curso-makefile-links» (to ".find-curso-makefile-links")
;; (find-curso-makefile-links)

(defun find-curso-makefile-links (&optional year sem name &rest pos-spec-list)
"Visit a temporary buffer containing hyperlinks for foo."
  (interactive)
  (setq year (or year "{year}"))
  (setq sem (or sem "{sem}"))
  (setq name (or name "{name}"))
  (apply 'find-elinks
   `((find-curso-makefile-links ,year ,sem ,name ,@pos-spec-list)
     (find-curso-makefile-links "2016" "2" "GA")
     ;; Convention: the first sexp always regenerates the buffer.
     (find-efunction 'find-curso-makefile-links)
     ""
     ,(ee-template0 "\
# (kill-new \"  {year}.{sem}-{name}/Makefile\\n\")
# (find-blogme3file \"anggmake.lua\" \"2016.1-LA/Makefile\")

# (kill-new \"{year}.{sem}-{name}\")
# (find-THfile \"Makefile\" \"2016.2-LA\")

# (kill-new \"{year}.{sem}-{name}\")
# (find-twusfile \"\" \"2016.1-LA\")

# (mkdir \"~/{year}.{sem}-{name}/\")
# (ee-copy-rest 1 '(find-fline \"~/{year}.{sem}-{name}/Makefile\"))

# This file:    (find-angg \"{year}.{sem}-{name}/Makefile\")
# Based on:     (find-angg \"bin/djvuize\")
# Generated by: (find-angg \".emacs.templates\" \"find-curso-makefile-links\")

# (find-angg \"2014.2-GA/Makefile\")
# (find-angg \"SCANS/Makefile\")
# (find-node \"(make)Text Functions\")

THIS  = {year}.{sem}-{name}
PNGS  = $(patsubst %.jpg,%.png,$(wildcard *.jpg))
DJVUS = $(patsubst %.png,%.djvu,$(wildcard *.png))

# (find-angg \"bin/whiteboard\")
# (find-es \"gimp\" \"whiteboard\")
pngs_:
	echo $(PNGS)
pngs: $(PNGS)
%.png: %.jpg
	whiteboard $< $@

%.pgm: %.png
	convert $< $@
%.pbm: %.pgm
	mkbitmap -x -f 50 -t 0.4 $< -o $@
%.djvu: %.pbm
	cjb2 -lossy $< $@

djvus_:
	echo $(DJVUS)
djvus: $(DJVUS)

djvu: $(THIS).djvu
$(THIS).djvu: $(DJVUS)
	djvm -create $(THIS).djvu $(DJVUS)

pdf: $(THIS).pdf
%.pdf: %.djvu
	ddjvu -format=pdf $< $@
")
     )
   pos-spec-list))








;; «find-quadro-links» (to ".find-quadro-links")
;; (find-find-links-links "{k}" "quadro" "name yys")
;;
(defun find-quadro-links (&optional name yys &rest pos-spec-list)
"Visit a temporary buffer containing hyperlinks for foo."
  (interactive)
  (setq name (or name "{name}"))
  (setq yys (or yys "{yys}"))
  (apply 'find-elinks
   `((find-quadro-links ,name ,yys ,@pos-spec-list)
     (find-quadro-links "la" "172" ,@pos-spec-list)
     ;; Convention: the first sexp always regenerates the buffer.
     (find-efunction 'find-quadro-links)
     ""
     ,(ee-template0 "\
;; <{name}q{yys}>
\(defun {name}qe{yys} (&rest rest) (interactive) (apply 'find-angg \".emacs\" \"{name}q{yys}\" rest))
\(defun {name}qe    (&rest rest) (interactive) (apply '{name}qe{yys} rest))
;; ({name}q{yys}  1 \"201708xx\" \"\")
")
     )
   pos-spec-list))

;; Test: (find-quadro-links)






;; «find-baudio-links» (to ".find-baudio-links")
;; Test: (find-baudio-links)
;; Test: (find-baudio-links nil "2013dec-EP")
;; (find-find-links-links "baudio")
;;
(defun find-baudio-links (&optional dir/ stem &rest rest)
  "Visit a temporary buffer containing hyperlinks for blogme3."
  (interactive)
  (setq dir/ (or dir/ "audios/"))
  (setq stem (or stem "{stem}"))
  (apply 'find-elinks `(
    (find-baudio-links ,dir/ ,stem ,@rest)
    (find-2a '(find-twusfile "audios/") '(find-twupfile "audios/"))
    ;; (eev ,(format "Scp ~/audios/%s.mp3 $TWUS/audios/%s.mp3" stem stem))
    ""
    (find-angg ".emacs.audios" ,stem)
    ;; (find-blogme3file "blogme3.el")
    ;; (find-blogme3file "")
    ;;
    ,(ee-template0 "\
;; <{stem}>
;; (find-TH \"audios/{stem}\")
;; (find-fline \"~/audios/\")
;; (find-fline \"~/audios/\" \"{stem}.mp3\")
;; (find-audio \"~/audios/{stem}.mp3\")
\(code-audio \"{stem}\" \"~/audios/{stem}.mp3\")
;; (find-{stem} \"0:00\")
;; (find-{stem} t)
;; (eev-avadj-mode 1)
")
    ;;
    (kill-new                 ,(format "audios/%s" stem))
    (find-blogme3 "anggmake.lua" "blogmestems" "audios/")
    (find-TH                  ,(format "audios/%s" stem))
    (ee-copy-rest 1 '(find-TH ,(format "audios/%s" stem)))
    ;;
    ,(ee-template0 "
\[INCLUDE TH/speedbar.blogme]
\[SETFAVICON dednat4/dednat4-icon.png]
\[SETFAVICON IMAGES/forthsun.png]
\[# 
\(defun c () (interactive) (find-blogme3-sh0-if      \"audios/{stem}\"))
\(defun u () (interactive) (find-blogme-upload-links \"audios/{stem}\"))
;;    http://angg.twu.net/audios/{stem}.html
;; file:///home/edrx/TH/L/audios/{stem}.html
;; (find-sh0    \"cp -lv ~/audios/{stem}.mp3 ~/TH/L/audios/\")
;; (find-angg   \".emacs.audios\" \"{stem}\")
;; (find-blogme3 \"anggdefs.lua\" \"html5-audio\")
#]
\[lua: LR = R ]
\[htmlizetxt [J {stem}]

\[AUDIO_INDEX {stem}.mp3
0:00
]

\[BE'
# Pra baixar uma copia local:
wget http://angg.twu.net/audios/{stem}.mp3
wget http://angg.twu.net/audios/{stem}.html
# Veja:
# http://angg.twu.net/ferramentas-para-ativistas.html#audios
# http://angg.twu.net/ferramentas-para-ativistas.html#audios-copias-locais
]

]
\[#
 # Local Variables:
 # coding: raw-text-unix
 # modes: (fundamental-mode blogme-mode)
 # End:
#]")
    ) rest))






;; «bsec»  (to ".bsec")
;; (find-THfile "monep.blogme" "defun bsec")
;; (find-blogme3grep "grep -nH -e sec *.lua")
;; (find-blogme3 "anggdefs.lua" "readqline" "sec")
;; (bsec "{tag}" "{H}" "{title}")
;; (bsec "foo" "H2" "Foo Bar")

(defun ee-bsec-string (tag H title)
  (ee-template0 "\
\[br ----------------------------------------]\n
\[#
 # «.{tag}»		(to \"{tag}\")
 # (bsec \"{tag}\" \"{H}\" \"{title}\")
#]
\[sec «{tag}» (to \".{tag}\")
  {H} [++N]. {title}]
"))

;; (defun bsec (tag H title)
;;   (ee-delete-and-extract-line)
;;   (insert (ee-bsec-string tag H title)))

;; (find-efunction 'bsec)
;; (find-efunction 'eewrap-audiovideo)
(defun bsec (&optional tag H title)
  (interactive)
  (if (not tag)
      (ee-this-line-wrapn 3 'ee-bsec-string)
    (ee-this-line-extract)
    (insert (ee-bsec-string tag H title))))


;; «ee-bsec» (to ".ee-bsec")
;; 2017abr14
;; Typical usage: (find-THfile "luatex.blogme" "defun bsec")
;; A test: (find-estring (ee-bsec "ebl-2017" "H2" "IPL For Children and"))
(defun ee-bsec (tag h head)
  (ee-template0 "
\[br ----------------------------------------]

\[#
 # «.{tag}»\t\t(to \"{tag}\")
 # {(format \"%S\" `(bsec ,tag ,h ,head))}
 #]
\[sec «{tag}» (to \".{tag}\")
  {h} [++N]. {head}]
"))





;; «ee-mkdl»  (to ".ee-mkdl")
;; «find-mkdl»  (to ".find-mkdl")
;; (find-dn4 "Makefile.base")
;; Make a download block for my makefiles
;; (find-efunction 'eeurl-u-to-f)
;; (find-efunction 'ee-template)
;; (find-estring (ee-mkdl "FOO" "http://foo.org/bar/plic.tgz"))
;; (find-mkdl "STEM" "http://foo/bar/plic.tgz")

(defun find-mkdl (STEM url)
  (interactive (list "STEM" "http://foo/bar/plic.tgz"))
  (find-elinks `((find-mkdl ,STEM ,url) nil ,(ee-mkdl STEM url))))

(defun ee-mkdl (STEM url)
  (let* ((localurl (replace-regexp-in-string
		    "^\\(https?\\|ftp\\)://" "\\1/" url))
	 (localurldir (file-name-directory localurl)))
    (ee-template
     `(("http://www.foo.org/bar/plic.tgz" ,url)
       (  "http/www.foo.org/bar/plic.tgz" ,localurl)
       (  "http/www.foo.org/bar/"         ,localurldir)
       ("STEM" ,STEM)
       ("stem" ,(downcase STEM))) "\
{STEM}URL    =    {http://www.foo.org/bar/plic.tgz}
{STEM}TGZ    = $(S)/{http/www.foo.org/bar/plic.tgz}
{STEM}TGZDIR = $(S)/{http/www.foo.org/bar/}

{stem}download: $({STEM}TGZ)
$({STEM}TGZ):
	mkdir -p $({STEM}TGZDIR)
	cd       $({STEM}TGZDIR) && \\
	$(wget)  $({STEM}URL)
")))



;; «ee-ps2pdf-script»  (to ".ee-ps2pdf-script")
;; (find-efunctiondescr 'ee-template)
;; (ee-ps2pdf-script "$S/http/foo/" "stem" ".ps.gz")
(defun ee-ps2pdf-script (dir stem ext)
  (ee-template
   `(("$S/http/foo/" ,dir) ("stem" ,stem) (".ps.gz" ,ext))
   "cd {$S/http/foo/} && zcat {stem}{.ps.gz} | ps2pdf - {stem}.pdf"))



;; «class»  (to ".class")
;; For: (find-dn6 "eoo.lua")
;; See: (find-dn6 "eoo.lua" "Vector")
;;      (find-dn6 "eoo.lua" "Vector" "Vector = Class {")
;; Usage: if the point is on a line that says just "FooBar" and you type
;; `M-x class' then that line will be converted into these five lines:
;;
;;   FooBar = Class {
;;     type    = "FooBar",
;;     __index = {
;;     },
;;   }
;;
;; (find-angg "LUA/canvas2.lua" "Class")
;; (find-efunction 'ee-delete-and-extract-line)
;; (find-eev "eev-wrap.el" "ee-this-line-wrapn")
;; (find-eewrap-links "{C}" "class" "str")
(defalias 'class 'eewrap-class)

(defun  eewrap-class () (interactive)
  (ee-this-line-wrapn 1 'ee-wrap-class))
(defun ee-wrap-class (Name)
  "An internal function used by `eewrap-class'."
  (ee-template0 "\
{Name} = Class {<}
  type    = \"{Name}\",
  __index = {<}
  {>},
{>}
"))




;; «bname»  (to ".bname")
;;
(defun bname () (interactive)
  (let ((str (ee-no-trailing-nl
	      (ee-no-properties
	       (ee-delete-and-extract-line 1)))))
    (insert (format "\
\[# «%s»  (to \".%s\")
 # «.%s»\t\t(to \"%s\")
#\]
\[NAME %s\]" str str str str str))))




;; «find-scp-links»  (to ".find-scp-links")
;; (find-scp-links)
;;
(defun find-scp-links (&optional user addr &rest rest)
  "Visit a temporary buffer containing hyperlinks for scp."
  (interactive)
  (setq user (or user "{user}"))
  (setq addr (or addr "{addr}"))
  (apply 'find-elinks `(
    (find-scp-links ,user ,addr ,@rest)
    (find-fline "/etc/hosts" ,addr)
    ""
    ,(ee-template `(user addr) "\
\(defun eepitch-{addr} () (interactive)
  (eepitch '(find-comintprocess \"ssh {addr}\" \"ssh {user}@{addr}\")))

\(code-c-d \"{addr}\" \"/scp:{user}@{addr}:\")

;; (find-{addr}file \"\")
* (eepitch-{addr})
* (eepitch-kill)
* (eepitch-{addr})")
    ) rest))



;; «find-gigapedia-links»  (to ".find-gigapedia-links")
;; (define-key eev-mode-map "\M-G" 'find-gigapedia-links)
;; Deleted.






;; «find-dn5-file-links»  (to ".find-dn5-file-links")
;; (find-find-links-links "dn5-file" "stem")
;; (find-dn5-file-links)
;;
(defun find-dn5-file-links (&optional c stem ext &rest rest)
  (interactive)
  (setq c    (or c    "--"))
  (setq stem (or stem "{stem}"))
  (setq ext  (or ext  ".lua"))
  (apply 'find-elinks `(
    (find-dn5-file-links ,c ,stem ,ext ,@rest)
    (find-dn5-file-links "--" ,stem ".lua" ,@rest)
    (find-dn5-file-links "%" ,stem ".tex" ,@rest)
    ,(ee-template `(c stem ext) "\
{c} (kill-new \"  dednat5/{stem}{ext}\")
{c} (find-blogme3file \"anggmake.lua\" \"dednat5/\" \"\\n\")
{c} (find-dn5file \"{stem}{ext}\")

{c} {stem}{ext}:
{c} This file:
{c}   http://angg.twu.net/dednat5/{stem}{ext}.html
{c}   http://angg.twu.net/dednat5/{stem}{ext}
{c}                    (find-dn5 \"{stem}{ext}\")
{c} Author: Eduardo Ochs <eduardoochs@gmail.com>
{c} Version: 2011feb27?
{c} License: GPL3
{c}

require \"eoo\"         -- (find-dn5 \"eoo.lua\")

{c} dump-to: tests
{c}[==[
{c}]==]

{c} Local Variables:
{c} coding:             raw-text-unix
{c} ee-anchor-format:   \"«%s»\"
{c} End:
")
    ) rest))

;; (find-dn5-file-links)

;; (find-dn5file "")
;; (find-dn5-file-links "prefixes")
;; (find-dn5-file-links "process")
;; (find-dn5-file-links "trees")
;; (find-dn5-file-links "diags")
;; (find-dn5-file-links "common")
;; (find-dn5file "common.lua")
;; (find-dn5file "prefixes.lua")
;; (find-dn5file "process.lua")
;; (find-dn5file "trees.lua")
;; (find-dn5file "diags.lua")

;; (find-dn5file "parse.lua")
;; (find-dn5file "trees.lua")





;; «find-blogme4-file-links»  (to ".find-blogme4-file-links")

;; (find-find-links-links "blogme4-file" "stem")
;; (find-blogme4-file-links)
;;
(defun find-blogme4-file-links (&optional c stem ext &rest rest)
  (interactive)
  (setq c    (or c    "--"))
  (setq stem (or stem "{stem}"))
  (setq ext  (or ext  ".lua"))
  (apply 'find-elinks `(
    (find-blogme4-file-links ,c ,stem ,ext ,@rest)
    (find-blogme4-file-links "--" ,stem ".lua" ,@rest)
    (find-blogme4-file-links "%" ,stem ".tex" ,@rest)
    ,(ee-template `(c stem ext) "\
{c} (kill-new \"  blogme4/{stem}{ext}\")
{c} (find-blogme3file \"anggmake.lua\" \"blogme4/\" \"\\n\")
{c} (find-blogme4file \"{stem}{ext}\")

{c} {stem}{ext}:
{c} This file:
{c}   http://angg.twu.net/blogme4/{stem}{ext}.html
{c}   http://angg.twu.net/blogme4/{stem}{ext}
{c}                    (find-blogme4 \"{stem}{ext}\")
{c} Author: Eduardo Ochs <eduardoochs@gmail.com>
{c} Version: 2011jun02?
{c} License: GPL3
{c}

require \"eoo\"         -- (find-blogme4 \"eoo.lua\")

{c} dump-to: tests
{c}[==[
{c}]==]

{c} Local Variables:
{c} coding:             raw-text-unix
{c} ee-anchor-format:   \"«%s»\"
{c} End:
")
    ) rest))

;; (find-blogme4-file-links)

;; (find-blogme4file "")
;; (find-blogme4-file-links "prefixes")
;; (find-blogme4-file-links "process")
;; (find-blogme4-file-links "trees")
;; (find-blogme4-file-links "diags")
;; (find-blogme4-file-links "common")
;; (find-blogme4file "common.lua")
;; (find-blogme4file "prefixes.lua")
;; (find-blogme4file "process.lua")
;; (find-blogme4file "trees.lua")
;; (find-blogme4file "diags.lua")

;; (find-blogme4file "parse.lua")
;; (find-blogme4file "trees.lua")






;; (find-scan-links)
(defun find-scan-links (&optional dir &rest rest)
  "Visit a temporary buffer containing hyperlinks for scan."
  (interactive)
  (setq dir (or dir "/tmp/scans/"))
  (apply 'find-elinks `(
    ;; Convention: the first sexp always regenerates the buffer.
    (find-scan-links ,dir ,@rest)
    (find-scan-links "~/SCANS/foo/" ,@rest)
    (find-fline "~/SCANS/")
    ,(ee-expand dir)
    ;; Body:
    ""
    ,(ee-template0 "\
* (eepitch-shell)
* (eepitch-kill)
* (eepitch-shell)
mkdir {dir}
cd    {dir}
sudo xsane &
# (find-fline \"{dir}\")
# (find-xzgv  \"{dir}\")
# (find-fline \"~/SCANS/Makefile\")
make -f ~/SCANS/Makefile djvu600s
make -f ~/SCANS/Makefile all.djvu
make -f ~/SCANS/Makefile all.pdf
# (find-djvupage \"{dir}all.djvu\")
# (find-xpdfpage \"{dir}all.pdf\")

* (eepitch-eshell)
cd {dir}
cp -v all.djvu (ee-twusfile \"SCANS/\")
cp -v all.pdf  (ee-twusfile \"SCANS/\")

* (eepitch-lua51)
* (eepitch-kill)
* (eepitch-lua51)
for i=166,210,2 do
  s = format(\"%04d\", i)
  printf(\"convert %s.jpg -rotate 180 %sr.jpg; mv -v %sr.jpg %s.jpg\\n\",
    s, s, s, s)
end
")
    ) rest))

;; (find-scan-links)




;; «find-dhmake-links»  (to ".find-dhmake-links")

;;;      _ _                     _        
;;;   __| | |__  _ __ ___   __ _| | _____ 
;;;  / _` | '_ \| '_ ` _ \ / _` | |/ / _ \
;;; | (_| | | | | | | | | | (_| |   <  __/
;;;  \__,_|_| |_|_| |_| |_|\__,_|_|\_\___|
;;;                                       
;; «find-dhmake-links»  (to ".find-dhmake-links")
;;
;; Some templates for generating ".deb"s.
;; If you want to build a .deb for a package called, say, "foo-bar",
;; these scripts will use the directory "~/usrc/foo-bar/foo-bar_xxx/"
;; to build it - that directory will be recreated from scratch each
;; time - and the "override files for dhmake" will be taken from the
;; directory "~/foo-bar/". At this moment these paths are hardcoded.
;;
;; I generate the 3 main packages at
;;   http://angg.twu.net/debian/
;;   http://angg.twu.net/debian/README.html
;; with these commands:
;;   (find-dhmake-links "eev" "eevbuild")
;;   (find-dhmake-links "eev-puro" "eevpuro")
;;   (find-dhmake-links "eev-lua-extras" "eevluaextras")

(defvar ee-dhmake-fullname "Eduardo Ochs")
(defvar ee-dhmake-email "eduardoochs@gmail.com")

;; (find-estring-elisp (ee-dhmake-codecds "eev-puro" "eevpuro" "20120305"))
;;
(defun ee-dhmake-codecds (stem c date)
  (ee-template '(stem c date) "\
;; Generated by:
;; (ee-dhmake-codecds \"{stem}\" \"{c}\" \"{date}\")
;;
\(code-c-d \"{c}dh\"  \"~/{stem}/\")
\(code-c-d \"{c}dhd\" \"~/{stem}/debian/\")
\(code-c-d \"{c}\"    \"~/usrc/{stem}/{stem}-0.1.{date}/\")
\(code-c-d \"{c}d\"   \"~/usrc/{stem}/{stem}-0.1.{date}/debian/\")
\(code-c-d \"{c}dd\"  \"~/usrc/{stem}/{stem}-0.1.{date}/debian/{stem}/\")
\(code-c-d \"{c}unp\" \"~/usrc/{stem}/{stem}-unpacked/\")
;; (find-{c}dhfile  \"\")
;; (find-{c}dhdfile \"\")
;; (find-{c}file    \"\")
;; (find-{c}dfile   \"\")
;; (find-{c}ddfile  \"\")
;; (find-{c}unpfile \"\")
;; (find-{c}dsh   \"find * | sort\")
;; (find-{c}ddsh  \"find * | sort\")
;; (find-{c}unpsh \"find * | sort\")
;; (find-status   \"{stem}-deb\")
;; (find-vldifile \"{stem}-deb.list\")
;; (find-udfile   \"{stem}-deb-puro/\")"))

;; (find-estring (ee-dhmake-build "eev-puro" "eevpuro" "20120305"))
;;
(defun ee-dhmake-build (stem c date)
  (ee-template '(stem c date ee-dhmake-fullname ee-dhmake-email) "\
# Generated by:
# (ee-dhmake-build \"{stem}\" \"{c}\" \"{date}\")
#
rm   -Rv ~/usrc/{stem}/
mkdir -p ~/usrc/{stem}/
mkdir    ~/usrc/{stem}/{stem}-0.1.{date}/
# ln -s                {stem}-0.1.{date}  ~/usrc/{stem}/{stem}-0.1
  ln -s                {stem}-0.1.{date}  {stem}-0.1
cd       ~/usrc/{stem}/{stem}-0.1.{date}/

echo | \\
DEBFULLNAME=\"{ee-dhmake-fullname}\" \\
  dh_make --email {ee-dhmake-email} \\
          --copyright=gpl \\
          --cdbs \\
          --native
rm -v debian/README.Debian
rm -v debian/*.EX
rm -v debian/*.ex
cp -iv debian/control debian/control.orig

# (find-fline      \"~/{stem}/debian/\")
# (find-sh0 \"rm -Rv ~/{stem}/debian/\")
mkdir  -p ~/{stem}/debian/
if [ ! -e ~/{stem}/Makefile ]; then
  echo Creating:               ~/{stem}/Makefile
  echo \"clean:\"              > ~/{stem}/Makefile
fi
if [ ! -e ~/{stem}/debian/control ]; then
  echo Creating:               ~/{stem}/debian/control
  cp -v debian/control         ~/{stem}/debian/control
fi
if [ ! -e ~/{stem}/debian/rules ]; then
  echo Creating:               ~/{stem}/debian/rules
  cp -v debian/rules           ~/{stem}/debian/rules
  echo \"build/{stem}::\"   >> ~/{stem}/debian/rules
  echo \"install/{stem}::\" >> ~/{stem}/debian/rules
fi

# (find-{c}dh \"debian/\")
# (find-{c}dh \"debian/control\")
# (find-{c}dh \"debian/rules\")
cp -v ~/{stem}/debian/* debian/
cp -v ~/{stem}/Makefile .

# (find-man \"1 dpkg-buildpackage\")
# dpkg-buildpackage -us -uc    -rfakeroot     2>&1 | tee odb
  dpkg-buildpackage -us -uc -b -rfakeroot     2>&1 | tee odb
# (find-{c}file \"odb\")

rm -Rv ~/usrc/{stem}/{stem}-unpacked/
mkdir  ~/usrc/{stem}/{stem}-unpacked/
mkdir  ~/usrc/{stem}/{stem}-unpacked/DEBIAN/
cd     ~/usrc/{stem}/
ar p {stem}_*.deb control.tar.gz | tar -C {stem}-unpacked/DEBIAN/ -xvzf -
ar p {stem}_*.deb data.tar.gz    | tar -C {stem}-unpacked/        -xvzf -

# (find-{c}unpfile \"\")
# (find-{c}unpfile \"DEBIAN/\")
# (find-{c}unpfile \"DEBIAN/control\")
# (find-{c}unpsh \"find * | sort\")"))

(defun find-dhmake-links (&optional stem c date &rest rest)
  "Visit a temporary buffer containing hyperlinks for dhmake."
  (interactive)
  (setq stem (or stem "{stem}"))
  (setq c    (or c    "{c}"))
  (setq date (or date (format-time-string "%Y%m%d")))
  (apply 'find-elinks `(
    ;; Convention: the first sexp always regenerates the buffer.
    (find-dhmake-links ,stem ,c ,date ,@rest)
    (find-efunction 'find-dhmake-links)
    ;; Body:
    ""
    ;; (find-estring-elisp (ee-dhmake-codecds ,stem ,c ,date))
    ;; (find-estring (ee-dhmake-build ,stem ,c ,date))
    ;; (eev (ee-dhmake-build ,stem ,c ,date))
    ;; (find-fline "$EE")
    ;; (find-fline (format "~/%s/debian/" stem))
    ;; (find-sh0 ,(format "rm -Rv ~/%s/debian/" stem))
    ;; ""
    ,(ee-template `(stem c date) "\
# Set up the build script that `ee' will execute:
# (find-estring-elisp (ee-dhmake-codecds \"{stem}\" \"{c}\" \"{date}\"))
# (find-estring       (ee-dhmake-build   \"{stem}\" \"{c}\" \"{date}\"))
# (eev                (ee-dhmake-build   \"{stem}\" \"{c}\" \"{date}\"))
# (find-fline \"$EE\")

# Examine its main control files:
# (find-fline \"~/{stem}/debian/rules\")
# (find-fline \"~/{stem}/debian/control\")
# (find-fline \"~/{stem}/debian/\")

* (eepitch-shell)
* (eepitch-kill)
* (eepitch-shell)
ee
cd ~/usrc/{stem}/
ls -lF *.deb
sudo dpkg -i {stem}*.deb
# sudo dselect update

# (find-status   \"{stem}\")
# (find-vldifile \"{stem}.list\")
# (find-udfile   \"{stem}/\")


# Upload to angg.twu.net.
# (THIS IS A HACK!)
# (find-twusfile \"debian/\")

* (eepitch-eshell)
cd ~/usrc/{stem}/
ls -l {stem}_0.1.{date}_all.deb
cp -v {stem}_0.1.{date}_all.deb (ee-twusfile \"debian/\")
ls -l (ee-twusfile \"debian/\")
#   (find-twusfile \"debian/\")

* (eepitch-Twu)
cd ~/slow_html/debian/
mkdir -p dists/./main/binary-i386/
mkdir -p dists/./main/binary-amd64/
ls -lAF
apt-ftparchive packages .
apt-ftparchive packages . \\
  | tee        dists/./main/binary-i386/Packages \\
  | gzip -c9 > dists/./main/binary-i386/Packages.gz
apt-ftparchive packages . \\
  | tee        dists/./main/binary-amd64/Packages \\
  | gzip -c9 > dists/./main/binary-amd64/Packages.gz
")
    ) rest))
 
;; (find-dhmake-links)
;; (find-dhmake-links "{stem}" "{c}" "{date}")
;; (find-dhmake-links "foo-bar" "foobar")
;; (find-dhmake-links "eev" "eevbuild")
;; (find-dhmake-links "eev" "eevbuild" "20120404")




;; «find-dhmake-old-links»  (to ".find-dhmake-old-links")
;; (find-angg ".emacs" "eev-puro")
;; (find-angg "debian/README")
;;
(defun find-dhmake-old-links (&optional stem c date &rest rest)
  "Visit a temporary buffer containing hyperlinks for dhmake."
  (interactive)
  (setq stem (or stem "{stem}"))
  (setq c    (or c    "{c}"))
  (setq date (or date "{date}"))
  (apply 'find-elinks `(
    ;; Convention: the first sexp always regenerates the buffer.
    (find-dhmake-old-links ,stem ,c ,date ,@rest)
    ;; Body:
    ""
    ,(ee-template `(stem c date) "\
# (find-angg \".emacs\" \"{stem}-deb\")

* (eepitch-shell)
* (eepitch-kill)
* (eepitch-shell)
rm -Rv ~/usrc/{stem}/
mkdir  ~/usrc/{stem}/
mkdir  ~/usrc/{stem}/{stem}-0.1.{date}/
# ln -s              {stem}-0.1.{date}  {stem}-0.1
  ln -s              {stem}-0.1.{date}  ~/usrc/{stem}/{stem}-0.1
cd     ~/usrc/{stem}/{stem}-0.1.{date}/

echo | \\
DEBFULLNAME=\"Eduardo Ochs\" \\
  dh_make --email eduardoochs@gmail.com \\
          --copyright=gpl \\
          --cdbs \\
          --native
rm -v debian/README.Debian
rm -v debian/*.EX
rm -v debian/*.ex
mv -iv debian/control debian/control.orig

# (find-angg \"{stem}/debian/\")
# (find-angg \"{stem}/debian/control\")
# (find-angg \"{stem}/debian/rules\")
cp -v ~/{stem}/debian/* debian/
cp -v ~/{stem}/Makefile .

# (find-man \"1 dpkg-buildpackage\")
# dpkg-buildpackage -us -uc    -rfakeroot     |& tee odb
  dpkg-buildpackage -us -uc -b -rfakeroot     |& tee odb
# (find-{c}file \"odb\")

rm -Rv ~/usrc/{stem}/{stem}-unpacked/
mkdir  ~/usrc/{stem}/{stem}-unpacked/
mkdir  ~/usrc/{stem}/{stem}-unpacked/DEBIAN/
cd     ~/usrc/{stem}/
ar p {stem}_*_all.deb control.tar.gz | tar -C {stem}-unpacked/DEBIAN/ -xvzf -
ar p {stem}_*_all.deb data.tar.gz    | tar -C {stem}-unpacked/        -xvzf -

# (find-{c}unpfile \"\")
# (find-{c}unpfile \"DEBIAN/\")
# (find-{c}unpfile \"DEBIAN/control\")
# (find-{c}unpsh \"find * | sort\")

cd     ~/usrc/{stem}/
# sudo dpkg -i {stem}_0.1.{date}_all.deb
  sudo dpkg -i {stem}*.deb
sudo dselect update

# (find-status   \"{stem}\")
# (find-vldifile \"{stem}.list\")
# (find-udfile   \"{stem}/\")

# (find-es \"eev\" \"apt-ftparchive\")
# (find-es \"eev\" \"eev-deb-unpacked\")

# (find-fline \"~/usrc/eev/eev-unpacked/\")
# (find-eev \"debian/README.Debian\")
# (find-angg \"debian/README\")

# (find-twusfile \"debian/\")

# (ee-cp \"~/usrc/{stem}/{stem}_0.1.{date}_all.deb\" (ee-twusfile \"debian/{stem}_0.1.{date}_all.deb\") 'over)
# (find-twusfile \"debian/\")

* (eepitch-Twu)
cd ~/slow_html/debian/
mkdir -p dists/./main/binary-i386/
mkdir -p dists/./main/binary-amd64/
ls -lAF
apt-ftparchive packages .
apt-ftparchive packages . \\
  | tee        dists/./main/binary-i386/Packages \\
  | gzip -c9 > dists/./main/binary-i386/Packages.gz
apt-ftparchive packages . \\
  | tee        dists/./main/binary-amd64/Packages \\
  | gzip -c9 > dists/./main/binary-amd64/Packages.gz





;; (find-angg \".emacs\" \"{stem}-deb\")
;; <{stem}-deb>
\(code-c-d \"{c}\"    \"~/usrc/{stem}/{stem}-0.1.{date}/\")
\(code-c-d \"{c}d\"   \"~/usrc/{stem}/{stem}-0.1.{date}/debian/\")
\(code-c-d \"{c}dd\"  \"~/usrc/{stem}/{stem}-0.1.{date}/debian/{stem}/\")
\(code-c-d \"{c}unp\" \"~/usrc/{stem}/{stem}-unpacked/\")
;; (find-{c}file    \"\")
;; (find-{c}dfile   \"\")
;; (find-{c}ddfile  \"\")
;; (find-{c}unpfile \"\")
;; (find-{c}dsh   \"find * | sort\")
;; (find-{c}ddsh  \"find * | sort\")
;; (find-{c}unpsh \"find * | sort\")
;; (find-status   \"{stem}-deb\")
;; (find-vldifile \"{stem}-deb.list\")
;; (find-udfile   \"{stem}-deb-puro/\")


cd ~/usrc/{stem}/{stem}-0.1.{date}/

cat > debian/control <<'%%%'
Source: {stem}
Section: unknown
Priority: extra
Maintainer: Eduardo Ochs <eduardoochs@gmail.com>
Build-Depends: cdbs, debhelper (>= 7.0.50~)
Standards-Version: 3.8.4
Homepage: http://angg.twu.net/{stem}.html

Package: {stem}
Architecture: all
Depends: ${shlibs:Depends}, ${misc:Depends}
Description: <insert up to 60 chars description>
 <insert long description, indented with spaces>
%%%

cat >> debian/rules <<'%%%'
# clean::
build/{stem}::
install/{stem}::
%%%

echo \"clean:\" > debian/Makefile
echo \"clean:\" > Makefile

# (find-angg \"{stem}/debian/\")

cp -iv debian/control ~/{stem}/debian/
cp -iv debian/rules   ~/{stem}/debian/
")
    ) rest))

;; (define-key eev-mode-map "\M-h\M-u" 'find-dhmake-old-links)

;; Test:
;; (find-dhmake-old-links)
;; (find-dhmake-old-links "eev-puro" "eevpuro" "20111027")
;; (find-dhmake-old-links "eev" "eevbuild" "20110612")
;; (find-angg ".emacs" "eev-puro-deb")






;; «find-escript-links»  (to ".find-escript-links")
;; (find-find-links-links "escript" "stem")
;; (find-efunction 'find-find-links-links)
;;
(defun find-escript-links (&optional stem &rest rest)
  "Visit a temporary buffer containing hyperlinks for escript."
  (interactive)
  (setq stem (or stem "{stem}"))
  (apply 'find-elinks `(
    ;; Convention: the first sexp always regenerates the buffer.
    (find-escript-links ,stem ,@rest)
    (kill-new ,stem)
    (find-blogme3 "anggmake.lua" "escriptstems")
    ""
    ;; (wrobak 4 '(find-es ,stem))
    (ee-copy-rest 2 '(find-es ,stem))
    (find-es ,stem)
    ;; Body:
    ""
    ,(ee-template0 "\
#######
#
# E-scripts on {stem}.
#
# Note 1: use the eev command (defined in eev.el) and the
# ee alias (in my .zshrc) to execute parts of this file.
# Executing this file as a whole makes no sense.
# An introduction to eev can be found here:
#
#   (find-eev-quick-intro)
#   http://angg.twu.net/eev-intros/find-eev-quick-intro.html
#
# Note 2: be VERY careful and make sure you understand what
# you're doing.
#
# Note 3: If you use a shell other than zsh things like |&
# and the for loops may not work.
#
# Note 4: I always run as root.
#
# Note 5: some parts are too old and don't work anymore. Some
# never worked.
#
# Note 6: the definitions for the find-xxxfile commands are on my
# .emacs.
#
# Note 7: if you see a strange command check my .zshrc -- it may
# be defined there as a function or an alias.
#
# Note 8: the sections without dates are always older than the
# sections with dates.
#
# This file is at <http://angg.twu.net/e/{stem}.e>
#           or at <http://angg.twu.net/e/{stem}.e.html>.
#        See also <http://angg.twu.net/emacs.html>,
#                 <http://angg.twu.net/.emacs[.html]>,
#                 <http://angg.twu.net/.zshrc[.html]>,
#                 <http://angg.twu.net/escripts.html>,
#             and <http://angg.twu.net/>.
#
#######
\n\n\n\n
#  Local Variables:
#  coding:               utf-8-unix
#  End:\
")
    ) rest))

;; Test:
;; (find-escript-links)
;; (find-escript-links "foo")




;; «find-thttpd-links»  (to ".find-thttpd-links")
;;
(defun find-thttpd-links (&optional dir &rest rest)
  "Visit a temporary buffer containing hyperlinks for thttpd."
  (interactive)
  (setq dir (or dir "{dir}"))
  (apply 'find-elinks `(
    ;; Convention: the first sexp always regenerates the buffer.
    (find-thttpd-links ,dir ,@rest)
    (find-thttpd-links "~/usrc/varwww/" ,@rest)
    (find-angg ".emacs.templates" "find-thttpd-links")
    (find-es "http" "thttpd")
    "# http://localhost:8080/"
    (find-wget "http://localhost:8080/")
    (find-sh "/sbin/ifconfig")
    ;; Body:
    ""
    ,(ee-template `(dir) "\
* (eepitch-shell2)
* (eepitch-kill)
* (eepitch-shell2)

kill -9 $(cat {dir}pid); sleep 1
rm -Rv   {dir}
mkdir -p {dir}
cd       {dir}
/usr/sbin/thttpd -p 8080 \\
       -d {dir} \\
       -i {dir}pid \\
       -nor -nos -c \"*\" -l /dev/null \\
       -T iso-8859-1

cd {dir}
date > 1
date > 2

ln -s ~/TH/L .

# (find-sh \"/sbin/ifconfig\")
cd /etc/
sudo chmod 666 hosts
# (kill-new \"192.168.0.172  reef\")
# (find-file \"/etc/hosts\")
# http://reef:8080/
# http://reef:8080/L/e/tex.e.html
")
    ) rest))

;; (find-thttpd-links)



;; «find-gitclone-links»  (to ".find-gitclone-links")
;; (find-find-links-links "gitclone" "url stem")
;; (find-efunction 'find-find-links-links)
;;
(defun find-gitclone-links (&optional url stem &rest rest)
  "Visit a temporary buffer containing hyperlinks for gitclone."
  (interactive)
  (setq url (or url (car (browse-url-interactive-arg "URL: "))))
  (message "%S" url) 
  (setq stem (or stem "{foo}"))
  (apply 'find-elinks `(
    ;; Convention: the first sexp always regenerates the buffer.
    (find-gitclone-links ,url ,stem ,@rest)
    ;; Body:
    ""
    ,(ee-template0 "\
* (eepitch-shell)
* (eepitch-kill)
* (eepitch-shell)
rm -Rfv /tmp/{stem}/
mkdir   /tmp/{stem}/
cd      /tmp/{stem}/
git clone {url}
tar -cvzf ~/tmp/{stem}-git.tgz *

rm -Rfv ~/usrc/{stem}/
tar -C  ~/usrc/ -xvzf ~/tmp/{stem}-git.tgz
cd      ~/usrc/{stem}/
")
    ) rest))





;; (find-find-links-links "newhost" "name ip VAR")

;; «find-newhost-links»  (to ".find-newhost-links")
;; «find-newhost-links-old»  (to ".find-newhost-links-old")
;; (find-eev "eev-template.el" "find-newhost-links")
;; (find-newhost-links)
;; (find-newhost-links "lugao" "192.168.0.198" "LU")
;; (find-newhost-links "varda" "192.168.1.100" "VA")
;; (find-newhost-links "gwen" "192.168.1.101" "GW")
;;
(defun find-newhost-links-old (&optional name ip VAR &rest rest)
  "Visit a temporary buffer with hyperlinks for connecting to a new host."
  (interactive)
  (setq name (or name "{name}"))
  (setq ip (or ip "{ip}"))
  (setq VAR (or VAR "{VAR}"))
  (apply 'find-elinks `(
    ;; Convention: the first sexp always regenerates the buffer.
    (find-newhost-links ,name ,ip ,VAR ,@rest)
    (find-efunction 'find-newhost-links)
    (kill-new ,ip ,name)
    (find-fline "/etc/hosts" ,name)
    ;; Body:
    ""
    ,(ee-template `(name ip VAR) "\
;; Basic setup
;; (find-sh \"/sbin/ifconfig\")
;; (find-sh \"/sbin/ifconfig\" \"wlan0\")
;; (find-sh \"/sbin/ifconfig\" \"wlan0\" \"inet addr:\")
;; (find-sh \"/sbin/ifconfig wlan0\" \"inet addr:\")
;; (find-fline \"/etc/hosts\")

;; Low-level tests
* (eepitch-shell)
* (eepitch-kill)
* (eepitch-shell)
ssh edrx@{name}
* (eepitch-kill)

;; (find-fline \"/scp:edrx@{name}:\")

;; <{name}>
\(code-c-d \"{name}\" \"/scp:edrx@{name}:/\")
;; (find-{name}file \"\")
\(defun eepitch-{name} () (interactive)
  (eepitch '(find-comintprocess \"{name}\" \"ssh edrx@{name}\")))

* (eepitch-{name})
* (eepitch-kill)
* (eepitch-{name})


;; (setenv \"{VAR}\" \"/scp:edrx@{name}:\")

\(setenv \"LR\" \"/sudo::\")
\(setenv \"RE\"  \"/ssh:edrx@{name}:\")
\(setenv \"RR\" \"/sudo:root@{name}:\")
\(ee-tramp-proxy \"{name}\" \"/sudo:%h:\")
\(code-c-d \"LR\" (ee-expand \"$LR/\"))
\(code-c-d \"RE\" (ee-expand \"$RE/\"))
\(code-c-d \"RR\" (ee-expand \"$RR/\"))
\(defun eepitch-RE () (interactive) (eepitch-comint \"{name}\" \"ssh edrx@{name}\"))
\(defun eepitch-RR () (interactive) (eepitch-comint \"{name}/R\" \"ssh edrx@{name}\"))
;; (find-LRfile \"\")
;; (find-REfile \"\")
;; (find-RRfile \"\")

;; (find-sh \"/sbin/ifconfig\" \"wlan\" \"inet addr:\")
;; (find-RR3 \"etc/hosts\")
;; (find-thttpd-links)
* (eepitch-RE)
wget -O - http://reef:8080/

;; (find-RR3 \"etc/apt/apt.conf.d/90apt-proxy.conf\")



;; (find-fline      \"/sudo:{name}:\")
;; (find-fline \"/sudo:root@{name}:\")

\(ee-tramp-proxy \"{name}\" \"/ssh:%h:\")
\(ee-tramp-proxy \"{name}\" \"/ssh:%u@%h:\")
\(ee-tramp-proxy \"{name}\" \"/sudo:%h:\")

\(setq         tramp-default-proxies-alist nil)
\(add-to-list 'tramp-default-proxies-alist
             '(\"\\\\`{name}\\\\'\" \"\\\\`root\\\\'\" \"/ssh:%h:\"))
\(add-to-list 'tramp-default-proxies-alist
             '(\"\\\\`{name}\\\\'\" \"\\\\`root\\\\'\" \"/ssh:%u@%h:\"))
\(add-to-list 'tramp-default-proxies-alist
             '(\"\\\\`{name}\\\\'\" \"\\\\`root\\\\'\" \"/sudo:%h:\"))

;; (describe-variable 'tramp-default-proxies-alist)
")
    ) rest))



;; «find-prince-links»  (to ".find-prince-links")
;; (find-es "html" "princexml")
;; (find-THgrep "grep -nH -e find-prince-links *.blogme")
;; (find-prince-links "2011.1-GA")
;; (find-prince-links "2011.1-MD")
;; (find-prince-links "2011.2-GA")
;; (find-prince-links "2011.2-MD")
(defun find-prince-links (&optional stem GA size &rest rest)
  "Visit a temporary e-script that runs princexml on a blogme3 file."
  (interactive)
  (setq stem (or stem "{stem}"))
  (setq GA   (or GA   "GA"))
  (setq size (or size "{size}"))
  (apply 'find-elinks `(
    ;; Convention: the first sexp always regenerates the buffer.
    (find-prince-links ,stem ,GA ,size ,@rest)
    (find-prince-links ,stem ,GA "8pt" ,@rest)
    (find-efunction 'find-prince-links)
    ;; Body:
    ""
    ,(ee-template0 "\
* (eepitch-shell)
* (eepitch-kill)
* (eepitch-shell)
cat > /tmp/print.css <<'%%%'
body {<} font-size: {size} !important {>}
%%%

cd
lua51 blogme3/blogme3.lua \\
       -e \"PRINCEPRINT=1\"      \\
       -o /tmp/{stem}.html  \\
       -i   TH/{stem}.blogme

prince -s /tmp/print.css      \\
       -o /tmp/{stem}.pdf  \\
          /tmp/{stem}.html

# (find-pdf-page \"/tmp/{stem}.pdf\")

* (eepitch-shell)
mkdir /tmp/pen/
sudo mount -o uid=$UID /dev/sdb1 /tmp/pen/
cp -v /tmp/{stem}.pdf /tmp/pen/
# (find-sh \"dmesg | tail\")
# (find-fline \"/tmp/pen/\")
sudo umount /tmp/pen
sync

# (find-fline   \"/tmp/\" \"{stem}.pdf\")
# (find-xpdfpage   \"/tmp/{stem}.pdf\")
# (find-evincepage \"/tmp/{stem}.pdf\")
#            file:///tmp/{stem}.html

# (ee-cp \"/tmp/{stem}.pdf\" (ee-twusfile \"{GA}/{stem}.pdf\") 'over)
# (ee-cp \"/tmp/{stem}.pdf\" (ee-twupfile \"{GA}/{stem}.pdf\") 'over)
#     (find-twusfile \"{GA}/\")
# http://angg.twu.net/{GA}/{stem}.pdf

echo $TWUS/{GA}/{stem}.pdf
Scp-np /tmp/{stem}.pdf $TWUS/{GA}/{stem}.pdf
Scp-np /tmp/{stem}.pdf $TWUP/{GA}/{stem}.pdf
")
    ) rest))



;; «find-youtubedl-links-old»  (to ".find-youtubedl-links-old")
;; (find-eev "eev-tlinks.el" "find-youtubedl-links")
;; (find-es "video" "youtube-dl")
;; (find-eev "eev-tlinks.el" "find-youtubedl-links")
;; (find-find-links-links "youtubedl" "dir title hash ext")
;; (find-youtubedl-links nil nil "vcXUrNSvjhU" ".flv")
;; (find-youtubedl-links "/sda5/videos/" "Prince_XML_Generating_High_Quality_PDFs_from_HTML_CSS" "vcXUrNSvjhU" ".flv" "princexml")
;; (find-es "video" "youtube-dl")
;; (find-es "html" "princexml-video")
;;
;; (find-fline "/sda5/videos/")
;; (find-sh "ls /sda5/videos | tr '.-' '\n\n'")
;; (find-sh "ls /sda5/videos | tr '.-' '\n\n' | awk 'length($1)==11'")
;; (find-sh "ls /sda5/videos/ | grep ZjiQQlgkBVM")
;; (find-sh "ls /sda5/videos/ | grep ZjiQQlgkBVM | awk -F . '{print substr($1, 1, length($1)-12)}'")
;; (find-sh "ls /sda5/videos/ | grep ZjiQQlgkBVM | awk -F . '{print $2}'")
;; (find-sh "ls /sda5/videos/ | grep ZjiQQlgkBVM | awk -F . '{print \".\" $2}'")
;; (find-fline "/sda5/videos/" "Marco_Baringer_s_SLIME_Tutorial_Video-_B_4vhsmRRI.flv")
;; (find-fline "/sda5/videos/" "Sun_Will_Set-l4WN9elfA9o.flv")
;; (ee-youtube-guess "/sda5/videos/" "l4WN9elfA9o" 'title)
;; (ee-youtube-guess "/sda5/videos/" "l4WN9elfA9o" 'ext)
;;
(defun ee-youtube-guess0 (dir hash prog)
  (if (eq prog 'title) (setq prog "substr($1, 1, length($1)-12)"))
  (if (eq prog 'ext)   (setq prog "\".\" $2"))
  (format "ls %s | grep -e %s | awk -F . '{print %s}'" dir hash prog))

(defun ee-youtube-guess (dir hash prog &optional default)
  (let ((ans (find-sh0 (ee-youtube-guess0 dir hash prog))))
    (if (and default (equal ans ""))
	default
      ans)))

(defun find-youtubedl-links-old (&optional dir title hash ext stem &rest rest)
  "Visit a temporary buffer containing hyperlinks for youtube-dl."
  (interactive)
  (setq dir   (or dir   "{dir}"))
  (setq title (or title "{title}"))
  (setq hash  (or hash  "{hash}"))
  (setq ext   (or ext   "{ext}"))
  (setq stem  (or stem  "{stem}"))
  (let* ((dirp    (file-directory-p dir))
	 (hash-g  (ee-no-properties (ee-stuff-around-point "-0-9A-Za-z_")))
	 (title-g (if dirp (ee-youtube-guess dir hash 'title)))
	 (ext-g   (ee-youtube-guess dir hash 'ext))
	)
    (apply 'find-elinks `(
      ;; Convention: the first sexp always regenerates the buffer.
      (find-youtubedl-links ,dir ,title ,hash ,ext ,stem ,@rest)
      ;;
      (find-youtubedl-links ,dir ,title ,hash-g ,ext ,stem ,@rest)
      (find-youtubedl-links "/sda5/videos/" ,title ,hash ,ext ,stem ,@rest)
      ,(if dirp `(find-youtubedl-links ,dir ,title-g ,hash ,ext-g ,stem ,@rest))
      ;; Body:
      ""
      ,(ee-template0 "\
* (eepitch-shell2)
* (eepitch-kill)
* (eepitch-shell2)
cd {dir}
youtube-dl -t 'http://www.youtube.com/watch?v={hash}'

# http://www.youtube.com/watch?v={hash}
# youtube-dl -F    -t 'http://www.youtube.com/watch?v={hash}'
# youtube-dl -f 18 -t 'http://www.youtube.com/watch?v={hash}'

# (find-es \"video\" \"youtube-dl\")
# (find-fline \"{dir}\" \"{hash}\")
# (find-fline \"{dir}\" \"{title}-{hash}\")
# (find-fline \"{dir}\" \"{title}-{hash}{ext}\")
# (find-mplayer  \"{dir}{title}-{hash}{ext}\")
# (find-mplayer  \"{dir}{title}-{hash}{ext}.part\")
# (code-mplayer \"{stem}\" \"{dir}{title}-{hash}{ext}\")
# (code-mplayer \"{stem}\" \"{dir}{title}-{hash}{ext}.part\")
# (find-{stem})
")
      ) rest)))



;; «find-eepitch-def-links»  (to ".find-eepitch-def-links")
;; (find-find-links-links "eepitch-def" "stem")
;;
(defun find-eepitch-def-links (&optional stem &rest rest)
  "Visit a temporary buffer containing hyperlinks for eepitch-def."
  (interactive)
  (setq stem (or stem "{stem}"))
  (apply 'find-elinks `(
    ;; Convention: the first sexp always regenerates the buffer.
    (find-eepitch-def-links ,stem ,@rest)
    ;; Body:
    ""
    ,(ee-template `(stem) "\
\(defun eepitch-{stem} () (interactive) (eepitch-comint \"{stem}\" \"{stem}\"))

* (eepitch-{stem})
* (eepitch-kill)
* (eepitch-{stem})
")
    ) rest))





;; «find-wpa-links»  (to ".find-wpa-links")
;; 2012apr26: scripts to connect and disconnect from net devices
;; semi-manually.
;; Written in collaboration with Jose Flavio Pereira Guimaraes.
;;
;; (find-wpa-links)

(defun find-wpa-links (&optional nomedoarquivo essid password &rest rest)
  "Visit a temporary buffer containing hyperlinks for wpa."
  (interactive)
  (setq nomedoarquivo (or nomedoarquivo "{nomedoarquivo}"))
  (setq essid         (or essid         "{essid}"))
  (setq password      (or password      "{password}"))
  (apply 'find-elinks `(
    ;; Convention: the first sexp always regenerates the buffer.
    (find-wpa-links ,nomedoarquivo ,essid ,password ,@rest)
    (find-wpa-links "Casa" ,@rest)
    (find-wpa-links "Lab2" ,@rest)
    (find-wpa-links "LLaRC" ,@rest)
    (find-wpa-links "Livre" "LIVRE" ,@rest)
    (find-livre-links)
    (find-fline "/home/Rede/")
    (find-efunction 'find-wpa-links)
    ;; Body:
    ""
    ,(ee-template `(nomedoarquivo essid password) "\

* (eepitch-shell)
* (eepitch-kill)
* (eepitch-shell)
# Modo rapido:
sudo ifconfig wlan0 up
sudo iwconfig wlan0 essid \"{essid}\"
sudo iwconfig wlan0 essid \"{essid}\" key \"{password}\"
sudo wpa_supplicant -D wext -i wlan0 -c /home/Rede/{nomedoarquivo}Rede -B
sudo kill -9 $(cat /var/run/dhcpcd.pid)
sudo dhcpcd

# Testes:
     ifconfig
     ifconfig wlan0
sudo ifconfig wlan0 down
sudo ifconfig wlan0 up
     ifconfig wlan0
     ifconfig

     iwconfig wlan0
sudo iwconfig wlan0 essid \"{essid}\"
     iwconfig wlan0

sudo dhcpcd

ps ax | grep dhcp
               cat /var/run/dhcpcd.pid
echo kill -9 $(cat /var/run/dhcpcd.pid)
sudo kill -9 $(cat /var/run/dhcpcd.pid)
ps ax | grep dhcp

sudo dhcpcd
")
    ) rest))

;; (define-key eev-mode-map "\M-h\M-w" 'find-wpa-links)



;; «find-intro-links»  (to ".find-intro-links")
;; (find-eev "eev-tlinks.el" "find-intro-links")





(defun find-mydvi-links (&optional c stem &rest rest)
  "Visit a temporary buffer containing hyperlinks for mydvi."
  (interactive)
  (setq c (or c "{c}"))
  (setq stem (or stem "{stem}"))
  (apply 'find-elinks `(
    ;; Convention: the first sexp always regenerates the buffer.
    (find-mydvi-links ,c ,stem ,@rest)
    (find-efunction 'find-mydvi-links)
    ;; Body:
    ""
    ,(ee-template `(c stem) "\
;; «.{c}»	(to \"{c}\")
;; «{c}»  (to \".{c}\")
\(code-c-d       \"{c}\" \"~/LATEX/{stem}.tex\" :anchor)
\(code-dvi       \"{c}\" \"~/LATEX/{stem}.dvi\")
\(code-pdftotext \"{c}\" \"~/LATEX/{stem}.pdf\")
;; (find-{c}     \"\" \"lambda-intro\")
;; (find-{c}page 25 \"17. Objects of Line Type\")
;; (find-{c}text)
")
    ) rest))



;; «diagskel»  (to ".diagskel")
;; Used to be here: (find-angg ".emacs-tex.el" "diagskel")
;;
(defun diagskel () (interactive)
  (insert "
%D diagram ??
%D 2Dx     100
%D 2D  100
%D 2D
%D 2D  +20
%D 2D
%D # ren ==>
%D
%D ((
%D
%D ))
%D enddiagram
%D
$$\\pu
  \\diag{??}
$$
"))





;; «ee-latex-header»  (to ".ee-latex-header")

(defun ee-latex-header (d/ stem)
  (ee-template0 "\
% (find-angg \"{d/}{stem}.tex\")
% (find-dn4ex \"edrx08.sty\")
% (defun c () (interactive) (find-zsh \"cd ~/{d/} && latex    {stem}.tex\"))
% (defun c () (interactive) (find-zsh \"cd ~/{d/} && pdflatex {stem}.tex\"))
% (eev \"cd ~/{d/} && Scp {stem}.pdf edrx@angg.twu.net:slow_html/{d/}\")
% (defun d () (interactive) (find-dvipage \"~/{d/}{stem}.dvi\"))
% (find-dvipage    \"~/{d/}{stem}.dvi\")
% (find-pspage     \"~/{d/}{stem}.ps\")
% (find-xpdfpage   \"~/{d/}{stem}.pdf\")
% (find-evincepage \"~/{d/}{stem}.pdf\")
% (find-bgprocess \"evince ~/{d/}{stem}.pdf\")
% (find-zsh0 \"cd ~/{d/} && dvipdf          {stem}.dvi {stem}.pdf\")
% (find-zsh0 \"cd ~/{d/} && dvips -D 300 -o {stem}.ps  {stem}.dvi\")
% (find-zsh0 \"cd ~/{d/} && dvips -D 600 -P pk -o {stem}.ps {stem}.dvi && ps2pdf {stem}.ps {stem}.pdf\")
% (find-zsh0 \"cd ~/{d/} && dvips -D 300 -o tmp.ps tmp.dvi\")
% (find-pspage  \"~/{d/}tmp.ps\")
% (ee-cp \"~/{d/}{stem}.pdf\" (ee-twupfile \"{d/}{stem}.pdf\") 'over)
% (ee-cp \"~/{d/}{stem}.pdf\" (ee-twusfile \"{d/}{stem}.pdf\") 'over)
% (find-twusfile     \"{d/}\" \"{stem}\")
% http://angg.twu.net/{d/}{stem}.pdf
"))

;; (find-estring (ee-latex-header "quadradinho/" "quadradinho-a5"))



;; «find-tail-call-links»  (to ".find-tail-call-links")
;; Orig skel: (find-find-links-links "\\M-P" "tail-call" "stem firstargs")
;; New skel:  (find-find-links-links-new "tail-call" "stem firstargs" "")
;; Test: 

(defun find-tail-call-links (&optional stem firstargs &rest rest)
  "Visit a temporary buffer containing hyperlinks for tail-call."
  (interactive)
  (setq stem (or stem "{stem}"))
  (setq firstargs (or firstargs "{firstargs}"))
  (apply 'find-elinks `(
    ;; Convention: the first sexp always regenerates the buffer.
    (find-tail-call-links ,stem ,firstargs ,@rest)
    (find-efunction 'find-tail-call-links)
    (emacs-lisp-mode)
    ;; Body:
    ""
    ,(ee-template `(stem ("c fname" ,firstargs)) "\
;; (find-efunction 'code-{stem})

;; find-{stem}-page
;;
\(defalias 'find-{stem}page
          'find-{stem}-page)
\(defun     find-{stem}-page (fname &optional page &rest rest)
  (find-bgprocess (ee-find-{stem}-page fname page)))
\(defvar ee-find-{stem}-page-args nil)
\(defun  ee-find-{stem}-page (fname &optional page)
  `(\"{stem}\" ,@ee-find-{stem}-page-args
         ,@(if page `(,(format \"--page=%d\" page)))
         ,fname))

;; code-{stem}: top-level functions
;;
\(defun      code-{stem} ({c fname} &rest rest)
  (eval (ee-read      (apply 'ee-code-{stem} {c fname} rest))))
\(defun find-code-{stem} ({c fname} &rest rest)
  (find-estring-elisp (apply 'ee-code-{stem} {c fname} rest)))
\(defun   ee-code-{stem} ({c fname} &rest rest)
  (concat (ee-template0 \"\\
    (defun find-{c}page (&optional page &rest rest)
      (find-{stem}-page fname page))
\")  (ee-code-{stem}-rest rest)))

;; Support for extra arguments
;;
\(defun ee-code-{stem}-rest (rest)
  (ee-tail-call \"ee-code-{stem}-%S\" rest))

\(defun ee-code-{stem}-:key (arg &rest rest)
  (concat (ee-template0 \"\\
    (defun find-{c}page () ...)
\")  (ee-code-{stem}-rest rest)))

;; Test:
;; (find-code-{stem} \"{c}\" \"{fname}\" :key \"{foo}\" :key \"{bar}\")
")
    ) rest))

;; Tests:
;; (find-tail-call-links)
;; (find-tail-call-links "xpdf" "c fname")
;; (find-tail-call-links "xpdf" "c fname")





;; «find-pdflikedef-links»  (to ".find-pdflikedef-links")
;; (find-find-links-links "pdflikedef" "stem firstargs")

(defun find-pdflikedef-links (&optional stem firstargs &rest rest)
  "Visit a temporary buffer containing hyperlinks for pdflikedef."
  (interactive)
  (setq stem (or stem "{stem}"))
  (setq firstargs (or firstargs "{firstargs}"))
  (apply 'find-elinks-elisp `(
    ;; Convention: the first sexp always regenerates the buffer.
    (find-pdflikedef-links ,stem ,firstargs ,@rest)
    (find-pdflikedef-links ,stem "c fname" ,@rest)
    (find-efunction 'find-pdflikedef-links)
    ;; Body:
    ""
    ,(ee-template0 "\
\(defun     find-{stem}-page (fname &optional page &rest rest)
  (find-bgprocess (ee-find-{stem}-page fname page)))
\(defvar ee-find-{stem}-page-options '())
\(defun  ee-find-{stem}-page (fname &optional page)
  `(\"{stem}\"
    ,@ee-find-{stem}-page-options
    ,@(if page `(,(format \"--page=%d\" page)))
    ,fname))

;; (find-efunction 'code-{stem})

;; find-{stem}page
;; find-{stem}-page
;; code-{stem}
;;
\(defalias 'find-{stem}page
          'find-{stem}-page)

\(defun      code-{stem} ({firstargs} &rest rest)
  (eval (ee-read      (apply 'ee-code-{stem} {firstargs} rest))))
\(defun find-code-{stem} ({firstargs} &rest rest)
  (find-estring-elisp (apply 'ee-code-{stem} {firstargs} rest)))
\(defun   ee-code-{stem} ({firstargs} &rest rest)
  (concat (ee-template0 \"\\
\\(defun find-{<}c{>}page (&optional page &rest rest)
  (find-{stem}-page {<}(ee-pp0 fname){>} page))
\")  (ee-code-pdftext-rest rest)))

;; Tests:
;; (find-epp (ee-find-{stem}-page \"/tmp/foo.pdf\"))
;; (find-epp (ee-find-{stem}-page \"/tmp/foo.pdf\" 2))
;;           (find-{stem}-page    \"/tmp/foo.pdf\")
;;           (find-{stem}-page    \"/tmp/foo.pdf\" 2)
;;
;;      (find-code-{stem} \"foo\"   \"/tmp/foo.pdf\")
;;           (code-{stem} \"foo\"   \"/tmp/foo.pdf\")
;;                 (find-foopage)
;;                 (find-foopage 2)
;;      (code-pdftotext \"foo\"   \"/tmp/foo.pdf\")
")
    ) rest))

;; Tests:
;; (find-pdflikedef-links)
;; (find-pdflikedef-links "xpdf" "c fname")
;;
;; (find-epp (ee-find-xpdf-page "/tmp/foo.pdf"))
;; (find-epp (ee-find-xpdf-page "/tmp/foo.pdf" 2))
;;           (find-xpdf-page    "/tmp/foo.pdf")
;;           (find-xpdf-page    "/tmp/foo.pdf" 2)
;;
;;      (find-code-xpdf "foo"   "/tmp/foo.pdf")
;;           (code-xpdf "foo"   "/tmp/foo.pdf")
;;                 (find-foopage)
;;                 (find-foopage 2)
;;      (code-pdftotext "foo"   "/tmp/foo.pdf")





;; «find-eev-video-record-links» (to ".find-eev-video-record-links")
;; (find-find-links-links "<none>" "eev-video" "stem")
;; A test: (find-eev-video-record-links)

(defun find-eev-video-record-links-old (&optional stem &rest pos-spec-list)
"Visit a temporary buffer containing hyperlinks for foo."
  (interactive)
  (setq stem (or stem "{stem}"))
  (apply 'find-elinks
   `((find-eev-video-record-links ,stem ,@pos-spec-list)
     (find-eev-video-record-links "2" ,@pos-spec-list)
     (find-eev-video-record-links nil ,@pos-spec-list)
     ;; Convention: the first sexp always regenerates the buffer.
     (find-efunction 'find-eev-video-record-links)
     ,(ee-template0 "\
;; (emacs-lisp-mode)
;; (sh-mode)


# Edit
#
# (find-angg \".zshrc\" \"eev2-files\")
# (find-eev  \"eev-readme.el\")
# (find-angg \"eev-videos/\")
# (find-angg \"eev-videos/0.sh\")
# (find-angg \"eev-videos/2.sh\")
# (find-angg \"eev-videos/2.el\")
# (eee)
# (find-zsh \"eev2-build-tgz; cp -v ~/eev-videos/2.el /tmp/\")
# (find-sh0 \"~/eev-videos/2.sh record\")



# Rehearse / record / upload
#
* (eepitch-shell)
* (eepitch-kill)
* (eepitch-shell)
eev2-build-tgz; cp -v ~/eev-videos/2.el /tmp/
#eev2-upload -v; rm -v /tmp/eev2.tgz /tmp/2.el
~/eev-videos/2.sh record
killall avconv

# (find-mplayer \"/tmp/out.mp4\")



# Copy video and audio
# (find-fline \"~/eev-videos/\")
# (find-fline \"~/eev-videos/\" \"video{stem}-\")
# (find-fline \"/tmp/\")
# (find-fline \"/tmp/pen/VOICE/FOLDER01/\")
#
laf -h /tmp/out.mp4
cp -iv /tmp/out.mp4 ~/eev-videos/video{stem}-video.mp4
#
# (find-pen-links)
mkdir /tmp/pen/
sudo mount -o ro               /dev/sdb1 /tmp/pen/
sudo mount -o ro               /dev/sdc1 /tmp/pen/
sudo mount -o uid=$UID         /dev/sdb1 /tmp/pen/
sudo mount -o uid=$UID         /dev/sdc1 /tmp/pen/
# (find-fline \"/tmp/pen/\")
# (find-fline \"/tmp/pen/VOICE/FOLDER01/\")
#
A0=$('ls' /tmp/pen/VOICE/FOLDER01/* | tail -n 1)
echo   $A0
laf -h $A0
cp -iv $A0 ~/eev-videos/video{stem}-audio.mp3
#
sudo umount /tmp/pen
sync




# Play
#
;; (eev-avadj-mode 0)
;; (eev-avadj-mode 1)
;; (find-fline \"~/eev-videos/\")
\(code-audio \"lastaudio\" \"~/eev-videos/video{stem}-audio.mp3\")
\(code-video \"lastvideo\" \"~/eev-videos/video{stem}-video.mp4\")
\(code-video \"lastall\"   \"~/eev-videos/video{stem}.mp4\")
;; (find-lastaudio)
;; (find-lastvideo)
;; (find-lastall)


# Stick audio and video together
# (find-es \"ffmpeg\" \"adding-audio\")

* (eepitch-shell2)
* (eepitch-kill)
* (eepitch-shell2)
cd ~/eev-videos/
avconv -i video{stem}-video.mp4 \\
       -i video{stem}-audio.mp3 \\
       -map 0 -map 1 -c copy \\
       video{stem}.mp4



# Upload
# http://angg.twu.net/eev-videos/
# http://angg.twu.net/eev-videos/README.html
# http://angg.twu.net/eev-videos/video{stem}.mp4
# (find-twusfile     \"eev-videos/\")
# (find-angg         \"eev-videos/README\")

Scp-np ~/eev-videos/video{stem}.mp4 \\
  edrx@angg.twu.net:/home/edrx/slow_html/eev-videos/



\(defun e () (interactive) (find-angg  \"eev-videos/2.sh\"))
\(defun r () (interactive) (find-sh0 \"~/eev-videos/2.sh record\"))
\(defun k () (interactive) (message \"%s\" (find-sh0 \"killall -v ffmpeg\")))
;;
\(defun ev () (interactive)
  (find-3L '(find-angg \"eev-videos/0.sh\") '(find-angg \"eev-videos/2.sh\")))
\(defun ee () (interactive)
  (find-3L '(find-angg  \"eev-videos/2.sh\") '(find-eev \"eev-readme.el\")))
\(defun eee () (interactive)
  (find-wset '\"13_o2_o_o\"
	     '(find-angg \"eev-videos/2.sh\")
	     '(find-eev  \"eev-readme.el\")
	     '(find-angg \"eev-videos/2.el\")
	     ))

# (find-eev \"eev-readme.el\")
# (find-zsh0 \"eev2-build-tgz && cp -v ~/eev-videos/2.el /tmp/\")
# (find-angg  \"eev-videos/0.sh\")
# (find-angg  \"eev-videos/2.sh\")
# (find-angg  \"eev-videos/2.el\")

# (find-es \"ffmpeg\" \"avconv\")
# Edit scripts
# (find-file \"~/eev-videos/video2-pt-video.mp4\")
# (find-fline \"/tmp/pen/VOICE/FOLDER01/\")


# (find-angg  \"eev-videos/\")

# (find-mplayer \"/tmp/out.mp4\")
")
     )
   pos-spec-list))

;; A test: (find-eev-video-record-links "2pt")



;; «find-eev-create-tar-links»  (to ".find-eev-create-tar-links")
;; Skel: (find-find-links-links-new "eev-create-tar" "date" "")
;; Test: (find-eev-create-tar-links)
;;
(defun find-eev-create-tar-links (&optional date &rest pos-spec-list)
"Visit a temporary buffer containing hyperlinks for eev-create-tar."
  (interactive)
  (setq date (or date "{date}"))
  (apply
   'find-elinks
   `((find-eev-create-tar-links ,date ,@pos-spec-list)
     (find-eev-create-tar-links "20201022")
     ;; Convention: the first sexp always regenerates the buffer.
     (find-efunction 'find-eev-create-tar-links)
     ""
     ,(ee-template0 "\
# http://elpa.gnu.org/packages/eev.html
# http://elpa.gnu.org/packages/eev-20201013.tar
# (find-eev2-links)

* (eepitch-shell)
* (eepitch-kill)
* (eepitch-shell)
rm -Rfv /tmp/eev-g
mkdir   /tmp/eev-g/
cd      /tmp/eev-g/ && git clone https://github.com/edrx/eev.git .
cd      /tmp/eev-g/
git checkout UTF-8

rm -Rfv  /tmp/eev-tar/
mkdir -p /tmp/eev-tar/eev-{date}/
cd       /tmp/eev-tar/eev-{date}/
cp -iv  /tmp/eev-g/* .
rm -v    /tmp/eev-tar/eev-{date}/ChangeLog
cd       /tmp/eev-tar/
tar -cvf /tmp/eev-tar/eev-{date}.tar eev-{date}/
Scp-np   /tmp/eev-tar/eev-{date}.tar edrx@angg.twu.net:public_html/tmp/
# (find-fline \"/tmp/eev-tar/eev-{date}.tar\")


* (eepitch-shell)
* (eepitch-kill)
* (eepitch-shell)
rm -fv /tmp/eev-{date}.tar
cd     /tmp/
wget  http://angg.twu.net/tmp/eev-{date}.tar
# (package-install-file \"/tmp/eev-{date}.tar\")
")
     )
   pos-spec-list))




;; «find-screencast-links» (to ".find-screencast-links")
;; (find-find-links-links "{k}" "screencast" "geom")
;; A test: (find-screencast-links)

(defun find-screencast-links (&optional geom &rest pos-spec-list)
"Visit a temporary buffer containing hyperlinks for foo."
  (interactive)
  ;; (setq geom (or geom "{geom}"))
  (setq geom (or geom (frame-width-height)))
  (apply 'find-elinks
   `((find-screencast-links ,geom ,@pos-spec-list)
     ;; Convention: the first sexp always regenerates the buffer.
     (find-efunction 'find-screencast-links)
     ""
     (defalias 'r 'ee-scast-start)
     (defalias 's 'ee-scast-stop)
     (find-fline "/tmp/" "out.mp4")
     (find-video "/tmp/out.mp4")
     ""
     (frame-width--)
     (frame-width++)
     (frame-height--)
     (frame-height++)
     (frame-width-height)
     (frame-width-height-set " 80c 37c")
     (frame-width-height-set "167c 46c")
     (frame-width-height-set "108c 37c")
     )
   pos-spec-list))




;; «find-angg-upload-links» (to ".find-angg-upload-links")
;; «find-blogme-upload-links» (to ".find-blogme-upload-links")
;; «find-escript-upload-links» (to ".find-escript-upload-links")
;; (find-find-links-links "<none>" "blogme-upload" "stem")
;; A test: (find-blogme-upload-links "2012.1")

;; (find-eapropos "suffix")

(defalias 'bup 'find-blogme-upload-links)

(defun find-blogme-upload-links (&optional stem &rest pos-spec-list)
"Visit a temporary buffer containing hyperlinks for foo."
  (interactive)
  ;; (ee-rmprefix "~/TH/" "~/THfname "")
  (setq stem (or stem "{stem}"))
  (apply 'find-elinks
   `((find-blogme-upload-links ,stem ,@pos-spec-list)
     ;; Convention: the first sexp always regenerates the buffer.
     (find-efunction 'find-blogme-upload-links)
     (find-TH ,stem)
     ,(ee-template0 "
* (eepitch-shell)
* (eepitch-kill)
* (eepitch-shell)
# makeR
# touch ~/TH/{stem}.blogme
makeR1     {stem}.html
Scp-np     {stem}.html      $TWUP/{stem}.html

Scp-np  TH/{stem}.blogme $TWUP/TH/{stem}.blogme
#    http://angg.twu.net/{stem}.html
# file:///home/edrx/TH/R/{stem}.html")
     )
   pos-spec-list))

(defun find-angg-upload-links (&optional dir stem &rest pos-spec-list)
"Visit a temporary buffer containing hyperlinks for foo."
  (interactive)
  ;; (ee-rmprefix "~/TH/" "~/THfname "")
  (setq dir (or dir "{stem}"))
  (setq stem (or stem "{stem}"))
  (apply 'find-elinks
   `((find-angg-upload-links ,dir ,stem ,@pos-spec-list)
     ;; Convention: the first sexp always regenerates the buffer.
     (find-efunction 'find-angg-upload-links)
     ;; (find-angg ,stem)
     ,(ee-template0 "
* (eepitch-shell)
* (eepitch-kill)
* (eepitch-shell)
# makeR
# touch ~/TH/{stem}.blogme
makeL1 {dir}{stem}.html
makeR1 {dir}{stem}.html
Scp-np {dir}{stem} {dir}{stem}.html $TWUP/{dir}

#    http://angg.twu.net/{dir}{stem}.html
#    http://angg.twu.net/{dir}{stem}
# file:///home/edrx/TH/L/{dir}{stem}.html
# file:///home/edrx/TH/R/{dir}{stem}.html")
     )
   pos-spec-list))



;; «find-a2html-upload-links» (to ".find-a2html-upload-links")
;; (find-blogme3 "options.lua" "dooptions")
;; (find-blogme3 "options.lua" "dooptions" "dooption_a2html")
;; (find-a2html-upload-links "blogme3/options.lua" "dooptions")
;;
(defalias 'aup 'find-a2html-upload-links)

(defun find-a2html-upload-links (&optional stem tag &rest pos-spec-list)
"Visit a temporary buffer containing a script to upload an ascii file to angg."
  (interactive)
  (setq stem (or stem
		 (ee-rmprefix "~/" (ee-fname-here))
		 "{stem}"))
  (setq tag (or tag "{tag}"))
  (apply 'find-elinks
   `((find-a2html-upload-links ,stem ,tag ,@pos-spec-list)
     (find-a2html-upload-links ,stem ,(ee-last-kill-matches "^[!-~]+$"))
     ;; Convention: the first sexp always regenerates the buffer.
     (find-efunction 'find-a2html-upload-links)
     (find-angg ,stem ,tag)
     (find-angg ,stem)
     ,(ee-template0 "
* (eepitch-shell)
* (eepitch-kill)
* (eepitch-shell)
# makeR
# touch ~/{stem}
makeR1  {stem}.html
Scp-np  {stem}.html $TWUP/{stem}.html
Scp-np  {stem}      $TWUP/{stem}
#    http://angg.twu.net/{stem}.html
# file:///home/edrx/TH/R/{stem}.html
#    http://angg.twu.net/{stem}.html#{tag}
# file:///home/edrx/TH/R/{stem}.html#{tag}

# (find-angg \"{stem}\" \"{tag}\")
# (find-anggwgeta \"{stem}\" \"{tag}\")
")
     )
   pos-spec-list))



;; «find-escript-upload-links» (to ".find-escript-upload-links")
;; (find-find-links-links "<none>" "escript-upload" "stem")
;; A test: (find-escript-upload-links "python")

(defalias 'eup 'find-escript-upload-links)

(defun find-escript-upload-links (&optional stem tag &rest pos-spec-list)
"Visit a temporary buffer containing hyperlinks for foo."
  (interactive)
  ;; (setq stem (or stem "{stem}"))
  (setq stem (or stem
		 (ee-rmprefixsuffix "~/e/" ".e" (ee-fname-here))
		 "{stem}"))
  (setq tag (or tag "{tag}"))
  (apply 'find-elinks
   `((find-escript-upload-links ,stem ,tag ,@pos-spec-list)
     (find-escript-upload-links ,stem ,(ee-last-kill-matches "^[!-~]+$"))
     ;; Convention: the first sexp always regenerates the buffer.
     (find-efunction 'find-escript-upload-links)
     (find-es ,stem)
     (find-es ,stem ,tag)
     ,(ee-template0 "
* (eepitch-shell)
* (eepitch-kill)
* (eepitch-shell)
# makeR
# touch ~/e/{stem}.e
makeR1  e/{stem}.e.html
Scp-np  e/{stem}.e.html $TWUP/e/{stem}.e.html
Scp-np  e/{stem}.e      $TWUP/e/{stem}.e
#    http://angg.twu.net/e/{stem}.e.html
# file:///home/edrx/TH/R/e/{stem}.e.html
#    http://angg.twu.net/e/{stem}.e.html#{tag}
# file:///home/edrx/TH/R/e/{stem}.e.html#{tag}

# (find-es \"{stem}\" \"{tag}\")
# (find-angg \"e/{stem}.e\" \"{tag}\")
# (find-anggwgeta \"e/{stem}.e\" \"{tag}\")
")
     )
   pos-spec-list))

;; «find-latex-upload-links» (to ".find-latex-upload-links")
;; (find-find-links-links "{k}" "latex-upload" "stem")
;; A test: (find-latex-upload-links "2015-2-GA-material")

(defun find-latex-upload-links (&optional stem dir)
"Visit a temporary buffer containing hyperlinks for foo."
  (interactive)
  (setq stem (or stem "{stem}"))
  (setq dir (or dir "/tmp/edrx-latex/"))
  (find-elinks
   `((find-latex-upload-links ,stem ,dir)
     ;; Convention: the first sexp always regenerates the buffer.
     (find-efunction 'find-latex-upload-links)
     ""
     ,(ee-template0 "\
* (eepitch-shell)
* (eepitch-kill)
* (eepitch-shell)
# Upload pdf
cd ~/LATEX/
Scp-np {stem}.pdf $TWUP/LATEX/{stem}.pdf
Scp-np {stem}.pdf $TWUS/LATEX/{stem}.pdf
# Test the pdf (open the urls in a browser):
# (find-pdf-page   \"~/LATEX/{stem}.pdf\")
# http://angg.twu.net/LATEX/{stem}.pdf
#   file:///home/edrx/LATEX/{stem}.pdf

# Make .tgz and upload it
cd ~/LATEX/
flsfiles-tgz {stem}.fls {stem}.tgz
Scp-np {stem}.tgz $TWUP/LATEX/{stem}.tgz
Scp-np {stem}.tgz $TWUS/LATEX/{stem}.tgz
# http://angg.twu.net/LATEX/{stem}.tgz

# Make .zip and upload it
cd ~/LATEX/
flsfiles-zip {stem}.fls {stem}.zip
Scp-np {stem}.zip $TWUP/LATEX/{stem}.zip
Scp-np {stem}.zip $TWUS/LATEX/{stem}.zip
# http://angg.twu.net/LATEX/{stem}.zip

# Test the .tgz.
# The e-script below downloads, unpacks and compiles the .tgz in {dir}
#
rm -rfv /tmp/{stem}.tgz
rm -rfv {dir}
cd /tmp/
wget http://angg.twu.net/LATEX/{stem}.tgz
# curl -O http://angg.twu.net/LATEX/{stem}.tgz
# cp -v ~/LATEX/{stem}.zip .
mkdir  {dir}
tar -C {dir} -xvzf /tmp/{stem}.tgz
cd     {dir}
lualatex {stem}.tex
# (find-fline    \"{dir}\")
# (find-pdf-page \"{dir}{stem}.pdf\")
# (find-pdf-text \"{dir}{stem}.pdf\")

# Test the .zip.
# The e-script below downloads, unpacks and compiles the .zip in {dir}
#
rm -rfv /tmp/{stem}.zip
rm -rfv {dir}
cd /tmp/
wget http://angg.twu.net/LATEX/{stem}.zip
# cp -v ~/LATEX/{stem}.zip .
mkdir    {dir}
unzip -d {dir} /tmp/{stem}.zip
cd       {dir}
lualatex {stem}.tex
# (find-fline    \"{dir}\")
# (find-pdf-page \"{dir}{stem}.pdf\")
# (find-pdf-text \"{dir}{stem}.pdf\")

% (defun u () (interactive) (find-latex-upload-links \"{stem}\"))
")
     )))



;; «find-book-links» (to ".find-book-links")
;;
(defun ee-dired-to-fname0 ()
  (and (eq major-mode 'dired-mode)
       (file-name-nondirectory (ee-dired-to-fname))))

(defun find-book-links (&optional fmt dir fname author stem &rest pos-spec-list)
"Visit a temporary buffer containing hyperlinks for foo."
  (interactive (list nil nil (and (ee-dired-to-fname0))))
  (setq fmt (or fmt "pdf"))
  (setq dir (or dir "{dir}"))
  (setq fname (or fname "{fname}"))
  (setq author (or author "{author}"))
  (setq stem (or stem "{stem}"))
  (apply 'find-elinks
   `((find-book-links ,fmt ,dir ,fname ,author ,stem)
     (find-book-links "djvu" ,dir ,fname ,author ,stem)
     (find-book-links ,fmt "__alg"      ,fname ,author ,stem)
     (find-book-links ,fmt "__etc"      ,fname ,author ,stem)
     (find-book-links ,fmt "__cats"     ,fname ,author ,stem)
     (find-book-links ,fmt "__comp"     ,fname ,author ,stem)
     (find-book-links ,fmt "__phil"     ,fname ,author ,stem)
     (find-book-links ,fmt "__logic"    ,fname ,author ,stem)
     (find-book-links ,fmt "__small"    ,fname ,author ,stem)
     (find-book-links ,fmt "__gender"   ,fname ,author ,stem)
     (find-book-links ,fmt "__shibari"  ,fname ,author ,stem)
     (find-book-links ,fmt "__physics"  ,fname ,author ,stem)
     (find-book-links ,fmt "__analysis" ,fname ,author ,stem)
     (find-book-links ,fmt "__discrete" ,fname ,author ,stem)
     (find-book-links ,fmt "__politics" ,fname ,author ,stem)
     ;; Convention: the first sexp always regenerates the buffer.
     (find-efunction 'find-book-links)
     ""
     ,(ee-template0 "\
# (find-efunction 'find-book-links)
# (find-books \"{dir}/{dir}.el\")
# (find-books \"{dir}/{dir}.el\" \"{author}\")

# (find-sh0 \"mv -iv {fname} ~/books/{dir}/\")
# (ee-copy-rest 1 ' (find-angg \"books/{dir}/{dir}.el\"))

;; <{author}>
;; (find-books \"{dir}/{dir}.el\" \"{author}\")
\(code-{fmt}-page \"{stem}\" \"~/books/{dir}/{fname}\")
\(code-{fmt}-text \"{stem}\" \"~/books/{dir}/{fname}\" 1)
;; (find-{stem}page)
;; (find-{stem}page        1  \"Contents\")
;; (find-{stem}page (+ 1 189) \"Index\")
;; (find-{stem}text \"\")
")
     )
   pos-spec-list))

;; (find-book-links)




;; «find-lua-links» (to ".find-lua-links")
;; (find-find-links-links "{k}" "lua" "fname")
;;
;; Test: (find-sh0 "rm -v /tmp/foo.lua")
;;       (find-lua-links "/tmp/foo.lua")
;;
(defun find-lua-links (&optional fname &rest pos-spec-list)
"Visit a temporary buffer containing hyperlinks for foo."
  (interactive)
  (setq fname (or fname "{fname}"))
  (let ((dir    (file-name-directory    fname))
	(fname0 (file-name-nondirectory fname)))
    (find-elinks
     `((find-lua-links ,fname ,@pos-spec-list)
       (find-lua-links "~/LUA/foo.lua")
       ;; Convention: the first sexp always regenerates the buffer.
       (find-efunction 'find-lua-links)
       ""
       (find-fline ,dir ,fname0)
       (find-sh0 ,(format "touch %s && chmod 755 %s" fname fname))
       ""
       (ee-copy-rest 1 '(find-fline ,fname))
       ""
       ,(ee-template0 "\
#!/usr/bin/env lua5.1
-- (defun c () (interactive) (find-sh \"cd {dir}; ./{fname0}\"))
-- (defun d () (interactive) (find-fline \"{dir}\"))
-- (defun e () (interactive) (find-fline \"{fname}\"))
--
-- (find-sh \"./{fname0} arg1 arg2\")
--
-- (find-lua51manual \"\")
-- (find-pil2page 8 \"Contents\")
-- (find-pil2text 8 \"Contents\")
-- (find-fline \"~/LUA/lua50init.lua\")

print(\"Hello from {fname}\")

--[[
* (eepitch-lua51)
* (eepitch-kill)
* (eepitch-lua51)
dofile \"{fname0}\"

--]]\
")
     ))))


;; Test: (find-lua-links "~/LUA/foo.lua")


(defun find-lua-links-old (&optional fname &rest pos-spec-list)
"Visit a temporary buffer containing hyperlinks for foo."
  (interactive)
  (setq fname (or fname "{fname}"))
  (let ((fname- (file-name-nondirectory fname)))
    (apply 'find-elinks
     `((find-lua-links ,fname ,@pos-spec-list)
       ;; Convention: the first sexp always regenerates the buffer.
       (find-efunction 'find-lua-links)
       ""
       (kill-new ,fname)
       (find-blogme3 "anggmake.lua" "anggtranslate")
       ""
       (ee-copy-rest 1 '(find-angg ,fname))
       ""
       ,(ee-template0 "\
-- This file:
-- http://angg.twu.net/{fname}
-- http://angg.twu.net/{fname}.html
--  (find-angg        \"{fname}\")
--
-- (find-lua51manualw3m \"\")
-- (find-books \"__comp/__comp.el\" \"ierusalimschy\")
-- (find-pil2page 8 \"Contents\")
-- (find-pil2text 8 \"Contents\")

--[[
* (eepitch-lua51)
* (eepitch-kill)
* (eepitch-lua51)
dofile \"{fname-}\"

--]]


-- Local Variables:
-- coding: raw-text-unix
-- End:
")
       )
     pos-spec-list)))

;; Test: (find-lua-links)
;; (find-lua-links "LUA/youtube.lua")



;; «find-scast-links» (to ".find-scast-links")
;; (find-find-links-links "{k}" "scast" "prep stem sexp")
;; A test: (find-scast-links "R=6" "git-animations" '(find-es "git" "git-animations"))

(defun find-scast-links (&optional prep stem sexp &rest pos-spec-list)
"Visit a temporary buffer containing hyperlinks for foo."
  (interactive)
  (setq prep (or prep "{prep}"))
  (setq stem (or stem "{stem}"))
  (setq sexp (or sexp "{sexp}"))
  (apply 'find-elinks
   `((find-scast-links ,prep ,stem ,sexp ,@pos-spec-list)
     (find-scast-links "R=6;r" ,stem ,sexp ,@pos-spec-list)
     ;; Convention: the first sexp always regenerates the buffer.
     (find-efunction 'find-scast-links)
     ""
     ,(ee-template0 "\

\(scast \"k\")

\(progn
  (scast \"R=6;c;g\")
  {(ee-S sexp)}
  )

\(scast \"k\")

# (find-video \"/tmp/out.mp4\")
# file:///tmp/out.mp4
#
# (find-fline \"~/screencasts/\" \"{stem}.mp4\")
# (find-sh0 \"cp -v /tmp/out.mp4 ~/screencasts/{stem}.mp4\")
#    (find-video \"~/screencasts/{stem}.mp4\"
# file:///home/edrx/screencasts/{stem}.mp4

# http://angg.twu.net/screencasts/
# http://angg.twu.net/screencasts/{stem}.mp4

")
     )
   pos-spec-list))

;; Test: (find-scast-links ___)




;; «find-python-links» (to ".find-python-links")
;; (find-find-links-links "{k}" "python" "dir fname")
;; A test: (find-python-links ___)

(defun find-python-links (&optional dir fname &rest pos-spec-list)
"Visit a temporary buffer containing hyperlinks for foo."
  (interactive)
  (setq dir (or dir "{dir}"))
  (setq fname (or fname "{fname}"))
  (apply 'find-elinks
   `((find-python-links ,dir ,fname ,@pos-spec-list)
     ;; Convention: the first sexp always regenerates the buffer.
     (find-efunction 'find-python-links)
     ""
     (kill-new ,(concat "  " dir fname "\n"))
     (find-blogme3 "anggmake.lua" "anggtranslate")
     (ee-copy-rest 1 '(find-angg ,(concat dir fname)))
     ""
     ,(ee-template0 "\
# vim: set fileencoding=latin-1 :
# This file:
# http://angg.twu.net/{dir}{fname}
# http://angg.twu.net/{dir}{fname}.html
#  (find-angg        \"{dir}{fname}\")
#
# Edrx:
# (defun p  () (interactive) (find-angg \"{dir}{fname}\"))
# (defun pu () (interactive) (find-angg \"{dir}{fname}\" \"upload\"))
#
# Tau:
# (defun p  () (interactive) (find-fline \"/tmp/{fname}\"))
# (defun d  () (interactive) (find-sh \"cd /tmp/ && wget -O {fname} http://angg.twu.net/{dir}{fname}\"))
# (defun w  () (interactive) (find-wget \"http://angg.twu.net/{dir}{fname}\"))
#
# file:///usr/share/doc/python2.7/html/howto/regex.html
# file:///usr/share/doc/python2.7/html/reference/executionmodel.html

\"\"\"
* (eepitch-python)
* (eepitch-kill)
* (eepitch-python)
execfile(\"{fname}\", globals())
\"\"\"

\"\"\"
# <upload>
* (eepitch-shell)
* (eepitch-kill)
* (eepitch-shell)
makeR1 {dir}{fname}.html
Scp-np {dir}{fname}.html {dir}{fname} $TWUP/{dir}
# http://angg.twu.net/{dir}{fname}.html
\"\"\"

# Local Variables:
# coding: raw-text-unix
# End:
")
     )
   pos-spec-list))

;; Test: (find-python-links "foo/" "bar.py")
;; Test: (find-python-links "fbcache/" "q.py")



;; «find-fbc-links» (to ".find-fbc-links")
;; (find-find-links-links "{k}" "fbc" "id")
;; Test: (find-fbc-links "1412988905624743")
;;
(defun find-fbc-links (&optional id &rest pos-spec-list)
"Visit a temporary buffer containing hyperlinks for Python-fbcache."
  (interactive "sId: ")
  (setq id (or id "{id}"))
  (apply 'find-elinks
   `((find-fbc-links ,id)
     (find-fbc-links "1412988905624743")
     (find-fbcacheluafile ,id)
     ;; Convention: the first sexp always regenerates the buffer.
     (find-angg "fbcache/urls.lua" "prubyks")
     (find-angg ".pythonrc.py")
     (find-efunction 'find-fbc-links)
     ""
     ,(ee-template0 "\
* (eepitch-python)
* (eepitch-kill)
* (eepitch-python)
o = ggo(\"{id}\")
type(o)
o.keys()
o['description'][:1000]
o['message'][:1000]
")
     )
   pos-spec-list))

;; Test: (find-fbc-links "1412988905624743")





;; «find-lualatex-links» (to ".find-lualatex-links")
;; (find-find-links-links "{k}" "lualatex" "stem tla")
;; Tests: (find-lualatex-links)
;;        (find-lualatex-links "2022yoneda-pseudocode" "yps")

(defun find-lualatex-links (&optional stem tla &rest pos-spec-list)
"Visit a temporary buffer containing hyperlinks for foo."
  (interactive)
  (setq stem (or stem "{stem}"))
  (setq tla (or tla "{tla}"))
  (apply 'find-elinks
   `((find-lualatex-links ,stem ,tla ,@pos-spec-list)
     ;; Convention: the first sexp always regenerates the buffer.
     (find-efunction 'find-lualatex-links)
     ""
     (kill-new ,(concat "  LATEX/" stem ".tex\n"))
     (find-blogme3 "anggmake.lua" "anggtranslate")
     (find-blogme3 "anggmake.lua" "anggtranslate" "LATEX/")
     (find-blogme3 "anggmake.lua" "anggtranslate" "LATEX/2019.mk")
     ""
     (find-eeshortdefs)
     (code-etex-tla ,tla ,stem)
     ""
     (ee-copy-rest 1 '(find-LATEX ,(concat stem ".tex")))
     ""
     ,(ee-template0 "\
% (find-LATEX \"{stem}.tex\")
% (defun c () (interactive) (find-LATEXsh \"lualatex -record {stem}.tex\" :end))
% (defun C () (interactive) (find-LATEXSH \"lualatex {stem}.tex\" \"Success!!!\"))
% (defun D () (interactive) (find-pdf-page      \"~/LATEX/{stem}.pdf\"))
% (defun d () (interactive) (find-pdftools-page \"~/LATEX/{stem}.pdf\"))
% (defun e () (interactive) (find-LATEX \"{stem}.tex\"))
% (defun u () (interactive) (find-latex-upload-links \"{stem}\"))
% (defun v () (interactive) (find-2a '(e) '(d)))
% (defun cv () (interactive) (C) (ee-kill-this-buffer) (v) (g))
% (defun d0 () (interactive) (find-ebuffer \"{stem}.pdf\"))
%          (code-eec-LATEX \"{stem}\")
% (find-pdf-page   \"~/LATEX/{stem}.pdf\")
% (find-sh0 \"cp -v  ~/LATEX/{stem}.pdf /tmp/\")
% (find-sh0 \"cp -v  ~/LATEX/{stem}.pdf /tmp/pen/\")
%   file:///home/edrx/LATEX/{stem}.pdf
%               file:///tmp/{stem}.pdf
%           file:///tmp/pen/{stem}.pdf
% http://angg.twu.net/LATEX/{stem}.pdf
% (find-LATEX \"2019.mk\")
% (find-lualatex-links \"{stem}\" \"{tla}\")")
     ;;
     "
\\documentclass[oneside,12pt]{article}
\\usepackage[colorlinks,citecolor=DarkRed,urlcolor=DarkRed]{hyperref} % (find-es \"tex\" \"hyperref\")
\\usepackage{amsmath}
\\usepackage{amsfonts}
\\usepackage{amssymb}
\\usepackage{pict2e}
\\usepackage[x11names,svgnames]{xcolor} % (find-es \"tex\" \"xcolor\")
%\\usepackage{colorweb}                 % (find-es \"tex\" \"colorweb\")
%\\usepackage{tikz}
%
% (find-dn6 \"preamble6.lua\" \"preamble0\")
%\\usepackage{proof}   % For derivation trees (\"%:\" lines)
%\\input diagxy        % For 2D diagrams (\"%D\" lines)
%\\xyoption{curve}     % For the \".curve=\" feature in 2D diagrams
%
\\usepackage{edrx21}               % (find-LATEX \"edrx21.sty\")
\\input edrxaccents.tex            % (find-LATEX \"edrxaccents.tex\")
\\input edrx21chars.tex            % (find-LATEX \"edrx21chars.tex\")
\\input edrxheadfoot.tex           % (find-LATEX \"edrxheadfoot.tex\")
\\input edrxgac2.tex               % (find-LATEX \"edrxgac2.tex\")
%\\input 2017planar-has-defs.tex    % (find-LATEX \"2017planar-has-defs.tex\")
%
%\\usepackage[backend=biber,
%   style=alphabetic]{biblatex}            % (find-es \"tex\" \"biber\")
%\\addbibresource{catsem-slides.bib}        % (find-LATEX \"catsem-slides.bib\")
%
% (find-es \"tex\" \"geometry\")
\\begin{document}

\\catcode`\\^^J=10
\\directlua{dofile \"dednat6load.lua\"}  % (find-LATEX \"dednat6load.lua\")

% %L dofile \"edrxtikz.lua\"  -- (find-LATEX \"edrxtikz.lua\")
% %L dofile \"edrxpict.lua\"  -- (find-LATEX \"edrxpict.lua\")
% \\pu

%\\printbibliography

\\GenericWarning{Success:}{Success!!!}  % Used by `M-x cv'

\\end{document}
"
     ,(ee-template0 "\
%  __  __       _        
% |  \\/  | __ _| | _____ 
% | |\\/| |/ _` | |/ / _ \\
% | |  | | (_| |   <  __/
% |_|  |_|\\__,_|_|\\_\\___|
%                        
% <make>

* (eepitch-shell)
* (eepitch-kill)
* (eepitch-shell)
# (find-LATEXfile \"2019planar-has-1.mk\")
make -f 2019.mk STEM={stem} veryclean
make -f 2019.mk STEM={stem} pdf

% Local Variables:
% coding: utf-8-unix
% ee-tla: \"{tla}\"
% End:
")
     ) pos-spec-list))





;; «find-dlualatex-links» (to ".find-lualatex-links")
;; (find-find-links-links "{k}" "dlualatex" "stem")
;; A test: (find-dlualatex-links)

(defun find-dlualatex-links (&optional stem &rest pos-spec-list)
"Visit a temporary buffer containing hyperlinks for foo."
  (interactive)
  (setq stem (or stem "{stem}"))
  (apply 'find-elinks
   `((find-dlualatex-links ,stem ,@pos-spec-list)
     ;; Convention: the first sexp always regenerates the buffer.
     (find-efunction 'find-dlualatex-links)
     ""
     (kill-new ,(concat "  dednat6/" stem ".tex\n"))
     (find-blogme3 "anggmake.lua" "anggtranslate")
     (find-blogme3 "anggmake.lua" "anggtranslate" " dednat6/")
     (ee-copy-rest 1 '(find-dednat6 ,(concat stem ".tex")))
     ""
     ,(ee-template0 "\
% (find-angg \"dednat6/{stem}.tex\")
% (defun c () (interactive) (find-dednat6sh \"lualatex -record {stem}.tex\"))
% (defun d () (interactive) (find-pdf-page \"~/dednat6/{stem}.pdf\"))
% (defun e () (interactive) (find-dednat6 \"{stem}.tex\"))
% (defun u () (interactive) (find-latex-upload-links \"{stem}\"))
% (find-pdf-page   \"~/dednat6/{stem}.pdf\")
% (find-sh0 \"cp -v  ~/dednat6/{stem}.pdf /tmp/\")
% (find-sh0 \"cp -v  ~/dednat6/{stem}.pdf /tmp/pen/\")
%   file:///home/edrx/dednat6/{stem}.pdf
%                 file:///tmp/{stem}.pdf
%             file:///tmp/pen/{stem}.pdf
% http://angg.twu.net/dednat6/{stem}.pdf")
     ;;
     "\
\\documentclass[oneside]{book}
\\usepackage[colorlinks]{hyperref} % (find-es \"tex\" \"hyperref\")
\\usepackage{amsmath}
\\usepackage{amsfonts}
\\usepackage{amssymb}
\\usepackage{pict2e}
\\usepackage[x11names,svgnames]{xcolor} % (find-es \"tex\" \"xcolor\")
%\\usepackage{tikz}
%
% (find-dn6 \"preamble6.lua\" \"preamble0\")
%\\usepackage{proof}   % For derivation trees (\"%:\" lines)
%\\input diagxy        % For 2D diagrams (\"%D\" lines)
%\\xyoption{curve}     % For the \".curve=\" feature in 2D diagrams
%
\\begin{document}

\\catcode`\\^^J=10
\\directlua{dofile \"dednat6load.lua\"}  % (find-LATEX \"dednat6load.lua\")

\\end{document}

% Local Variables:
% coding: utf-8-unix
% End:"
     ) pos-spec-list))








;; «find-br-links» (to ".find-br-links")
;; (find-find-links-links "{key}" "br" "fun stem")
;; Test: (find-br-links "find-fline" "f")

(defun find-br-links (&optional fun stem)
"Visit a temporary buffer containing hyperlinks for foo."
  (interactive)
  (setq fun (or fun "{fun}"))
  (setq stem (or stem "{stem}"))
  (find-elinks
   `((find-br-links ,fun ,stem)
     ;; Convention: the first sexp always regenerates the buffer.
     (find-efunction 'find-br-links)
     ""
     ,(ee-template0 "\
;; (find-code-brurl '{fun} :remote 'br{stem} :local 'br{stem}l :dired 'br{stem}d)
;; (find-code-brfile '{fun} :local 'br{stem}l)

\(code-brurl '{fun} :remote 'br{stem} :local 'br{stem}l :dired 'br{stem}d)
\(code-brfile '{fun} :local 'br{stem}l)
")
     )))





;; «find-pastebin-links» (to ".find-pastebin-links")
;; (find-es "emacs" "pastebin")
;;
(defun find-pastebin-links (&optional a &rest pos-spec-list)
"Visit a temporary buffer containing hyperlinks for foo."
  (interactive)
  (setq a (or a "{a}"))
  (apply 'find-elinks
   `((find-pastebin-links ,a ,@pos-spec-list)
     ;; Convention: the first sexp always regenerates the buffer.
     (find-efunction 'find-pastebin-links)
     ""
     ,(ee-template0 "\
# <ecbrown> edrx: ,,pastebin
# http://emacswiki.org/wiki/pastebin
# http://paste.lisp.org/new
# see also <lisppaste>, <pastebin.el>
# https://www.emacswiki.org/emacs/download/pastebin.el
")
     )
   pos-spec-list))

;; Test: (find-pastebin-links)








;; «find-matplotlib-links»  (to ".find-matplotlib-links")
;; (find-find-links-links "{k}" "matplotlib" "subdir name")
;; (find-matplotlibexfile "mplot3d/")
;; Test: (find-matplotlib-links "mplot3d" "wire3d_animation_demo")

(defun find-matplotlib-links (&optional subdir name &rest pos-spec-list)
"Visit a temporary buffer containing hyperlinks for matplotlib."
  (interactive)
  (setq subdir (or subdir "{subdir}"))
  (setq name (or name "{name}"))
  (let* ((origfname (format "/usr/share/doc/python-matplotlib-doc/examples/%s/%s.py"
			    subdir name))
	 (bigstr (ee-read-file origfname))
	 )
    (apply 'find-elinks
     `((find-matplotlib-links ,subdir ,name ,@pos-spec-list)
       ;; Convention: the first sexp always regenerates the buffer.
       (find-efunction 'find-matplotlib-links)
       ""
       ,(ee-template0 "\
# (ee-copy-rest 1 '(find-angg \"MATPLOTLIB/{name}.py\"))

# This file: (find-angg \"MATPLOTLIB/{name}.py\")
# (find-matplotlib-links \"{subdir}\" \"{name}\")
# (find-es \"python\" \"matplotlib-examples\")
# (find-matplotlibexfile \"{subdir}/\")
# (find-matplotlibexfile \"{subdir}/{name}.py\")
# file:///usr/share/doc/python-matplotlib-doc/html/gallery.html#{subdir}
# file:///usr/share/doc/python-matplotlib-doc/html/examples/{subdir}/{name}.html

* (eepitch-python3)
* (eepitch-kill)
* (eepitch-python3)
{bigstr}
")
       )
     pos-spec-list)
    (python-mode)
    ))

;; Test: (find-matplotlib-links "mplot3d" "wire3d_animation_demo")


;; (defun ee-matplotlib-subdir (&optional fname)
;;   (car (ee-matplotlib-split (or fname (ee-dired-to-fname)))))
;; 
;; (defun ee-matplotlib-name (&optional fname)
;;   (cadr (ee-matplotlib-split (or fname (ee-dired-to-fname)))))

(defun ee-matplotlib-subdir (&optional fname) (car (ee-matplotlib-split fname)))
(defun ee-matplotlib-name  (&optional fname) (cadr (ee-matplotlib-split fname)))
(defun ee-matplotlib-split (fname)
  (setq fname (replace-regexp-in-string "\\(\\.py\\|\\.html\\)$" "" fname))
  (if (string-match "^.*/\\([^/]+\\)/\\([^/]+\\)$" fname)
      (list (match-string 1 fname)
	    (match-string 2 fname))
    (error "Not a matplotlib thing: %s fname")))

(defun find-matplotlib-file (fname)
  (interactive (list (ee-dired-to-fname)))
  (find-matplotlib-links (ee-matplotlib-subdir fname) (ee-matplotlib-name fname)))

(code-brfile 'find-matplotlib-file  :dired 'brmpd)

;; Test: go here and type M-x brmpd on a file:
;; (find-matplotlibexfile "mplot3d/")

;; (setq mystr "/usr/share/doc/python-matplotlib-doc/examples/mplot3d/2dcollections3d_demo.py")
;; (ee-matplotlib-split mystr)





;; «find-C-links»  (to ".find-C-links")
;; (find-find-links-links "{k}" "C" "fname")
;; (find-C-links)

(defun find-C-links (&optional stem &rest pos-spec-list)
"Visit a temporary buffer containing hyperlinks for foo."
  (interactive)
  (setq stem (or stem "{stem}"))
  (let* ((stem stem))
    (apply 'find-elinks
     `((find-C-links ,stem ,@pos-spec-list)
       ;; Convention: the first sexp always regenerates the buffer.
       (find-efunction 'find-C-links)
       ""
       ,(ee-template0 "\
# (find-C-links \"{stem}\")
# (find-C-links \"/tmp/test\")

# (ee-copy-rest 1 '(find-fline \"{stem}.c\"))

/*
// (defun c () (interactive) (find-sh \"gcc -o {stem} {stem}.c\"))
// (defun e () (interactive) (find-fline \"{stem}.c\"))
// (find-libcnode \"Function Index\" \" printf:\")
*/

#include <stdio.h>
#include <stdlib.h>

int main()
{<}
  return 0;
{>}

/*
* (eepitch-shell)
* (eepitch-kill)
* (eepitch-shell)
gcc -o {stem} {stem}.c

*/
")
       )
     pos-spec-list)))




;; «find-luarocks-links»  (to ".find-luarocks-links")
;; Test: (find-luarocks-links)
;;       (find-luarocks-links "ltcltk" "0.9-1")
;;       (find-luarocks-links "lpeg" "0.10" "-2")
;;       (find-luarocks-links "lposix" "20031107" "-1" "posix")
;;       (find-luarocks-links "luamacro" "2.4" "-1" "macro")
;;       (find-luarocks-links "penlight" "0.9.8" "-1" "pl???")
;; See:  (find-TH "eev/find-luarocks-links")
;;       (find-angg ".emacs" "luarocks")
;;       (find-angg "LUA/lua50init.lua" "userocks")
;;       (find-es "lua5" "luarocks")
;;
(defun find-luarocks-links (&optional pkgname v s req &rest rest)
  "Visit a temporary buffer containing hyperlinks for luarocks."
  (interactive (list (ee-stuff-around-point "a-z")))
  (setq pkgname (or pkgname "{pkgname}"))
  (setq v       (or v       "{ver}"))
  (setq s       (or s       "{sub}"))
  (setq req     (or req     pkgname))
  (apply 'find-elinks `(
    (find-luarocks-links ,pkgname ,v ,s ,req ,@rest)
    ;; (find-luarocks-links "ltcltk" "0.9-1")
    (find-angg ".emacs.templates" "find-luarocks-links")
    ""
    ;; (find-angg ".emacs" "luarocks")
    ;; (find-angg "LUA/lua50init.lua" "userocks")
    ;; (find-es "lua5" "luarocks")
    ,(ee-template0 "\
# 2014aug29:
https://rocks.moonscript.org/m/root

# Search (locally):
# (find-luarocksfile \"lib/lua/5.1/\")
# (find-luarocksfile \"share/lua/5.1/\")
# (find-luarocksfile \"lib/luarocks/rocks/\")
# (find-luarocksfile \"bin/\" \"{pkgname}\")
# (find-luarockssh \"find * | sort\")
# (find-luarocksfile \"\")
# (find-luarockssh \"bin/luarocks\")
# (find-luarockssh \"bin/luarocks list\")
# (find-luarockssh \"bin/luarocks list {pkgname}\")
# (find-luarockssh \"bin/luarocks show {pkgname}\")
# (find-luarockssh \"bin/luarocks help search\")
# (find-luarockssh \"bin/luarocks help list\")

# Search and download (from the internet):
# https://luarocks.org/search?q=lpeg
# http://luarocks.org/repositories/rocks/
# http://luarocks.org/repositories/rocks/index.html#{pkgname}
# (find-luarockssh \"bin/luarocks search -all\")
# (find-luarockssh \"bin/luarocks search   {pkgname}\")
# (find-luarockssh \"cd bin/; ./luarocks download {pkgname}\")

# Install (from the internet):
* (eepitch-shell)
* (eepitch-kill)
* (eepitch-shell)
cd /tmp/
luarocks list            {pkgname}
luarocks show            {pkgname}
luarocks search          {pkgname}
luarocks --local install {pkgname} |& tee olli-{pkgname}

cd ~/usrc/luarocks/bin/
./luarocks download {pkgname}
./luarocks build    {pkgname}  |& tee olb-{pkgname}
# (find-luarocksbinfile \"\")
# (find-luarocksbinfile \"olb-{pkgname}\")

#./luarocks install {pkgname}  |& tee oli-{pkgname}

# Test:
* (eepitch-lua51)
* (eepitch-kill)
* (eepitch-lua51)
userocks()  -- (find-angg \"LUA/lua50init.lua\" \"userocks\")
require \"{req}\"

# Inspect:
# (find-luarocksrocksfile \"\")
# (find-luarocksrocksfile \"manifest\")
# (find-luarocksrocksfile \"{pkgname}/{v}{s}/\")

# Inspect and unpack:
* (eepitch-shell)
* (eepitch-kill)
* (eepitch-shell)
# (find-luarocksfile \"bin/\" \"{pkgname}\")
# (find-luarocksfile    \"bin/{pkgname}-{v}{s}.src.rock\")
unzip -l ~/usrc/luarocks/bin/{pkgname}-{v}{s}.src.rock
unzip -p ~/usrc/luarocks/bin/{pkgname}-{v}{s}.src.rock {pkgname}-{v}.tar.gz \\
  | tar -tvzf -
rm -Rfv ~/usrc/{pkgname}-{v}/
unzip -p ~/usrc/luarocks/bin/{pkgname}-{v}{s}.src.rock {pkgname}-{v}.tar.gz \\
  | tar -C ~/usrc/ -xvzf -
cd     ~/usrc/{pkgname}-{v}/

;; (find-angg \".emacs\" \"luarocks\")
;; (find-luarocks-links \"{pkgname}\" \"{v}\" \"{s}\")
;; (find-{pkgname}file \"\")
\(code-c-d \"{pkgname}\" \"~/usrc/{pkgname}-{v}/\")
")
    ) rest))

;; Test: (find-luarocks-links)
;;       (find-luarocks-links "ltcltk")
;;       (find-luarocks-links "ltcltk" "0.9-1")
;; (find-luarocks-links "lpeg" "0.10" "-1")
;; (find-luarocks-links "lpeg" "0.12" "-1")



;; «find-luarocks-src-links»  (to ".find-luarocks-src-links")
;; Skel: (find-find-links-links-new "luarocks-src" "pkgname dir c" "")
;; Test: (find-luarocks-src-links "lpeglabel")
;;
(defun ee-luarocks-src-dir1 ()
  (find-sh0 "cd /tmp/rock/* && find * -maxdepth 0 -type d"))

(defun find-luarocks-src-links (&optional pkgname dir c &rest pos-spec-list)
"Visit a temporary buffer containing hyperlinks for luarocks-src."
  (interactive)
  (setq pkgname (or pkgname "{pkgname}"))
  (setq dir (or dir "{dir}"))
  (setq c (or c pkgname "{c}"))
  (apply
   'find-elinks
   `((find-luarocks-src-links ,pkgname ,dir ,c ,@pos-spec-list)
     (find-luarocks-src-links ,pkgname (ee-luarocks-src-dir1) ,c ,@pos-spec-list)
     ;; Convention: the first sexp always regenerates the buffer.
     (find-efunction 'find-luarocks-src-links)
     ""
     ,(ee-template0 "\
* (eepitch-shell)
* (eepitch-kill)
* (eepitch-shell)
luarocks search {pkgname} | tee /tmp/ols
# (find-fline \"/tmp/ols\")

* (eepitch-shell)
* (eepitch-kill)
* (eepitch-shell)
rm -Rv /tmp/rock/
mkdir  /tmp/rock/
cd     /tmp/rock/
luarocks unpack {pkgname}

# (find-luarocks-src-links \"{pkgname}\" (ee-luarocks-src-dir1) \"{c}\")

rm -Rv ~/usrc/{dir}/
cd /tmp/rock/
cd * 
cp -Rv {dir} ~/usrc/

# (code-c-d \"{c}\" \"~/usrc/{dir}/\")
# (find-{c}file \"\")
")
     )
   pos-spec-list))





;; «find-math-b-links»  (to ".find-math-b-links")
;; Skel: (find-find-links-links-new "math-b" "tag fnamestem" "")
;; Test: (find-math-b-links "2020-classifier" "2019classifier")
;;
(defun find-math-b-links (&optional tag fnamestem &rest pos-spec-list)
"Visit a temporary buffer containing hyperlinks for math-b."
  (interactive)
  (setq tag (or tag "{tag}"))
  (setq fnamestem (or fnamestem "{fnamestem}"))
  (apply
   'find-elinks
   `((find-math-b-links ,tag ,fnamestem ,@pos-spec-list)
     (find-math-b-links ,(ee-last-kill) ,(ee-last-kill) ,@pos-spec-list)
     ;; Convention: the first sexp always regenerates the buffer.
     (find-efunction 'find-math-b-links)
     ""
     ,(ee-template0 "\
% (find-TH \"math-b\" \"{tag}\")
%    http://angg.twu.net/math-b.html#{tag}
% file:///home/edrx/TH/L/math-b.html#{tag}

[# (find-math-b-links \"{tag}\" \"{fnamestem}\")
 # (find-LATEX \"{fnamestem}.tex\")
 # (find-pdf-page \"~/LATEX/{fnamestem}.pdf\")
 # http://angg.twu.net/LATEX/{fnamestem}.pdf
#]
")
     )
   pos-spec-list))



;; «find-defcsprefix-links»  (to ".find-defcsprefix-links")
;; Skel: (find-find-links-links-new "defcsprefix" "csprefix fullname" "")
;; Test: (find-defcsprefix-links "zha")
;;       (find-defcsprefix-links "tcg")
;;       (find-defcsprefix-links "mateight" "MATRIX 4x2")
;;
(defun find-defcsprefix-links (&optional csprefix fullname &rest pos-spec-list)
"Visit a temporary buffer containing hyperlinks for defcsprefix."
  (interactive)
  (setq csprefix (or csprefix "{csprefix}"))
  (setq fullname (or fullname (upcase csprefix) "{fullname}"))
  (apply
   'find-elinks
   `((find-defcsprefix-links ,csprefix ,fullname ,@pos-spec-list)
     ;; Convention: the first sexp always regenerates the buffer.
     (find-efunction 'find-defcsprefix-links)
     ""
     ,(ee-template0 "\
% <def{csprefix}>
% Skel: (find-defcsprefix-links \"{csprefix}\" \"{fullname}\")
%
\\def\\def{csprefix}#1#2{<}\\expandafter\\def\\csname {csprefix}-#1\\endcsname{<}#2{>}{>}
\\def\\if{csprefix}undefined#1{<}\\expandafter\\ifx\\csname {csprefix}-#1\\endcsname\\relax{>}
\\def\\{csprefix}#1{<}\\if{csprefix}undefined{<}#1{>}
    \\errmessage{<}UNDEFINED {fullname}: #1{>}
  \\else
    \\csname {csprefix}-#1\\endcsname
  \\fi
{>}
")
     )
   pos-spec-list))




;; «find-debian-version-links»  (to ".find-debian-version-links")
;; Skel: (find-find-links-links-new "debian-version" "" "")
;; Test: (find-debian-version-links)
;;
(defun find-debian-version-links (&rest pos-spec-list)
"Visit a temporary buffer containing a script for determining the Debian version."
  (interactive)
  (apply
   'find-elinks
   `((find-debian-version-links ,@pos-spec-list)
     ;; Convention: the first sexp always regenerates the buffer.
     (find-efunction 'find-debian-version-links)
     ;; ""
     ,(ee-template0 "\
# https://linuxconfig.org/check-what-debian-version-you-are-running-on-your-linux-system
# https://www.debian.org/releases/
# https://www.debian.org/doc/manuals/debian-faq/
# https://www.debian.org/doc/manuals/debian-faq/getting-debian.en.html#version
# https://en.wikipedia.org/wiki/Debian_version_history
# (find-es \"x\" \"which-window-manager\")

* (eepitch-shell)
* (eepitch-kill)
* (eepitch-shell)
cat /etc/issue
cat /etc/debian_version
cat /etc/os-release
cat /etc/hostname
lsb_release -da
hostnamectl 

wmctrl -m
echo $XDG_CURRENT_DESKTOP
echo $GDMSESSION

echo $SHELL
")
     )
   pos-spec-list))



;; «find-sound-debug-links»  (to ".find-sound-debug-links")
;; Skel: (find-find-links-links-new "sound-debug" "" "")
;; Test: (find-sound-debug-links)
;;
(defun find-sound-debug-links (&rest pos-spec-list)
"Visit a temporary buffer containing hyperlinks for sound-debug."
  (interactive)
  (apply
   'find-elinks
   `((find-sound-debug-links ,@pos-spec-list)
     ;; Convention: the first sexp always regenerates the buffer.
     (find-efunction 'find-sound-debug-links)
     ""
     "
logthis () { echo $*:; eval $* 2>&1; echo; echo; }
{
  # (find-efunction 'find-debian-version-links)
  logthis cat /etc/issue
  logthis cat /etc/debian_version
  logthis cat /etc/os-release
  logthis lsb_release -da
  logthis hostnamectl 

  # (find-es \"alsa\" \"aplay\")
  logthis aplay -l
  logthis aplay -L

  # (find-es \"sound\" \"troubleshooting\")
  logthis \"lspci -vvv | grep -A8 Audio\"
  logthis \"lspci -knn | grep -A2 Audio\"

  logthis groups

  logthis \"rm -f /tmp/oac; /usr/sbin/alsactl -f /tmp/oac store; cat /tmp/oac\"

} \\
  | tee ~/oalsa
"
     ,(ee-template0 "\
")
     )
   pos-spec-list))



;; «find-bradytdd-links»  (to ".find-bradytdd-links")
;; Skel: (find-find-links-links-new "bradytdd" "fullfname" "shortfname stem")
;; Test: (find-bradytdd-links "~/IDRIS/brady/02/Average.idr")
;;
(defun find-bradytdd-links (&optional fullfname &rest pos-spec-list)
"Visit a temporary buffer containing hyperlinks for bradytdd."
  (interactive)
  (setq fullfname (or fullfname buffer-file-name))
  (setq fullfname (or fullfname "{fullfname}"))
  (let* ((shortfname (replace-regexp-in-string "^.*/IDRIS/" "" fullfname))
         (stem (replace-regexp-in-string
		"^.*/\\([-A-Za-z0-9_]*\\).idr$" "\\1" shortfname)))
    (apply
     'find-elinks
     `((find-bradytdd-links ,fullfname ,@pos-spec-list)
       ;; Convention: the first sexp always regenerates the buffer.
       ;; `(find-efunction 'find-bradytdd-links)
       (ee-copy-rest 1 '(find-fline ,fullfname))
       ""
       ,(ee-template0 "\
-- This file:
--   http://angg.twu.net/IDRIS/{shortfname}.html
--   http://angg.twu.net/IDRIS/{shortfname}
--           (find-angg \"IDRIS/{shortfname}\")
--
-- (find-bradytddfile \"Chapter2/\")
-- (find-books \"__comp/__comp.el\" \"brady\")

{<}-
* (eepitch-shell)
* (eepitch-kill)
* (eepitch-shell)
idris {stem}

-{>}

")
       )
     pos-spec-list)))


;; «find-dednat4-convert-links»  (to ".find-dednat4-convert-links")
;; Skel: (find-find-links-links-new "dednat4-convert" "fname" "stem")
;; Test:
;;
(defun find-dednat4-convert-links (&optional fname &rest pos-spec-list)
"Material for converting a .tex from dednat4 to dednat6."
  (interactive)
  (setq fname (or fname buffer-file-name))
  (setq fname (or fname "{fname}"))
  (let* ((stem (file-name-nondirectory fname)))
    (setq stem (replace-regexp-in-string "\\.tex$" "" stem))
    (setq stem (replace-regexp-in-string "\\-utf8$" "" stem))
    (apply
     'find-elinks
     `((find-dednat4-convert-links ,fname ,@pos-spec-list)
       ;; Convention: the first sexp always regenerates the buffer.
       (find-efunction 'find-dednat4-convert-links)
       ""
       (find-lualatex-links ,(concat stem "-utf8"))
       (find-LATEX ,(concat stem      ".tex"))
       (find-LATEX ,(concat stem "-utf8.tex"))
       "
\\catcode`\\^^O=13 \\def*{\\ensuremath{\\bullet}}
% (find-dednat6 \"dednat6/block.lua\" \"TexLines\")
\\directlua{tf:processuntil(texlines:nlines())}
"
       ,(ee-template0 "
* (eepitch-shell)
* (eepitch-kill)
* (eepitch-shell)
cp -v ~/LATEX/{stem}.tex /tmp/o
~/LUA/texcatcodes.lua -trans /tmp/o /tmp/o2
# (find-fline \"/tmp/o2\")
")
       )
     pos-spec-list)))


;; «find-psne-article-links»  (to ".find-psne-article-links")
;; Skel: (find-find-links-links-new "psne-article" "url stem" "localurl localdir")
;;
(defun find-psne-article-links (&optional url stem &rest pos-spec-list)
"Visit a temporary buffer containing hyperlinks for psne-article."
  (interactive)
  (setq url (or url "{url}"))
  (setq stem (or stem "{stem}"))
  (let* ((localurl (ee-url-to-fname0 url))
	 (localdir (file-name-directory localurl))
         )
    (apply
     'find-elinks
     `((find-psne-article-links ,url ,stem ,@pos-spec-list)
       ;; Convention: the first sexp always regenerates the buffer.
       (find-efunction 'find-psne-article-links)
       ""
       ,(ee-template0 "\
* (eepitch-shell2)
* (eepitch-kill)
* (eepitch-shell2)
mkdir -p {localdir}
cd       {localdir}
wget -nc '{url}'
echo     '{url}' >> ~/.psne.log

# (find-fline \"{localdir}\")
# (find-pdf-page \"{localurl}\")
# (find-pdf-text \"{localurl}\")

;; <{stem}>
;; {url}
;; (find-fline \"{localdir}\")
\(code-pdf-page \"{stem}\" \"{localurl}\")
\(code-pdf-text \"{stem}\" \"{localurl}\")
;; (find-{stem}page)
;; (find-{stem}text)

")
       )
     pos-spec-list)))

(code-brurl 'find-psne-article-links :remote 'brap)



;; «find-psne-arxiv-links»  (to ".find-psne-arxiv-links")
;; Skel: (find-find-links-links-new "psne-arxiv" "url stem" "localurl localdir")
;; Test: (find-psne-arxiv-links "https://arxiv.org/pdf/1906.11236.pdf")
;;
(defun find-psne-arxiv-links (&optional url stem &rest pos-spec-list)
"Visit a temporary buffer containing hyperlinks for psne-arxiv."
  (interactive)
  (setq url (or url "{url}"))
  (setq stem (or stem "{stem}"))
  (let* ((localurl (ee-url-to-fname0 url))
	 (localdir (file-name-directory localurl))
	 ;;
	 (fname0   (file-name-nondirectory localurl))
	 (fname00  (replace-regexp-in-string ".pdf$" "" fname0))
	 (srcurl   (format "https://arxiv.org/e-print/%s" fname00))
	 (srcfile (format "$S/https/arxiv.org/e-print/%s.tar" fname00))
	 (srcdir          "$S/https/arxiv.org/e-print/")
	 (usrcdir  (format "~/usrc/arxiv-%s/" stem))
	 )
    (apply
     'find-elinks
     `((find-psne-arxiv-links ,url ,stem ,@pos-spec-list)
       ;; Convention: the first sexp always regenerates the buffer.
       (find-efunction 'find-psne-arxiv-links)
       ""
       ,(ee-template0 "\
* (eepitch-shell2)
* (eepitch-kill)
* (eepitch-shell2)
mkdir -p {localdir}
cd       {localdir}
cp -iv /tmp/{(file-name-nondirectory localurl)} {localdir} 
# wget -nc '{url}'
echo     '{url}' >> ~/.psne.log

# (find-fline \"{localdir}\")
# (find-pdf-page \"{localurl}\")
# (find-pdf-text \"{localurl}\")

;; <{stem}>
;; https://arxiv.org/abs/{fname00}
;; {url}
\(code-pdf-page \"{stem}\" \"{localurl}\")
\(code-pdf-text \"{stem}\" \"{localurl}\")
;; (find-{stem}page)
;; (find-{stem}text)



# Download the source:
# https://arxiv.org/abs/{fname00}
# {url}
# {srcurl}
# (find-fline \"{srcfile}\")
# (find-fline \"{usrcdir}\")

* (eepitch-shell2)
* (eepitch-kill)
* (eepitch-shell2)
mkdir -p {srcdir}
cp -v /tmp/{fname00} {srcfile}
rm -Rv {usrcdir}
mkdir  {usrcdir}
cd     {usrcdir}
tar -xvf {srcfile}

# (find-psne-arxiv-links \"{url}\" \"{stem}\")
# (find-booksgrep \"grep --color -nH --null -e {stem} */*.el\")
# (code-c-d \"{stem}\" \"~/usrc/arxiv-{stem}/\")
# (find-{stem}file \"\")

")
       )
     pos-spec-list)))

;; Test: (find-psne-arxiv-links "https://arxiv.org/pdf/1906.11236.pdf")
;; Test: (find-psne-arxiv-links "https://arxiv.org/pdf/1906.11236.pdf" "hughesfopws")

(code-brurl 'find-psne-arxiv-links :remote 'brarxp)



;; «find-book-grep-links»  (to ".find-book-grep-links")
;; Skel: (find-find-links-links-new "book-grep" "str" "")
;; Test: (book-grep)
;;
(defalias  'book-grep 'find-book-grep-links)
(defun find-book-grep-links (&optional str0 &rest pos-spec-list)
"Visit a temporary buffer containing hyperlinks for book-grep."
  (interactive)
  (setq str0 (or str0 "{str0}"))
  (apply
   'find-elinks
   `((find-book-grep-links ,str0 ,@pos-spec-list)
     ;; Convention: the first sexp always regenerates the buffer.
     (find-efunction 'find-book-grep-links)
     ""
     ,(ee-template0 "\
# (find-booksgrep \"grep --color -nH --null -e {str0} */*.el\")
# (find-booksgrep \"grep --color -niH --null -e {str0} */*.el\")
")
     )
   pos-spec-list))



;; «find-my-this-file-links»  (to ".find-my-this-file-links")
;; Skel: (find-find-links-links-new "my-this-file" "fname0 c" "fname")
;; Test: (find-my-this-file-links)
;;
(defun find-my-this-file-links (&optional fname0 c &rest pos-spec-list)
"Visit a temporary buffer containing hyperlinks for my-this-file."
  (interactive)
  (setq fname0 (or fname0 (ee-shorten-file-name (buffer-file-name)) "{fname0}"))
  (setq c (or c "%" "{c}"))
  (let* ((fname (ee-replace-prefix "~/" "" fname0)))
    (apply
     'find-elinks
     `((find-my-this-file-links ,fname0 ,c ,@pos-spec-list)
       (find-my-this-file-links ,fname0 "#")
       (find-my-this-file-links ,fname0 "%")
       (find-my-this-file-links ,fname0 "--")
       (find-my-this-file-links ,fname0 ";;")
       (find-my-this-file-links ,fname0 "//")
       (find-my-this-file-links ,fname0 " *")
       (find-my-this-file-links ,fname0 "{c}")
       ;; Convention: the first sexp always regenerates the buffer.
       (find-efunction 'find-my-this-file-links)
       ""
       ,(ee-template0 "\
# (kill-new \"  {fname}\")
# (find-blogme3 \"anggmake.lua\" \"anggtranslate\")
# (find-blogme3 \"anggmake.lua\" \"anggtranslate\" \"LUA/\")

# (find-TH \"Makefile\" \"dirs\")

# (ee-copy-rest 2 '(find-fline \"{fname0}\"))
# (ee-copy-rest0 1 nil)

{c} This file:
{c}   http://angg.twu.net/{fname}.html
{c}   http://angg.twu.net/{fname}
{c}           (find-angg \"{fname}\")
{c} Author: Eduardo Ochs <eduardoochs@gmail.com>
{c}
{c} (defun e () (interactive) (find-angg \"{fname}\"))

{c} Local Variables:
{c} coding:  utf-8-unix
{c} End:
")
       )
     pos-spec-list)))

;; Test: (find-my-this-file-links)



;; «find-ebook-convert-links»  (to ".find-ebook-convert-links")
;; Skel: (find-find-links-links-new "ebook-convert" "fname" "dir fname- stem")
;;
(defun find-ebook-convert-links (&optional fname &rest pos-spec-list)
"Visit a temporary buffer containing hyperlinks for ebook-convert."
  (interactive)
  (setq fname (or fname (ee-dired-to-fname) "{fname}"))
  (let* ((dir    (file-name-directory fname))
         (fname- (file-name-nondirectory fname))
         (stem   (replace-regexp-in-string ".epub$" "" fname-)))
    (apply
     'find-elinks
     `((find-ebook-convert-links ,fname ,@pos-spec-list)
       ;; Convention: the first sexp always regenerates the buffer.
       (find-efunction 'find-ebook-convert-links)
       ""
       ,(ee-template0 "\
* (eepitch-shell)
* (eepitch-kill)
* (eepitch-shell)
cd {dir}
ebook-convert \\
  {fname-} \\
  {stem}.pdf \\
  --base-font-size=12 \\
  --pdf-page-numbers

cd {dir}
pandoc      \\
  -f epub   \\
  -t latex  \\
  -o my.pdf \\
  --epub-chapter-level=1 \\
  --pdf-engine=lualatex  \\
    {fname-}

# (find-pdf-page \"{dir}{stem}.pdf\")
# (find-pdf-text \"{dir}{stem}.pdf\")
# (cd \"{dir}\")
# (find-book-links \"pdf\" nil \"{stem}.pdf\")
")
       )
     pos-spec-list)))

(code-brfile 'find-ebook-convert-links   :dired 'brecd)

;; (find-ebook-convert-links "/tmp/cheng__cakes_custard_and_category_theory.epub")



;; «find-lilypond-links»  (to ".find-lilypond-links")
;; Skel: (find-find-links-links-new "lilypond" "stem" "")
;;
(defun find-lilypond-links (&optional stem &rest pos-spec-list)
"Visit a temporary buffer containing hyperlinks for lilypond."
  (interactive)
  (setq stem (or stem "{stem}"))
  (apply
   'find-elinks
   `((find-lilypond-links ,stem ,@pos-spec-list)
     ;; Convention: the first sexp always regenerates the buffer.
     (find-efunction 'find-lilypond-links)
     ""
     ,(ee-template0 "\
# (kill-new \"  LILYPOND/{stem}.ly\\n\")
# (find-fline \"~/blogme3/anggmake.lua\" \"LILYPOND/\")

# (ee-copy-rest 1 '(find-fline \"~/LILYPOND/{stem}.ly\"))

% (defun c () (interactive) (find-sh \"cd ~/LILYPOND/ && lilypond {stem}.ly\"))
% (defun d () (interactive) (find-pdf-page      \"~/LILYPOND/{stem}.pdf\"))
% (defun d () (interactive) (find-pdftools-page \"~/LILYPOND/{stem}.pdf\"))
% (defun e () (interactive) (find-fline         \"~/LILYPOND/{stem}.ly\"))
% (defun v () (interactive) (find-2a '(e) '(d)) (g))

% (find-lilylearnpage 2 \"Table of Contents\")
% (find-lilylearntext 2 \"Table of Contents\")

% (find-books \"__comp/__comp.el\" \"lilypond\")
% (find-lilylearnpage (+ 5 1) \"1.1 Compiling a file\")
% (find-lilylearntext (+ 5 1) \"1.1 Compiling a file\")

\\version \"2.18.2\"
{<}
  c' e' g' e'
{>}
")
     )
   pos-spec-list))

;; Test: (find-lilypond-links "a_new_ground")



;; «find-latexgimp-links»  (to ".find-latexgimp-links")
;; Skel: (find-find-links-links-new "latexgimp" "fname" "fullfname fulldir")
;;
(defun find-latexgimp-links (&optional fname &rest pos-spec-list)
"Visit a temporary buffer containing hyperlinks for latexgimp."
  (interactive)
  (setq fname (or fname "{fname}"))
  (setq fname (or (ee-if-prefixp "~/LATEX/" "" fname 'fname+) fname))
  (let* ((fullfname (concat "~/LATEX/" fname))
         (fulldir (file-name-directory fullfname))
         )
    (apply
     'find-elinks
     `((find-latexgimp-links ,fname ,@pos-spec-list)
       ;; Convention: the first sexp always regenerates the buffer.
       (find-efunction 'find-latexgimp-links)
       ""
       ,(ee-template0 "\
% (find-fline \"{fulldir}\")
% (find-fline \"{fullfname}.png\")
% (kill-new   \"{fullfname}.xcf\")
% (kill-new   \"{fullfname}.png\")

* (eepitch-shell)
* (eepitch-kill)
* (eepitch-shell)
cd   {fulldir}
gimp {fullfname}.xcf

% (eek \"2*<right> C-SPC 3*<down> M-w\")

% (find-latexgimp-links \"{fname}\")
% (find-fline   \"{fullfname}.png\")
\\includegraphics[width=2cm]{<}{fname}.png{>}

")
       )
     pos-spec-list)))

;; Test: (find-latexgimp-links "~/LATEX/GIMP/1")



;; «find-latexinkscape-links»  (to ".find-latexinkscape-links")
;; Skel: (find-find-links-links-new "latexinkscape" "fname" "fullfname fulldir")
;;
(defun find-latexinkscape-links (&optional fname &rest pos-spec-list)
"Visit a temporary buffer containing hyperlinks for latexinkscape."
  (interactive)
  (setq fname (or fname "{fname}"))
  (setq fname (or (ee-if-prefixp "~/LATEX/" "" fname 'fname+) fname))
  (let* ((fullfname (concat "~/LATEX/" fname))
         (fulldir (file-name-directory fullfname)))
    (apply
     'find-elinks
     `((find-latexinkscape-links ,fname ,@pos-spec-list)
       ;; Convention: the first sexp always regenerates the buffer.
       (find-efunction 'find-latexinkscape-links)
       ""
       ,(ee-template0 "\
% (find-fline    \"{fulldir}\")
% (find-fline    \"{fullfname}.svg\")
% (find-fline    \"{fullfname}.pdf\")
% (find-pdf-page \"{fullfname}.pdf\")
% (kill-new      \"{fullfname}.svg\")
% (kill-new      \"{fullfname}.pdf\")

* (eepitch-shell)
* (eepitch-kill)
* (eepitch-shell)
# mkdir  {fulldir}
cd       {fulldir}
inkscape {fullfname}.svg

% (eek \"2*<right> C-SPC 3*<down> M-w\")

% (find-latexinkscape-links \"{fname}\")
% (find-fline      \"{fullfname}.pdf\")
\\includegraphics[width=2cm]{<}{fname}.pdf{>}

")
       )
     pos-spec-list)))


;; «find-latexscan-links»  (to ".find-latexscan-links")
;; Skel: (find-find-links-links-new "latexscan" "cn stem" "pdffname")
;; Test: (find-latexscan-links)
;;
(defun find-latexscan-links (&optional cn stem &rest pos-spec-list)
"Visit a temporary buffer containing hyperlinks for latexscan."
  (interactive)
  (setq cn (or cn "{cn}"))
  (setq stem (or stem "{stem}"))
  (let* ((pdffname (ee-template0 "2022-1-{cn}/{stem}.pdf")))
    (apply
     'find-elinks
     `((find-latexscan-links ,cn ,stem ,@pos-spec-list)
       (find-latexscan-links "C3" "20201125_114928_poli_grau_5")
       ;; Convention: the first sexp always regenerates the buffer.
       (find-efunction 'find-latexscan-links)
       ""
       ,(ee-template0 "\
% (find-fline \"~/2022.1-{cn}/\")
% (find-fline \"~/LATEX/2022-1-{cn}/\")
% (find-LATEX \"2020-1-C3-aprox-2a-ordem-R2.tex\" \"scans\")

% (find-latexscan-links \"{cn}\" \"{stem}\")
% (find-xpdf-page \"~/LATEX/{pdffname}\")
\\includegraphics[height=8cm]{<}{pdffname}{>}
\\includegraphics[width=11cm]{<}{pdffname}{>}

")
       )
     pos-spec-list)))



;; «find-C2-aula-links»  (to ".find-C2-aula-links")
;; Skel: (find-find-links-links-new "C2-aula" "stem n shortsuffix" "")
;; Test: (find-C2-aula-links)
;;       (find-C2-aula-links "2020-1-C2-somas-2" "2" "somas2")
;;
(defun find-C2-aula-links (&optional stem n shortsuffix &rest pos-spec-list)
"Visit a temporary buffer containing hyperlinks for C2-aula."
  (interactive)
  (setq stem (or stem "{stem}"))
  (setq n (or n "{n}"))
  (setq shortsuffix (or shortsuffix "{shortsuffix}"))
  (apply
   'find-elinks
   `((find-C2-aula-links ,stem ,n ,shortsuffix ,@pos-spec-list)
     (find-C2-aula-links "2020-1-C2-foo-bar" "42" "foobar")
     ;; Convention: the first sexp always regenerates the buffer.
     (find-efunction 'find-C2-aula-links)
     ""
     ,(ee-template0 "\
# (find-angg \".emacs\" \"2020-1-slides-aulas\")
(code-etex \"c2m201{shortsuffix}\" \"{stem}\")
(code-etex \"c2m{n}\"         \"{stem}\")

# (find-lualatex-links \"{stem}\")
# (find-LATEX          \"{stem}.tex\")

# (c2m201{shortsuffix}p)
# (c2m201{shortsuffix})
# (c2m{n}p)
# (c2m{n})

% (find-es \"tex\" \"geometry\")
\\usepackage[a6paper, landscape,
            top=1.5cm, bottom=.25cm, left=1cm, right=1cm, includefoot
           ]{<}geometry{>}
%

% ee-tla: \"c2m201{shortsuffix}\"

(find-2a '(find-LATEX \"2020-1-C2-somas-1.tex\" \"defs\")
         '(find-LATEX \"{stem}.tex\")
         )

% (find-vscan-links \"{stem}\")

")
     )
   pos-spec-list))


;; «find-C3-aula-links»  (to ".find-C3-aula-links")
;; Skel: (find-find-links-links-new "C3-aula" "stem n shortsuffix" "")
;; Test: (find-C3-aula-links)
;;       (find-C3-aula-links "2020-1-C3-taylor-1" "2" "taylor1")
;;
(defun find-C3-aula-links (&optional stem n shortsuffix &rest pos-spec-list)
"Visit a temporary buffer containing hyperlinks for C3-aula."
  (interactive)
  (setq stem (or stem "{stem}"))
  (setq n (or n "{n}"))
  (setq shortsuffix (or shortsuffix "{shortsuffix}"))
  (apply
   'find-elinks
   `((find-C3-aula-links ,stem ,n ,shortsuffix ,@pos-spec-list)
     (find-C3-aula-links "2020-1-C3-foo-bar" "42" "foobar")
     ;; Convention: the first sexp always regenerates the buffer.
     (find-efunction 'find-C3-aula-links)
     ""
     ,(ee-template0 "\
# (find-angg \".emacs\" \"2020-1-slides-aulas\")
(code-etex \"c3m201{shortsuffix}\" \"{stem}\")
(code-etex \"c3m{n}\"         \"{stem}\")

# (find-lualatex-links \"{stem}\")
# (find-LATEX          \"{stem}.tex\")

% (find-es \"tex\" \"geometry\")
\\usepackage[a6paper, landscape,
            top=1.5cm, bottom=.25cm, left=1cm, right=1cm, includefoot
           ]{<}geometry{>}
%

% ee-tla: \"c3m201{shortsuffix}\"

(find-2a ;; ' (find-LATEX \"2020-1-C3-vetor-tangente.tex\" \"defs\")
         ' (find-LATEX \"2020-1-C3-taylor-3.tex\" \"defs\")
         ' (find-LATEX \"{stem}.tex\")
         )
")
     )
   pos-spec-list))




;; «ee-template0-file»  (to ".ee-template0-file")
;; Tests:
' (find-2a ' (find-fline "~/LATEX/2020-1-CN-template.tex")
           ' (find-estring
	      (let ((stem "*STEM*"))
		(ee-template0-file "~/LATEX/2020-1-CN-template.tex"
				   "⟦\\([!-~]+\\)⟧"))))

' (find-2a ' (find-fline "~/LATEX/2022template.lagda.tex")
           ' (find-estring
	      (let ((stem "*STEM*"))
		(ee-template0-file "~/LATEX/2022template.lagda.tex"))))

;;
(defvar ee-template0-file-re "⟦\\([!-~]+\\)⟧")
(defun ee-template0-file (fname &optional re)
  (let ((ee-template00-re (or re ee-template0-file-re)))
    (ee-template0 (ee-read-file fname))))




;; «find-CN-aula-links»  (to ".find-CN-aula-links")
;; Skel: (find-find-links-links-new "CN-aula" "stem N tlalong tla" "yys")
;; Tests: (find-CN-aula-links "2020-2-C5-foo-bar" "5" "c5mfoobar" "c5mfb")
;;        (find-CN-aula-links "2020-2-C2-intro" "2" "c2m202intro" "c2m202i")
;;
(defun find-CN-aula-links (&optional stem N tlalong tla &rest pos-spec-list)
"Visit a temporary buffer containing hyperlinks for CN-aula."
  (interactive)
  (setq stem (or stem "{stem}"))
  (setq N (or N "{N}"))
  (setq tlalong (or tlalong "{tlalong}"))
  (setq tla (or tla "{tla}"))
  (let* ((yys "{yys}"))
    (apply
     'find-elinks
     `((find-CN-aula-links ,stem ,N ,tlalong ,tla ,@pos-spec-list)
       ;; Convention: the first sexp always regenerates the buffer.
       (find-efunction 'find-CN-aula-links)
       ""
       ,(ee-template0 "\

# (kill-new \"  LATEX/{stem}.tex\\n\")
# (find-blogme3 \"anggmake.lua\" \"anggtranslate\")
# (find-blogme3 \"anggmake.lua\" \"anggtranslate\" \"LATEX/2022-1\")
# ^ Add to the makefile

;; ({tlalong}a \"title\")
(code-etex-tla \"{tla}\"    \"{stem}\")
(code-etex-tla \"{tlalong}\" \"{stem}\")
;; ^ add to: (find-angg \".emacs\" \"c{N}-2022-1\")

[BR] [# ({tlalong}a \"title\")
     #]
     [R http://angg.twu.net/LATEX/{stem}.pdf PDF]
     ([R http://angg.twu.net/eev-videos/{stem}.mp4 video])

     # ^ copy to: (find-TH \"2022.1-C{N}\")

# (ee-copy-rest 3 '(find-LATEX \"{stem}.tex\"))


")
       ;; (find-LATEX              "2022-2-CN-template.tex")
       ;; (find-LATEX              "2022-1-CN-template.tex")
       ;; (find-LATEX              "2021-2-CN-template.tex")
       ,(ee-template0-file "~/LATEX/2022-2-CN-template.tex"
			   "⟦\\([!-~]+\\)⟧")
       )
     pos-spec-list)))




(defun ee-1stclassvideos-add (entry)
  (setq ee-1stclassvideos-info
     (ee-areplace ee-1stclassvideos-info (car entry) (cdr entry))))



;;;               
;;;  ___ ___ _ __ 
;;; / __/ __| '__|
;;; \__ \__ \ |   
;;; |___/___/_|   
;;;               

;; «find-ssr-links»  (to ".find-ssr-links")
;; Skel: (find-find-links-links-new "ssr" "stem c hash" "")
;; Test: (find-ssr-links "nam" "nameofthevideofile")
;;
(defun find-ssr-links (&optional c stem hash time &rest pos-spec-list)
"Visit a temporary buffer containing hyperlinks for SimpleScreenRecorder."
  (interactive)
  (setq stem (or stem "{stem}"))
  (setq c (or c "{c}"))
  (setq hash (or hash "{hash}"))
  (setq time (or time "{time}"))
  (apply
   'find-elinks
   `((find-ssr-links ,c ,stem ,hash ,time ,@pos-spec-list)
     (find-ssr-links "nam" "nameofthevideofile" ,@pos-spec-list)
     ;; Convention: the first sexp always regenerates the buffer.
     (find-efunction 'find-ssr-links)
     ""
     ,(ee-template0 "\
# (find-es \"xfce\" \"keyboard-shortcuts\")
# Alt-F1 -> Multimedia -> SimpleScreenRecorder
# Alt-F9 = hide_window_key
# SSR hotkey (record/stop): super-R

# Play:
# (find-fline \"/tmp/\" \"ssr.mp4\")
# (find-video \"/tmp/ssr.mp4\")
http://angg.twu.net/eev-videos/{stem}.mp4
https://www.youtube.com/watch?v={hash}


* (eepitch-shell)
* (eepitch-kill)
* (eepitch-shell)

cd /tmp/
  Scp-np ssr.mp4 $TWUP/eev-videos/{stem}.mp4
  Scp-np ssr.mp4 $TWUS/eev-videos/{stem}.mp4
#  http://angg.twu.net/eev-videos/{stem}.mp4
#   (find-twupfile \"eev-videos/\" \"{stem}\")
#   (find-twusfile \"eev-videos/\" \"{stem}\")
# cp -v /tmp/ssr.mp4 $S/http/angg.twu.net/eev-videos/{stem}.mp4

mkdir -p $S/http/angg.twu.net/eev-videos/
cd       $S/http/angg.twu.net/eev-videos/
wget -nc 'http://angg.twu.net/eev-videos/{stem}.mp4'
echo     'http://angg.twu.net/eev-videos/{stem}.mp4' >> ~/.psne.log

# (find-fline \"$S/http/angg.twu.net/eev-videos/\")
# (find-fline \"$S/http/angg.twu.net/eev-videos/\" \"{stem}.mp4\")
# (find-video  \"http://angg.twu.net/eev-videos/{stem}.mp4\")
# (find-video \"$S/http/angg.twu.net/eev-videos/{stem}.mp4\")

# Upload to youtube:
# (kill-new \"/home/edrx/snarf/angg.twu.net/eev-videos/{stem}.mp4\")
# (find-sh0    \"cp -v $S/http/angg.twu.net/eev-videos/{stem}.mp4 /tmp/\")

     videos [R http://angg.twu.net/eev-videos/{stem}.mp4 1]
           ([R https://www.youtube.com/watch?v={hash} YT])

# https://www.youtube.com/watch?v={hash}
# https://www.youtube.com/watch?v={hash}#t=0m00s

# (code-video \"{c}video\" \"$S/http/angg.twu.net/eev-videos/{stem}.mp4\")

% (find-ssr-links     \"{c}\" \"{stem}\" \"{hash}\")
% (code-eevvideo      \"{c}\" \"{stem}\" \"{hash}\")
% (code-eevlinksvideo \"{c}\" \"{stem}\" \"{hash}\")
% (find-{c}video \"0:00\")

;; Info: (find-1stclassvideo-links \"{c}\")
;;       (find-eev \"eev-videolinks.el\" \"{c}\")
;;       (find-eev \"eev-videolinks.el\" \"eev2021\")
;;
(ee-1stclassvideos-add '

    ;;
    ;; <{c}>
    ;; Play: (find-{c}video \"0:00\")
    ;; Index: (find-1stclassvideoindex \"{c}\")
    (\"{c}\"
     :title \"TITLE\"
     :mp4   \"http://angg.twu.net/eev-videos/{stem}.mp4\"
     :yt    \"http://www.youtube.com/watch?v={hash}\"
     :page  \"http://angg.twu.net/PAGE.html\"
     :lang  \"portuguese\"
     :date    \"DATE\"
     :length  \"LENGTH\"
     :comment \"COMMENT\")

)

code_eevshortvideo(\"{c}\", \"{stem}\", \"{hash}\")
# ^ copy to: (find-blogme3 \"sandwiches-defs.lua\" \"code_eevshortvideos\")

      [\"{c}\"] = \"{hash}\",
# ^ copy to: (find-blogme3 \"videoindex.lua\")

# (find-sshot-links \"5\" \"{stem}\")

  def [[ PLEFT 1 body \"<p align=\\\"left\\\">$body</p>\" ]]
  def [[ FIG 2 target,img \"<a href=\\\"$target\\\"><IMG SRC=\\\"$img\\\"></a>\" ]]

[PLEFT
  [FIG http://angg.twu.net/eev-videos/{stem}.mp4
          IMAGES/{stem}-small.png]
]

# (find-yttranscript-links \"{c}\" \"{hash}\")

")
     )
   pos-spec-list))

     ;; ,(ee-find-psne-core (format "http://angg.twu.net/eev-videos/%s.mp4" stem) "-nc")




;;;   ___  _         
;;;  / _ \| |__  ___ 
;;; | | | | '_ \/ __|
;;; | |_| | |_) \__ \
;;;  \___/|_.__/|___/
;;;                  
;; «find-obs-links»  (to ".find-obs-links")
;; Skel: (find-find-links-links-new "obs" "stem c hash" "")
;; Test: (find-obs-links "2022test0" "test0")
;;
(defun find-obs-links (&optional stem c hash &rest pos-spec-list)
"Visit a temporary buffer containing hyperlinks for obs."
  (interactive)
  (setq stem (or stem "{stem}"))
  (setq c (or c "{c}"))
  (setq hash (or hash "{hash}"))
  (apply
   'find-elinks
   `((find-obs-links ,stem ,c ,hash ,@pos-spec-list)
     ;; Convention: the first sexp always regenerates the buffer.
     (find-efunction 'find-obs-links)
     ""
     ,(ee-template0 "\
# (find-es \"xfce\" \"keyboard-shortcuts\")
# Alt-F1 -> Multimedia -> SimpleScreenRecorder
# Alt-F9 = hide_window_key
# SSR hotkey (record/stop): super-R


* (eepitch-shell)
* (eepitch-kill)
* (eepitch-shell)
# Rename:
# (find-fline \"/tmp/\" \" Screen\")
cd /tmp/
ls -lAF /tmp/Screen*.mov
ls -lAF /tmp/Screen*.mov
#mv -iv /tmp/Screen*.mov /tmp/obs.mov
 mv  -v /tmp/Screen*.mov /tmp/obs.mov

# Convert:
ffmpeg -i obs.mov -vcodec h264 obs.mp4

# Play:
# (find-fline \"/tmp/\" \"obs.mov\")
# (find-fline \"/tmp/\" \"obs.mp4\")
# (find-video \"/tmp/obs.mov\")
# (find-video \"/tmp/obs.mp4\")

# Upload:
# (Scp-np is my script to run scp with no password - please change)
Scp-np {stem}.mp4 marc@0branch.com:snippets/eev-videos/{stem}.mp4

# Check with tramp:
# (find-fline \"/scp:marc@0branch.com:~/public_html/eev-videos/\")
# (find-fline \"/scp:marc@0branch.com:~/public_html/eev-videos/\" \"{stem}.mp4\")

# Psne it:
mkdir -p $S/https/0branch.com/snippets/eev-videos/
cd       $S/https/0branch.com/snippets/eev-videos/
wget -nc 'https://0branch.com/snippets/eev-videos/{stem}.mp4'
echo     'https://0branch.com/snippets/eev-videos/{stem}.mp4' >> ~/.psne.log

# Verify and play the local copy:
# (find-fline \"$S/https/0branch.com/snippets/eev-videos/\" \"{stem}.mp4\")
# (find-video \"$S/https/0branch.com/snippets/eev-videos/{stem}.mp4\")
# (code-video \"{c}video\" \"$S/https/0branch.com/snippets/eev-videos/{stem}.mp4\")
# (find-{c}video \"0:00\")
")
     )
   pos-spec-list))




;; «find-emacs-test-links»  (to ".find-emacs-test-links")
;; Skel: (find-find-links-links-new "emacs-test" "stem" "")
;; Test: (find-emacs-test-links)
;;
(defun find-emacs-test-links (&optional stem &rest pos-spec-list)
"Visit a temporary buffer containing hyperlinks for emacs-test."
  (interactive)
  (setq stem (or stem "{stem}"))
  (apply
   'find-elinks
   `((find-emacs-test-links ,stem ,@pos-spec-list)
     (find-emacs-test-links "empty")
     ;; Convention: the first sexp always regenerates the buffer.
     (find-efunction 'find-emacs-test-links)
     ""
     ,(ee-template0 "\
* (eepitch-shell)
* (eepitch-kill)
* (eepitch-shell)

EMACSFONT=\"Monospace 14\"
EMACSFONT=\"6x13\"
function emacs-with-big-font () {<}
  ~/bigsrc/emacs27/src/emacs -fg bisque -bg black -fn \"$EMACSFONT\" $*
{>}

# (find-fline \"~/.emacs\")
# (find-fline \"~/.emacs.d/\")
# (find-fline \"~/.emacs.d/elpa/\")
# (find-fline \"~/.emacs-orig\")
# (find-fline \"~/.emacs-orig.d/\")
# (find-fline \"~/.emacs-orig.d/elpa/\")
# (find-fline \"~/.emacs-{stem}\")
# (find-fline \"~/.emacs-{stem}.d/\")
# (find-fline \"~/.emacs-{stem}.d/elpa/\")

cd; mv -ivT .emacs        .emacs-orig
cd; mv -ivT .emacs.d      .emacs-orig.d
cd; mv -ivT .emacs-{stem}   .emacs
cd; mv -ivT .emacs-{stem}.d .emacs.d

# (require 'package)
# (package-initialize)
# (package-install 'eev)
# (eev-beginner)
# (add-to-list 'package-archives '(\"melpa\" . \"https://melpa.org/packages/\"))

emacs-with-big-font

cd; mv -ivT .emacs        .emacs-{stem}
cd; mv -ivT .emacs.d      .emacs-{stem}.d
cd; mv -ivT .emacs-orig   .emacs  
cd; mv -ivT .emacs-orig.d .emacs.d
")
     )
   pos-spec-list))




;; «find-vimeodl-links»  (to ".find-vimeodl-links")
;; (find-fline "/sda5/videos/__shibari/")
;;
(defvar ee-vimeodl-dir "/sda5/videos/")
(defvar ee-vimeodl-dir2 "/sda5/videos/__shibari/")
(defvar ee-vimeodl-command "youtube-dl")
(defun ee-vimeodl-hash-around-point () (ee-stuff-around-point "0-9"))

;; (find-efunction 'find-youtubedl-links)
;; Test: (find-vimeodl-links nil nil "193478557")
;;
(defun find-vimeodl-links (&optional dir title hash ext- stem &rest rest)
  "Visit a temporary buffer containing hyperlinks for vimeo-dl."
  (interactive)
  (setq dir   (or dir   ee-vimeodl-dir "{dir}"))
  (setq hash  (or hash  (ee-vimeodl-hash-around-point)    "{hash}"))
  ;; (setq title (or title (ee-vimeodl-guess-title dir hash) "{title}"))
  ;; (setq ext-   (or ext-   (ee-vimeodl-guess-ext-   dir hash) "{ext-}"))
  (setq title (or title "{title}"))
  (setq ext- (or ext- "{ext-}"))
  (setq stem  (or stem "{stem}"))
  (apply 'find-elinks `(
    ;; Convention: the first sexp always regenerates the buffer.
    (find-vimeodl-links ,dir ,title ,hash ,ext- ,stem)
    (find-vimeodl-links ,dir nil ,hash nil ,stem)
    ""
    (find-vimeodl-links ,ee-vimeodl-dir  nil ,hash nil ,stem)
    (find-vimeodl-links ,ee-vimeodl-dir2 nil ,hash nil ,stem)
    ;; (find-vimeodl-links ,ee-vimeodl-dir3 nil ,hash nil ,stem)
    ;; (find-vimeodl-links ,ee-vimeodl-dir4 nil ,hash nil ,stem)
    (setq ee-vimeodl-dir "/sda5/sda5/videos/__shibari/")
    (find-efunction 'find-vimeodl-links)
    ;;
    ;; (find-vimeodl-links ee-vimeodl-dir ,title ,hash ,ext- ,stem)
    ;; (setq ee-vimeodl-dir ,ee-vimeodl-dir)
    ""
    ;; (find-ydbgrep ,(format "grep --color -nH -e %s db.lua" hash))
    ;;
    ;; Body:
    ""
    ,(ee-template0 "\
* (eepitch-shell2)
* (eepitch-kill)
* (eepitch-shell2)
# https://vimeo.com/{hash}
# http://www.vimeo.com/watch?v={hash}#t=0h00m00s
cd {dir}
{ee-vimeodl-command} -f http-540p 'https://vimeo.com/{hash}'

# Or:
{ee-vimeodl-command} -F 'https://vimeo.com/{hash}'
{ee-vimeodl-command}    'https://vimeo.com/{hash}'

# (find-es \"video\" \"vimeo-dl\")
# (find-fline \"{dir}\" \"{hash}\")
# (find-fline \"{dir}\" \"{title}-{hash}\")
# (find-fline \"{dir}\" \"{title}-{hash}{ext-}\")
# (find-video \"{dir}{title}-{hash}{ext-}\")
# (find-video \"{dir}{title}-{hash}{ext-}.part\")
# (code-video \"{stem}video\" \"{dir}{title}-{hash}{ext-}\")
# (code-video \"{stem}video\" \"{dir}{title}-{hash}{ext-}.part\")
# (find-{stem}video)
# (find-{stem}video \"0:00\")

# Error messages (for the player):
# (find-ebuffer \"*Messages*\")
")
    ) rest))



;; «find-repl-lualatex-links»  (to ".find-repl-lualatex-links")
;; Skel: (find-find-links-links-new "repl-lualatex" "" "")
;; Test: (find-repl-lualatex-links)
;;
(defun find-repl-lualatex-links (&rest pos-spec-list)
"Visit a temporary buffer containing hyperlinks for repl-lualatex."
  (interactive)
  (apply
   'find-elinks
   `((find-repl-lualatex-links ,@pos-spec-list)
     ;; Convention: the first sexp always regenerates the buffer.
     (find-efunction 'find-repl-lualatex-links)
     ""
     ,(ee-template0 "\

% (find-LATEX \"tmp.tex\")
\\catcode`\\^^J=10
\\directlua{<}dofile \"dednat6load.lua\"{>}  % (find-LATEX \"dednat6load.lua\")
\\def\\repl{<}\\directlua{<}print(); REPL = Repl:new(); REPL:repl(){>}{>}
\\repl

* (eepitch-shell)
* (eepitch-kill)
* (eepitch-shell)
# (find-es \"luatex\" \"show\")
cd ~/LATEX/
lualatex tmp.tex
mt = function (s) tok = token.create(s); print(tok) end
ma = function (s) print(token.get_macro(s)) end
me = function (s) print(token.get_meaning(s)) end
md = function (s)
    local meaning = token.get_meaning(s)
    local a,b = meaning:match\"^(.-)%->(.*)$\"
    print(\"\\\\\"..s..a..\"\\n -> \"..b)
  end
ma \"break\"
me \"break\"
ma \"section\"
ma \"@startsection\"

md \"thmsubsection\"
md \"@thm\"
md \"@xthm\"
md \"@begintheorem\"
md \"@endtheorem\"
md \"end\"
")
     )
   pos-spec-list))



;; «find-classroom-trab-links»  (to ".find-classroom-trab-links")
;; Skel: (find-find-links-links-new "classroom-trab" "name" "dir len")
;; Test: (find-classroom-trab-links "Alexandre Dos Santos Goncalves Junior")
;;
(defun find-classroom-trab-links (&optional name &rest pos-spec-list)
"Visit a temporary buffer containing hyperlinks for classroom-trab."
  (interactive)
  (setq name (or name "{name}"))
  (let* ((dir ee-classroom-dir)
         (len (length name)))
    (apply
     'find-elinks
     `((find-classroom-trab-links ,name ,@pos-spec-list)
       ;; Convention: the first sexp always regenerates the buffer.
       (find-efunction 'find-classroom-trab-links)
       ""
       (setq ee-classroom-dir "~/2020.1-C2/P1/C1/")
       (setq ee-classroom-dir "~/2020.1-C2/P1/E1/")
       (setq ee-classroom-dir "~/2020.1-C3/P1/")
       (find-fline ,ee-classroom-dir)
       ""
       ,(ee-template0 "\
# (kill-new \"{name}\")
# (find-fline \"{dir}\")
# (find-fline \"{dir}\" \"{name}\")
# (kill-new   \"{dir}{name}.pdf\")
# (kill-new   \"{dir}{name}_1.jpg\")
# (kill-new   \"{dir}{name}_2.jpg\")
# (kill-new   \"{dir}{name}_3.jpg\")
# (kill-new   \"{dir}{name}_4.jpg\")
# (find-fline \"{dir}{name}.pdf\")
# (find-fline \"{dir}{name}_all.pdf\")
# (find-fline \"{dir}{name}_corr.pdf\")
# (find-pdf-page \"{dir}{name}.pdf\")
# (find-pdf-page \"{dir}{name}_all.pdf\")
# (find-pdf-page \"{dir}{name}_corr.pdf\")
# (find-xournalpp \"{dir}{name}.pdf\")
# (find-xournalpp \"{dir}{name}_all.pdf\")
# (find-xournalpp \"{dir}{name}_corr.pdf\")

* (eepitch-shell)
* (eepitch-kill)
* (eepitch-shell)
cd {dir}
laf     \"{name}\"*
convert \"{name}\"*.jpg \"{name}_all\".pdf
laf     \"{name}\"*

laf   \"{name}\"*_small.jpg
rm -v \"{name}\"*_small.jpg
laf   \"{name}\"*.jpg

ls \"{name}\"*.jpg
ls \"{name}\"*.jpg | cut -b{(+ 2 len)}-
ls \"{name}\"*.jpg | cut -b{(+ 2 len)}- | rev | cut -b5- | rev | tee /tmp/o

for i in 01 02 03 04 05 06 07 08 09 10; do
  convert      \"{name}\"_$i.jpg \\
    -scale 50% \"{name}\"_${<}i{>}_small.jpg
done
laf     \"{name}\"*
convert \"{name}\"*small.jpg \"{name}_all\".pdf
laf     \"{name}\"*



# (find-fline \"{dir}\" \"{name}\")
cp -v {dir}\"{name}\".pdf /tmp/a.pdf
#
rm -Rv /tmp/pdf-jpg-pdf/
mkdir  /tmp/pdf-jpg-pdf/
cd     /tmp/pdf-jpg-pdf/
pdftoppm -jpeg -jpegopt quality=80 -r 150 /tmp/a.pdf b
convert b*.jpg /tmp/b.pdf
# (find-fline \"/tmp/pdf-jpg-pdf/\")
# (find-fline \"/tmp/\" \"a.pdf\")
# (find-fline \"/tmp/\" \"b.pdf\")
#
cp -v /tmp/b.pdf {dir}\"{name}\"_small.pdf


")
       )
     pos-spec-list)))

(setq ee-classroom-dir "~/2020.1-C2/P1/C1/")




;; «find-emacsdevel-links»  (to ".find-emacsdevel-links")
;; Skel: (find-find-links-links-new "emacsdevel" "yyyy-mm nnnn" "")
;; Test: (find-emacsdevel-links)
;;
(defun find-emacsdevel-links (&optional yyyy-mm nnnn &rest pos-spec-list)
"Visit a temporary buffer containing hyperlinks for emacsdevel."
  (interactive)
  (setq yyyy-mm (or yyyy-mm "2022-08"))
  (setq yyyy-mm (or yyyy-mm "{yyyy-mm}"))
  (setq nnnn (or nnnn "{nnnn}"))
  (apply
   'find-elinks
   `((find-emacsdevel-links ,yyyy-mm ,nnnn ,@pos-spec-list)
     ;; Convention: the first sexp always regenerates the buffer.
     (find-efunction 'find-emacsdevel-links)
     ""
     ,(ee-template0 "\
# http://lists.gnu.org/archive/html/emacs-devel/
# https://lists.gnu.org/archive/html/emacs-devel/{yyyy-mm}/index.html
# https://lists.gnu.org/archive/html/emacs-devel/{yyyy-mm}/index.html#{nnnn}
# https://lists.gnu.org/archive/html/emacs-devel/{yyyy-mm}/threads.html
# https://lists.gnu.org/archive/html/emacs-devel/{yyyy-mm}/threads.html#{nnnn}
# https://lists.gnu.org/archive/html/emacs-devel/{yyyy-mm}/msg{nnnn}.html

# https://lists.gnu.org/archive/cgi-bin/namazu.cgi?idxname=emacs-devel

# http://lists.gnu.org/archive/html/help-gnu-emacs/
# https://lists.gnu.org/archive/html/help-gnu-emacs/{yyyy-mm}/index.html
# https://lists.gnu.org/archive/html/help-gnu-emacs/{yyyy-mm}/index.html#{nnnn}
# https://lists.gnu.org/archive/html/help-gnu-emacs/{yyyy-mm}/threads.html
# https://lists.gnu.org/archive/html/help-gnu-emacs/{yyyy-mm}/threads.html#{nnnn}
# https://lists.gnu.org/archive/html/help-gnu-emacs/{yyyy-mm}/msg{nnnn}.html

# https://lists.gnu.org/archive/cgi-bin/namazu.cgi?idxname=help-gnu-emacs

# http://lists.gnu.org/archive/html/bug-gnu-emacs/
# https://lists.gnu.org/archive/html/bug-gnu-emacs/{yyyy-mm}/index.html
# https://lists.gnu.org/archive/html/bug-gnu-emacs/{yyyy-mm}/index.html#{nnnn}
# https://lists.gnu.org/archive/html/bug-gnu-emacs/{yyyy-mm}/threads.html
# https://lists.gnu.org/archive/html/bug-gnu-emacs/{yyyy-mm}/threads.html#{nnnn}
# https://lists.gnu.org/archive/html/bug-gnu-emacs/{yyyy-mm}/msg{nnnn}.html

# https://lists.gnu.org/archive/cgi-bin/namazu.cgi?idxname=bug-gnu-emacs

# http://lists.gnu.org/archive/html/emacs-orgmode/
# https://lists.gnu.org/archive/html/emacs-orgmode/{yyyy-mm}/index.html
# https://lists.gnu.org/archive/html/emacs-orgmode/{yyyy-mm}/index.html#{nnnn}
# https://lists.gnu.org/archive/html/emacs-orgmode/{yyyy-mm}/threads.html
# https://lists.gnu.org/archive/html/emacs-orgmode/{yyyy-mm}/threads.html#{nnnn}
# https://lists.gnu.org/archive/html/emacs-orgmode/{yyyy-mm}/msg{nnnn}.html

# https://lists.gnu.org/archive/html/eev/
# https://lists.gnu.org/archive/html/eev/{yyyy-mm}/

# https://lists.gnu.org/archive/cgi-bin/namazu.cgi?idxname=emacs-orgmode
")
     )
   pos-spec-list))




;; «find-helpgnuemacs-links»  (to ".find-helpgnuemacs-links")
;; Skel: (find-find-links-links-new "helpgnuemacs" "yyyy-mm nnnn" "")
;; Test: (find-helpgnuemacs-links)
;;
(defun find-helpgnuemacs-links (&optional yyyy-mm nnnn &rest pos-spec-list)
"Visit a temporary buffer containing hyperlinks for helpgnuemacs."
  (interactive)
  (setq yyyy-mm (or yyyy-mm "2021-12"))
  (setq yyyy-mm (or yyyy-mm "{yyyy-mm}"))
  (setq nnnn (or nnnn "{nnnn}"))
  (apply
   'find-elinks
   `((find-helpgnuemacs-links ,yyyy-mm ,nnnn ,@pos-spec-list)
     ;; Convention: the first sexp always regenerates the buffer.
     (find-efunction 'find-helpgnuemacs-links)
     ""
     ,(ee-template0 "\
# http://lists.gnu.org/archive/html/help-gnu-emacs/
# https://lists.gnu.org/archive/html/help-gnu-emacs/{yyyy-mm}/index.html
# https://lists.gnu.org/archive/html/help-gnu-emacs/{yyyy-mm}/index.html#{nnnn}
# https://lists.gnu.org/archive/html/help-gnu-emacs/{yyyy-mm}/threads.html
# https://lists.gnu.org/archive/html/help-gnu-emacs/{yyyy-mm}/threads.html#{nnnn}
# https://lists.gnu.org/archive/html/help-gnu-emacs/{yyyy-mm}/msg{nnnn}.html

# https://lists.gnu.org/archive/cgi-bin/namazu.cgi?idxname=help-gnu-emacs
")
     )
   pos-spec-list))




;; «find-emacsorgmode-links»  (to ".find-emacsorgmode-links")
;; Skel: (find-find-links-links-new "emacsorgmode" "yyyy-mm nnnn" "")
;; Test: (find-emacsorgmode-links)
;;
(defun find-emacsorgmode-links (&optional yyyy-mm nnnn &rest pos-spec-list)
"Visit a temporary buffer containing hyperlinks for emacsorgmode."
  (interactive)
  (setq yyyy-mm (or yyyy-mm "2021-01"))
  (setq yyyy-mm (or yyyy-mm "{yyyy-mm}"))
  (setq nnnn (or nnnn "{nnnn}"))
  (apply
   'find-elinks
   `((find-emacsorgmode-links ,yyyy-mm ,nnnn ,@pos-spec-list)
     ;; Convention: the first sexp always regenerates the buffer.
     (find-efunction 'find-emacsorgmode-links)
     ""
     ,(ee-template0 "\
# http://lists.gnu.org/archive/html/emacs-orgmode/
# https://lists.gnu.org/archive/html/emacs-orgmode/{yyyy-mm}/index.html
# https://lists.gnu.org/archive/html/emacs-orgmode/{yyyy-mm}/index.html#{nnnn}
# https://lists.gnu.org/archive/html/emacs-orgmode/{yyyy-mm}/threads.html
# https://lists.gnu.org/archive/html/emacs-orgmode/{yyyy-mm}/threads.html#{nnnn}
# https://lists.gnu.org/archive/html/emacs-orgmode/{yyyy-mm}/msg{nnnn}.html

# https://lists.gnu.org/archive/cgi-bin/namazu.cgi?idxname=emacs-orgmode
")
     )
   pos-spec-list))




;; «find-vscan-links»  (to ".find-vscan-links")
;; Skel: (find-find-links-links-new "vscan" "fname" "thisfname")
;; Test: (find-vscan-links "2020-1-C3-P2")
;;
(defun find-vscan-links (&optional fname &rest pos-spec-list)
"Visit a temporary buffer containing hyperlinks for vscan."
  (interactive)
  (setq fname (or fname "{fname}"))
  (let* ((thisfname (buffer-file-name)))
    (apply
     'find-elinks
     `((find-vscan-links ,fname ,@pos-spec-list)
       (find-vscan-links ,thisfname ,@pos-spec-list)
       (find-vscan-links "2020-1-C3-P2")
       ;; Convention: the first sexp always regenerates the buffer.
       (find-efunction 'find-vscan-links)
       ""
       ,(ee-template0 "\
# (ee-copy-rest 1 '(find-LATEX \"{fname}.tex\"))

% <videos>
% (find-ssr-links \"2020_videoname\" \"videoc\")

* (eepitch-shell)
* (eepitch-kill)
* (eepitch-shell)
cp -v  ~/LATEX/{fname}.pdf /tmp/
cd /tmp/
xournalpp      {fname}.pdf


% <scans>
% (find-LATEX \"2020-1-C3-aprox-2a-ordem-R2.tex\" \"scans\")

* (eepitch-shell)
* (eepitch-kill)
* (eepitch-shell)
# (find-fline \"~/2020.1-C2/\")
# (find-fline \"~/2020.1-C3/\")
# (find-fline \"~/LATEX/2020-1-C2/\")
# (find-fline \"~/LATEX/2020-1-C3/\")
# (find-fline \"/tmp/qc3/\")
# (find-fline \"/tmp/\")
cd /tmp/qc3/
cd /tmp/
for i in *.jpg; do echo f $(basename $i .jpg); done

f () {<} rm -fv $1.png $1.pdf; djvuize $1.pdf {>}
f () {<} rm -fv $1.png $1.pdf; djvuize WHITEBOARDOPTS=\"-m 0.5\" $1.pdf; xpdf $1.pdf {>}
f () {<} rm -fv $1.png $1.pdf; djvuize WHITEBOARDOPTS=\"-m 0.25\" $1.pdf; xpdf $1.pdf {>}
f () {<} cp -fv $1.png $1.pdf       ~/2020.1-C3/ {>}
f () {<} cp -fv        $1.pdf ~/LATEX/2020-1-C3/ {>}
f () {<} cp -fv $1.png $1.pdf       ~/2020.1-C2/
       cp -fv        $1.pdf ~/LATEX/2020-1-C2/
       cat <<%%%
% (find-latexscan-links \"C2\" \"$1\")
%%%
{>}

f 20201202_substtrig_grande
f 20201202_substtrig_ids_e_blocos
")
       )
     pos-spec-list)))



;; «find-LATEXpdf-links»  (to ".find-LATEXpdf-links")
;; Skel: (find-find-links-links-new "LATEXpdf" "stem n" "")
;; Test: (find-LATEXpdf-links "2020-1-C2-P1" "10")
;;       (c2mp1p 10)
;;
(defun find-LATEXpdf-links (&optional stem n &rest pos-spec-list)
"Visit a temporary buffer containing hyperlinks for LATEXpdf."
  (interactive)
  (setq stem (or stem "{stem}"))
  (setq n (or n 1))
  (setq n (or n "{n}"))
  (apply
   'find-elinks
   `((find-LATEXpdf-links ,stem ,n ,@pos-spec-list)
     ;; Convention: the first sexp always regenerates the buffer.
     (find-efunction 'find-LATEXpdf-links)
     ""
     ,(ee-template0 "\
# (find-xpdf-page \"~/LATEX/{stem}.pdf\" {n})
# (find-fline     \"~/LATEX/{stem}.tex\")
# (kill-new \"http://angg.twu.net/LATEX/{stem}.pdf#page={n}\")
# (brg      \"http://angg.twu.net/LATEX/{stem}.pdf#page={n}\")
")
     )
   pos-spec-list))



;; «find-pdfpages-links»  (to ".find-pdfpages-links")
;; Skel: (find-find-links-links-new "pdfpages" "pages" "")
;; Test: (find-pdfpages-links "7,11-16,175-185")
;;
(defun find-pdfpages-links (&optional pages &rest pos-spec-list)
"Generate an e-script for extracting pages with the pdfpages package in latex."
  (interactive)
  (setq pages (or pages "{pages}"))
  (apply
   'find-elinks
   `((find-pdfpages-links ,pages ,@pos-spec-list)
     ;; Convention: the first sexp always regenerates the buffer.
     (find-efunction 'find-pdfpages-links)
     ""
     ,(ee-template0 "\

* (eepitch-shell)
* (eepitch-kill)
* (eepitch-shell)
# (find-pdf-page \"/tmp/inp.pdf\")
# (find-pdf-page \"/tmp/out.pdf\")

cd    /tmp/
cat > /tmp/out.tex <<'---'
\\documentclass[oneside]{<}book{>}
\\usepackage{<}pdfpages{>}
\\begin{<}document{>}
\\includepdf[pages={<}{pages}{>}]{<}inp.pdf{>}
\\end{<}document{>}
---
lualatex  out.tex

# (find-pdf-page \"/tmp/inp.pdf\")
# (find-pdf-page \"/tmp/out.pdf\")


")
     )
   pos-spec-list))





;; «find-sshot-links»  (to ".find-sshot-links")
;; Skel: (find-find-links-links-new "sshot" "nsecs" "")
;; Test: (find-sshot-links)
;;  See: (find-es "paste" "scrot-imgbb")
;;       https://lists.gnu.org/archive/html/help-gnu-emacs/2021-07/msg00882.html
;;       (find-angg ".emacs" "sshot-run")
;;
(defun find-sshot-links (&optional nsecs stem &rest pos-spec-list)
"Visit a temporary buffer containing hyperlinks taking a screenshot."
  (interactive)
  (setq stem (or stem "{stem}"))
  (setq nsecs (or nsecs "5"))
  (setq nsecs (or nsecs "{nsecs}"))
  (let ((ee-buffer-name (or ee-buffer-name "*find-sshot-links*")))
    (apply
     'find-elinks
     `((find-sshot-links ,nsecs ,stem ,@pos-spec-list)
       (find-sshot-links "{nsecs}")
       ;; Convention: the first sexp always regenerates the buffer.
       (find-efunction 'find-sshot-links)
       (find-angg "bin/scrxpp")
       ""
       ,(ee-template0 "\
\(find-sh0 \"rm -v /tmp/sshot*.png\")

\(eev                        \"sleep {nsecs} && scrot -o          --select /tmp/sshot.png\")
\(find-bgprocess '(\"sh\" \"-c\" \"sleep {nsecs} && scrot -o          --select /tmp/sshot.png\"))
\(find-bgprocess '(\"sh\" \"-c\" \"sleep {nsecs} && scrot -o          --select /tmp/sshot.png && scrxpp\"))
\(find-bgprocess '(\"sh\" \"-c\" \"sleep {nsecs} && scrot -o --border --select /tmp/sshot.png\"))
\(find-bgprocess \"xzgv /tmp/sshot.png\")
\(find-bgprocess \"gimp /tmp/sshot.png\")
\(find-fline   \"/tmp/\" \"sshot.png\")
\(find-fline   \"/tmp/sshot.png\")
\(imgbb-upload \"/tmp/sshot.png\")


* (eepitch-shell)
* (eepitch-kill)
* (eepitch-shell)
cp -v /tmp/sshot.png /tmp/{stem}.png
convert /tmp/{stem}.png -scale 25% /tmp/{stem}-small.png
laf /tmp/*.png
# (find-fline \"/tmp/\" \"{stem}.png\")
# (find-fline   \"/tmp/{stem}.png\")
# (find-fline   \"/tmp/{stem}-small.png\")
cp -v /tmp/{stem}-small.png ~/IMAGES/
cp -v /tmp/{stem}.png       ~/IMAGES/

cd /tmp/
Scp-np {stem}.png \\
       {stem}-small.png $TWUP/IMAGES/

# http://angg.twu.net/IMAGES/{stem}.png

# (kill-new \"  IMAGES/{stem}.png\")
# (kill-new \"  IMAGES/{stem}-small.png\")
# (find-blogme3file \"anggmake.lua\" \"IMAGES/2021-workshop-0.png\")

[PLEFT [FIG IMAGES/{stem}.png
            IMAGES/{stem}-small.png]
]

")
       )
     pos-spec-list)))

(defalias 'sshot 'find-sshot-links)





;; «find-eevvideopage-links»  (to ".find-eevvideopage-links")
;; Skel: (find-find-links-links-new "eevvideopage" "title pagestem c mp4stem hash" "")
;;
(defun find-eevvideopage-links (&optional title pagestem c mp4stem hash &rest pos-spec-list)
"Visit a temporary buffer containing hyperlinks for eevvideopage."
  (interactive)
  (setq title (or title "{title}"))
  (setq pagestem (or pagestem "{pagestem}"))
  (setq c (or c "{c}"))
  (setq mp4stem (or mp4stem "{mp4stem}"))
  (setq hash (or hash "{hash}"))
  (apply
   'find-elinks
   `((find-eevvideopage-links ,title ,pagestem ,c ,mp4stem ,hash ,@pos-spec-list)
     ;; Convention: the first sexp always regenerates the buffer.
     (find-efunction 'find-eevvideopage-links)
     ""
     ,(ee-template0 "\

  (find-angg \".emacs.templates\" \"eev-videos-data\")
  (find-angg \".emacs.templates\" \"eev-videos-data\" \"{c}\")

' (find-eevvideopage-links
   \"{title}\"
   \"{pagestem}\"
   \"{c}\" \"{mp4stem}\" \"{hash}\")

  (find-eev \"eev-audiovideo.el\" \"video-tutorials\" \"find-{c}video\")

  (find-efunction 'find-videos-intro \"1. Some videos\")
  (find-videos-intro \"1. Some videos\")

  _. \"{title}\":
     http://angg.twu.net/{pagestem}.html
     http://angg.twu.net/{pagestem}.html#code-video
     http://angg.twu.net/eev-videos/{mp4stem}.mp4
     http://www.youtube.com/watch?v={hash}

  (find-angg \".emacs.videos\" \"{c}\")

;; \"{title}\":
;; (find-TH \"{pagestem}\")
;; http://angg.twu.net/{pagestem}.html
;; http://angg.twu.net/eev-videos/{mp4stem}.mp4
;; (find-eevvideo-links \"{c}\" \"{pagestem}\" \"{hash}\")
;; (find-code-eevvideo  \"{c}\" \"{pagestem}\" \"{hash}\")
      ' (code-eevvideo  \"{c}\" \"{pagestem}\" \"{hash}\")
;; (find-angg \".emacs.templates\" \"eev-videos-data\" \"{c}\")
;; (find-eev \"eev-audiovideo.el\" \"video-tutorials\" \"find-{c}video\")
;; (find-videos-intro \"1. Some videos\" \"{c}\")

;; (find-TH \"{pagestem}\")
;; http://angg.twu.net/{pagestem}.html
;; (find-code-eevvideo \"{c}\" \"{pagestem}\" \"{hash}\")
;; (code-eevvideo \"{c}\" \"{pagestem}\" \"{hash}\")

;; (find-eevvideo-links \"{c}\" \"{mp4stem}\" \"{hash}\")
;; (code-video \"{c}video\" \"$S/http/angg.twu.net/eev-videos/{mp4stem}.mp4\")
;; (find-{c}video)

;; (ee-use-find-eevvideo-links)
;; (ee-use-find-youtube-video)
;; (setq ee-find-youtube-video-program 'find-googlechrome)
;; (setq ee-find-youtube-video-program 'find-firefox)
;; (code-eevvideo \"{c}\" \"{mp4stem}\" \"{hash}\")
;; (find-{c}video \"\")
")
     )
   pos-spec-list))


;; «find-eevvideopage-linkss»  (to ".find-eevvideopage-linkss")
;; «eev-videos-data»  (to ".eev-videos-data")
;; (find-videos-intro "1. Some videos")
;; This is obsolete!
;; See: (find-video-links-intro "9. First-class videos")

' (find-eevvideopage-links
   "How to record executable notes with eev - and how to play them back"
   "emacsconf2019"
   "eev2019" "emacsconf2019" "86yiRG8YJD0")

' (find-eevvideopage-links
   "On why most of the best features in eev look like 5-minute hacks"
   "emacsconf2020"
   "eev2020" "emacsconf2020" "hOAqBc42Gg8")

' (find-eevvideopage-links
   "Some template-based functions of eev that are not five-minute hacks"
   "2020-some-template-based"
   "eevtempl" "2020-some-template-based" "91-9YfRPsuk")

' (find-eevvideopage-links
   "How to install eev with M-x list-packages and how to navigate its tutorials"
   "2020-list-packages-eev-nav"
   "eevnav" "M-x-list-packages-eev-nav" "kxBjiUo88_U")

' (find-eevvideopage-links
   "How to create hyperlinks to \"here\" with `find-here-links'"
   "2020-find-here-links"
   "eevfherel" "2020-find-here-links" "8jtiBlaDor4")

' (find-eevvideopage-links
   "Using test blocks in eev"
   "2021-test-blocks"
   "testbls" "2020-test-blocks-1" "fpsF_M55W4o")

' (find-eevvideopage-links
   "Short videos about workflows - and how to upload them"
   "2021-ssr"
   "2020ssr" "2020-short-find-ssr-links-2" "_0_NLXTVhBk")

' (find-eevvideopage-links
  "How to use the `[Video links:]' blocks in the `intro's of eev"
  "2021-video-links"
  "vlinks" "2021-video-links" "xQqWufQgzVY")

;; Videos in Portuguese:

;; (find-eevvideo-links "eev2021pe" "2021projeto-de-ensino" "OW6WRnSQwc0")

' (find-eevvideopage-links
  "Introdução ao Software Livre: Python, shell, Lua e eev"
  "2021projeto-de-ensino"
  "eev2021pe" "2021projeto-de-ensino" "OW6WRnSQwc0")

' (find-eevvideopage-links
  "Como instalar o eev no Emacs"
  "2021-oficina"
  "eevnov2021a" "2021-oficina-1" "acFPMuZ5Jf4")




;; «code-youtube»  (to ".code-youtube")
;; Tests: (code-youtube "chavosoband" "5Si7_LaxRkM" "A esquerda defende bandido?")
;;        (code-youtube "hstocore" "fty9QL4aSRc" "Haskell to Core")
;;        (find-hstocorevideo "0:00")
;;
(defun code-youtube (c0 hash &rest rest)
  (let ((fname (car (ee-youtubedl-guess** hash)))
	(c (concat c0 "video")))
    (if fname
	(code-video c fname)
      (find-elinks
       `((code-youtube ,c ,hash ,@rest)
	 ,(ee-H "")
	 ,(ee-H "Local copy not found! Run:")
	 (find-youtubedl-links nil nil ,hash nil ,c)
	 )))))

;; Test: (find-eppp (ee-youtubedl-guess** "fty9QL4aSRc" nil "Haskell to Core"))
;;  See: (find-eev "eev-tlinks.el" "find-youtubedl-links" "(defun ee-youtubedl-guess*")

(defun ee-youtubedl-guess** (hash &optional dirs &rest rest)
  "Return all the files containg HASH in DIRS.
HASH is usually a 11-character string.
When DIRS is nil use (cons ee-youtubedl-dir ee-youtubedl-dirs)."
  (setq dirs (or dirs (cons ee-youtubedl-dir ee-youtubedl-dirs)))
  (apply 'append
	 (mapcar
	  (lambda (dir) (ee-youtubedl-guess* dir hash))
	  dirs)))


;; «find-fossil-update-srf-links»  (to ".find-fossil-update-srf-links")
;; Skel: (find-find-links-links-new "fossil-update-srf" "" "")
;;
(defun find-fossil-update-srf-links (&rest pos-spec-list)
"Visit a temporary buffer containing hyperlinks for fossil-update-srf."
  (interactive)
  (apply
   'find-elinks
   `((find-fossil-update-srf-links ,@pos-spec-list)
     ;; Convention: the first sexp always regenerates the buffer.
     (find-efunction 'find-fossil-update-srf-links)
     ""
     ,(ee-template0 "\
* (eepitch-shell)
* (eepitch-kill)
* (eepitch-shell)
cd ~/usrc/srf/
fossil up
fossil branch
fossil checkout trunk
fossil checkout multiline-comments

* (cd \"~/usrc/srf/eg/\")
* (eepitch-srf)
* (eepitch-kill)
* (eepitch-srf)
* (eek \"M-K M-K <up>\")

-- (find-srffile \"ports/lua/\")
-- (find-srffile \"eg/\")
-- (find-fline \"~/.srfrc\")
")
     )
   pos-spec-list))

(defun fus () (interactive) (find-fossil-update-srf-links 13))




;; «find-code-xxx-links»  (to ".find-code-xxx-links")
;; Skel: (find-find-links-links-new "code-xxx" "xxx basicargs keywordargs" "")
;; Test: (find-code-xxx-links "eec-LATEX" "stem" "")
;;
(defun find-code-xxx-links (&optional xxx basicargs keywordargs &rest pos-spec-list)
"Visit a temporary buffer containing hyperlinks for code-xxx."
  (interactive)
  (setq xxx (or xxx "{xxx}"))
  (setq basicargs (or basicargs "{basicargs}"))
  (setq keywordargs (or keywordargs "{keywordargs}"))
  (let* (({vars} "{{vars}}"))
    (apply
     'find-elinks-elisp
     `(;; Convention: the first sexp always regenerates the buffer.
       ,(ee-template0 "\
;; (find-code-xxx-links \"{xxx}\" \"{basicargs}\" \"{keywordargs}\")
;; (find-efunction 'find-code-xxx-links)
              
(defun      code-{xxx} ({basicargs})
  (eval (ee-read      (ee-code-{xxx} {basicargs}))))
(defun find-code-{xxx} ({basicargs})
  (find-estring-elisp (ee-code-{xxx} {basicargs})))
(defun   ee-code-{xxx} ({basicargs})
  (ee-template0 \"\\
;; (find-code-{xxx} \\\"C\\\" \\\"FNAME\\\")
;;      (code-{xxx} \\\"C\\\" \\\"FNAME\\\")
\"))

")
       )
     pos-spec-list)))




;; «code-eec-LATEX»  (to ".code-eec-LATEX")
;; Skel: (find-code-xxx-links "eec-LATEX" "stem" "")
;; Test: (find-code-eec-LATEX "2020-2-C3-taylor")
;;            (code-eec-LATEX "2020-2-C3-taylor")
;;
(defun      code-eec-LATEX (stem)
  (eval (ee-read      (ee-code-eec-LATEX stem))))
(defun find-code-eec-LATEX (stem)
  (find-estring-elisp (ee-code-eec-LATEX stem)))
(defun   ee-code-eec-LATEX (stem)
  (ee-template0 "\

\(setq eec-stem     \"{stem}\")
\(setq eec-pbname   \"{stem}.pdf\")
\(setq eec-pfname   (ee-LATEXfile eec-pbname))
\(setq eec-cmd      \"lualatex -record {stem}.tex\")
\(setq eec-cbname   (format \"cd %s\\n%s\" ee-LATEXdir eec-cmd))
\(defun e () (interactive) (find-LATEX \"{stem}.tex\"))
\(defun d () (interactive) (find-pdftools-page eec-pfname))
\(defun eec-cbkill () (interactive) (ee-kill-buffer eec-cbname))
\(defun eec-cbview () (interactive) (find-ebuffer eec-cbname :end))
\(defun eec-cbrun0 () (interactive) (find-LATEXsh eec-cmd \"Success!!!\"))
\(defun eec-pview0 ()
  (interactive)
  (if (get-buffer eec-pbname)
      (find-ebuffer eec-pbname)
    (find-estring \"(no PDF)\")))

\(defun eec-comp () (interactive) (e) (save-buffer) (eec-cbkill) (eec-cbrun0))
\(defun eec-view-ok () (interactive) (find-2a '(e) '(progn (d) (g))))
\(defun eec-view-err ()
  (interactive)
  (find-wset \"132_o_o_o\" '(e) '(eec-cbview) '(eec-pview0)))

\(defun ce ()
  (interactive)
  (condition-case nil
    (progn (eec-comp)
	   (eec-view-ok))
    (error (eec-view-err))))

"))



;; «find-cp-angg-links»  (to ".find-cp-angg-links")
;; Skel: (find-find-links-links-new "cp-angg" "fname localdir anggdir" "")
;;
(defun find-cp-angg-links (&optional fname localdir anggdir &rest pos-spec-list)
"Visit a temporary buffer containing hyperlinks for cp-angg."
  (interactive)
  (if (eq major-mode 'dired-mode)
      (let* ((full0    (ee-shorten-file-name (ee-dired-to-fname)))
	     (dir0     (file-name-directory full0))
	     (fname0   (file-name-nondirectory full0))
	     (anggdir0 (replace-regexp-in-string "~/" "" dir0)))
	(setq fname    (or fname fname0))
	(setq localdir (or localdir dir0))
	(setq anggdir  (or anggdir anggdir0))))
  (setq fname (or fname "{fname}"))
  (setq localdir (or localdir "{localdir}"))
  (setq anggdir (or anggdir "{anggdir}"))
  (apply
   'find-elinks
   `((find-cp-angg-links ,fname ,localdir ,anggdir ,@pos-spec-list)
     (find-cp-angg-links ,fname ,localdir "tmp/" ,@pos-spec-list)
     (find-cp-angg-links ,fname ,localdir "2021.1-C2/" ,@pos-spec-list)
     (find-cp-angg-links ,fname ,localdir "2021.1-C3/" ,@pos-spec-list)
     ;; Convention: the first sexp always regenerates the buffer.
     (find-efunction 'find-cp-angg-links)
     ""
     ,(ee-template0 "\
* (eepitch-shell)
* (eepitch-kill)
* (eepitch-shell)
cd {localdir}
Scp-np {fname} $TWUP/{anggdir}
Scp-np {fname} $TWUS/{anggdir}

# (find-twupfile \"{anggdir}\" \"{fname}\")
# (find-twusfile \"{anggdir}\" \"{fname}\")
# http://angg.twu.net/{anggdir}{fname}
")
     )
   pos-spec-list))



;; «find-eevshortvideo-links»  (to ".find-eevshortvideo-links")
;; Moved to: (find-eev "eev-tlinks.el" "find-eevshortvideo-links")



;; «find-telegram-save-log-links»  (to ".find-telegram-save-log-links")
;; Skel: (find-find-links-links-new "telegram-save-log" "yyyy s cn tt" "")
;; Test: (find-telegram-save-log-links "2021" "1" "C2" "C1")
;;       (find-telegram-save-log-links "2021" "1" "C2" "E1")
;;       (find-telegram-save-log-links "2021" "1" "C3" "M1")
;;
;; (code-pdf-page "20211C2C1" "~/2021.1-C2/C2-C1-RCN-PURO-2021.1.pdf")
;; (code-pdf-text "20211C2C1" "~/2021.1-C2/C2-C1-RCN-PURO-2021.1.pdf")
;; (find-20211C2C1page)
;; (find-20211C2C1text)
;; (code-pdf-page "20211C2E1" "~/2021.1-C2/C2-E1-RCN-PURO-2021.1.pdf")
;; (code-pdf-text "20211C2E1" "~/2021.1-C2/C2-E1-RCN-PURO-2021.1.pdf")
;; (brg "~/2021.1-C2/C2-E1-RCN-PURO-2021.1.pdf")
;; (find-20211C2E1page)
;; (find-20211C2E1text)
;; (find-20211C2E1page 36 "jeito esperto")
;; (find-20211C2E1text 36 "jeito esperto")
;; (code-pdf-page "20211C3M1" "~/2021.1-C3/C3-M1-RCN-PURO-2021.1.pdf")
;; (code-pdf-text "20211C3M1" "~/2021.1-C3/C3-M1-RCN-PURO-2021.1.pdf")
;; (find-20211C3M1page)
;; (find-20211C3M1text)
;;
(defun find-telegram-save-log-links (&optional yyyy s cn tt &rest pos-spec-list)
"Visit a temporary buffer containing hyperlinks for telegram-save-log."
  (interactive)
  (setq yyyy (or yyyy "{yyyy}"))
  (setq s (or s "{s}"))
  (setq cn (or cn "{cn}"))
  (setq tt (or tt "{tt}"))
  (apply
   'find-elinks
   `((find-telegram-save-log-links ,yyyy ,s ,cn ,tt ,@pos-spec-list)
     ;; Convention: the first sexp always regenerates the buffer.
     (find-efunction 'find-telegram-save-log-links)
     ""
     ,(ee-template0 "\
# (find-fline \"~/Downloads/Telegram Desktop/\" \"ChatExport\")
# (kill-new \"/tmp/{cn}-{tt}-RCN-PURO-{yyyy}.{s}\")

* (eepitch-shell)
* (eepitch-kill)
* (eepitch-shell)
# (find-fline \"~/{yyyy}.{s}-{cn}/\")
# (find-fline \"~/{yyyy}.{s}-{cn}/\" \"{cn}-{tt}-RCN-PURO-{yyyy}.{s}\")
# (find-fline        \"/tmp/\" \"{cn}-{tt}-RCN-PURO-{yyyy}.{s}\")

# For tests:
# (find-sh0 \"mv -iv ~/{yyyy}.{s}-{cn}/{cn}-{tt}-RCN-PURO-{yyyy}.{s} /tmp/\")

cat > /tmp/print.css <<'%%%'
body {<} font-size: 12 !important {>}
@page {<}
  @bottom {<}
    content: counter(page);
  {>}
{>}
%%%

cd /tmp/
rm -v         /tmp/{cn}-{tt}-RCN-PURO-{yyyy}.{s}.zip
zip -r        /tmp/{cn}-{tt}-RCN-PURO-{yyyy}.{s}.zip {cn}-{tt}-RCN-PURO-{yyyy}.{s}/
prince     -s /tmp/print.css      \\
           -o /tmp/{cn}-{tt}-RCN-PURO-{yyyy}.{s}.pdf  \\
              /tmp/{cn}-{tt}-RCN-PURO-{yyyy}.{s}/messages.html
prince     -s /tmp/print.css      \\
           -o /tmp/{cn}-{tt}-RCN-PURO-{yyyy}.{s}-2.pdf  \\
              /tmp/{cn}-{tt}-RCN-PURO-{yyyy}.{s}/messages2.html
prince     -s /tmp/print.css      \\
           -o /tmp/{cn}-{tt}-RCN-PURO-{yyyy}.{s}-3.pdf  \\
              /tmp/{cn}-{tt}-RCN-PURO-{yyyy}.{s}/messages3.html
prince     -s /tmp/print.css      \\
           -o /tmp/{cn}-{tt}-RCN-PURO-{yyyy}.{s}-4.pdf  \\
              /tmp/{cn}-{tt}-RCN-PURO-{yyyy}.{s}/messages4.html
prince     -s /tmp/print.css      \\
           -o /tmp/{cn}-{tt}-RCN-PURO-{yyyy}.{s}-5.pdf  \\
              /tmp/{cn}-{tt}-RCN-PURO-{yyyy}.{s}/messages5.html

# (find-pdf-page \"/tmp/{cn}-{tt}-RCN-PURO-{yyyy}.{s}.pdf\")
# (find-pdf-text \"/tmp/{cn}-{tt}-RCN-PURO-{yyyy}.{s}.pdf\")
# (find-pdf-page \"/tmp/{cn}-{tt}-RCN-PURO-{yyyy}.{s}-2.pdf\")
# (find-pdf-text \"/tmp/{cn}-{tt}-RCN-PURO-{yyyy}.{s}-2.pdf\")
# (find-pdf-page \"/tmp/{cn}-{tt}-RCN-PURO-{yyyy}.{s}-3.pdf\")
# (find-pdf-text \"/tmp/{cn}-{tt}-RCN-PURO-{yyyy}.{s}-3.pdf\")
# (find-pdf-page \"/tmp/{cn}-{tt}-RCN-PURO-{yyyy}.{s}-4.pdf\")
# (find-pdf-text \"/tmp/{cn}-{tt}-RCN-PURO-{yyyy}.{s}-4.pdf\")
# (find-pdf-page \"/tmp/{cn}-{tt}-RCN-PURO-{yyyy}.{s}-5.pdf\")
# (find-pdf-text \"/tmp/{cn}-{tt}-RCN-PURO-{yyyy}.{s}-5.pdf\")

rm -Rv         ~/{yyyy}.{s}-{cn}/{cn}-{tt}-RCN-PURO-{yyyy}.{s}*
mv -iv                /tmp/{cn}-{tt}-RCN-PURO-{yyyy}.{s}* ~/{yyyy}.{s}-{cn}/
# (find-fline \"~/{yyyy}.{s}-{cn}/{cn}-{tt}-RCN-PURO-{yyyy}.{s}/\")
# (find-fline \"~/{yyyy}.{s}-{cn}/\" \"{cn}-{tt}-RCN-PURO-{yyyy}.{s}\")

#Scp-np ~/{yyyy}.{s}-{cn}/{cn}-{tt}-RCN-PURO-{yyyy}.{s}.pdf $TWUP/{yyyy}.{s}-{cn}/
# http://angg.twu.net/{yyyy}.{s}-{cn}/{cn}-{tt}-RCN-PURO-{yyyy}.{s}.pdf
# http://angg.twu.net/{yyyy}.{s}-{cn}/{cn}-{tt}-RCN-PURO-{yyyy}.{s}.pdf#page=1
# (find-twupfile \"{yyyy}.{s}-{cn}/\" \"{cn}-{tt}-RCN-PURO-{yyyy}.{s}.pdf\")

Scp-np ~/{yyyy}.{s}-{cn}/{cn}-{tt}-RCN-PURO-{yyyy}.{s}.pdf   $TWUP/tmp/
Scp-np ~/{yyyy}.{s}-{cn}/{cn}-{tt}-RCN-PURO-{yyyy}.{s}-2.pdf $TWUP/tmp/
Scp-np ~/{yyyy}.{s}-{cn}/{cn}-{tt}-RCN-PURO-{yyyy}.{s}-3.pdf $TWUP/tmp/
Scp-np ~/{yyyy}.{s}-{cn}/{cn}-{tt}-RCN-PURO-{yyyy}.{s}-4.pdf $TWUP/tmp/
Scp-np ~/{yyyy}.{s}-{cn}/{cn}-{tt}-RCN-PURO-{yyyy}.{s}-5.pdf $TWUP/tmp/
# http://angg.twu.net/tmp/{cn}-{tt}-RCN-PURO-{yyyy}.{s}.pdf
# http://angg.twu.net/tmp/{cn}-{tt}-RCN-PURO-{yyyy}.{s}-2.pdf
# http://angg.twu.net/tmp/{cn}-{tt}-RCN-PURO-{yyyy}.{s}-3.pdf
# http://angg.twu.net/tmp/{cn}-{tt}-RCN-PURO-{yyyy}.{s}-4.pdf
# http://angg.twu.net/tmp/{cn}-{tt}-RCN-PURO-{yyyy}.{s}-5.pdf

# (find-fline \"~/{yyyy}.{s}-{cn}/{cn}-{tt}-RCN-PURO-{yyyy}.{s}/\" \"messages.html\")
# (find-fline \"~/{yyyy}.{s}-{cn}/{cn}-{tt}-RCN-PURO-{yyyy}.{s}/\" \"messages2.html\")

# (code-pdf-page \"{yyyy}{s}{cn}{tt}\" \"~/{yyyy}.{s}-{cn}/{cn}-{tt}-RCN-PURO-{yyyy}.{s}.pdf\")
# (code-pdf-text \"{yyyy}{s}{cn}{tt}\" \"~/{yyyy}.{s}-{cn}/{cn}-{tt}-RCN-PURO-{yyyy}.{s}.pdf\")
# (code-pdf-page \"{yyyy}{s}{cn}{tt}2\" \"~/{yyyy}.{s}-{cn}/{cn}-{tt}-RCN-PURO-{yyyy}.{s}-2.pdf\")
# (code-pdf-text \"{yyyy}{s}{cn}{tt}2\" \"~/{yyyy}.{s}-{cn}/{cn}-{tt}-RCN-PURO-{yyyy}.{s}-2.pdf\")
# (code-pdf-page \"{yyyy}{s}{cn}{tt}3\" \"~/{yyyy}.{s}-{cn}/{cn}-{tt}-RCN-PURO-{yyyy}.{s}-3.pdf\")
# (code-pdf-text \"{yyyy}{s}{cn}{tt}3\" \"~/{yyyy}.{s}-{cn}/{cn}-{tt}-RCN-PURO-{yyyy}.{s}-3.pdf\")
# (code-pdf-page \"{yyyy}{s}{cn}{tt}4\" \"~/{yyyy}.{s}-{cn}/{cn}-{tt}-RCN-PURO-{yyyy}.{s}-4.pdf\")
# (code-pdf-text \"{yyyy}{s}{cn}{tt}4\" \"~/{yyyy}.{s}-{cn}/{cn}-{tt}-RCN-PURO-{yyyy}.{s}-4.pdf\")
# (code-pdf-page \"{yyyy}{s}{cn}{tt}5\" \"~/{yyyy}.{s}-{cn}/{cn}-{tt}-RCN-PURO-{yyyy}.{s}-5.pdf\")
# (code-pdf-text \"{yyyy}{s}{cn}{tt}5\" \"~/{yyyy}.{s}-{cn}/{cn}-{tt}-RCN-PURO-{yyyy}.{s}-5.pdf\")
# (find-{yyyy}{s}{cn}{tt}page)
# (find-{yyyy}{s}{cn}{tt}text)
# (find-{yyyy}{s}{cn}{tt}2page)
# (find-{yyyy}{s}{cn}{tt}2text)
# (find-{yyyy}{s}{cn}{tt}3page)
# (find-{yyyy}{s}{cn}{tt}3text)
# (find-{yyyy}{s}{cn}{tt}4page)
# (find-{yyyy}{s}{cn}{tt}4text)
# (find-{yyyy}{s}{cn}{tt}5page)
# (find-{yyyy}{s}{cn}{tt}5text)

")
     )
   pos-spec-list))




;; «find-build-for-arxiv-links»  (to ".find-build-for-arxiv-links")
;; Skel: (find-find-links-links-new "build-for-arxiv" "stem" "")
;;
(defun find-build-for-arxiv-links (&optional stem &rest pos-spec-list)
"Visit a temporary buffer containing hyperlinks for build-for-arxiv."
  (interactive)
  (setq stem (or stem "{stem}"))
  (apply
   'find-elinks
   `((find-build-for-arxiv-links ,stem ,@pos-spec-list)
     ;; Convention: the first sexp always regenerates the buffer.
     (find-efunction 'find-build-for-arxiv-links)
     ""
     ,(ee-template0 "\
% (find-LATEX \"2020favorite-conventions.tex\" \"make-for-arxiv\")


%     _              _       
%    / \\   _ ____  _(_)_   __
%   / _ \\ | '__\\ \\/ / \\ \\ / /
%  / ___ \\| |   >  <| |\\ V / 
% /_/   \\_\\_|  /_/\\_\\_| \\_/  
%                            
% <arxiv>
% (find-build-for-arxiv-links \"{stem}\")
% (find-LATEX \"2020favorite-conventions.tex\" \"make-for-arxiv\")

* (eepitch-shell)
* (eepitch-kill)
* (eepitch-shell)
cd ~/LATEX/
#export PATH=/usr/local/texlive/2016/bin/x86_64-linux:$PATH
export PATH=/usr/local/texlive/2019/bin/x86_64-linux:$PATH
#export PATH=/usr/local/bin:$PATH
which biber
biber --version
make -f 2019.mk STEM={stem} veryclean
lualatex             {stem}.tex
biber                {stem}
pdflatex -record     {stem}.tex

# (find-LATEXfile \"{stem}.fls\" \"biblatex/\")

cd ~/LATEX/
flsfiles-zip {stem}.fls {stem}.zip
rm -rfv /tmp/{stem}.zip
rm -rfv /tmp/edrx-latex/
cd /tmp/
cp -v ~/LATEX/{stem}.zip .
mkdir    /tmp/edrx-latex/
unzip -d /tmp/edrx-latex/ /tmp/{stem}.zip
cd       /tmp/edrx-latex/
pdflatex {stem}.tex
pdflatex {stem}.tex

cp -v    {stem}.pdf /tmp/

# (find-fline    \"/tmp/edrx-latex/\")
# (find-fline    \"/tmp/edrx-latex/{stem}.bbl\" \"bbl format version\")
# (find-pdf-page \"/tmp/edrx-latex/{stem}.pdf\")
# (find-pdf-text \"/tmp/edrx-latex/{stem}.pdf\")
# (find-fline \"/tmp/{stem}.zip\")

")
     )
   pos-spec-list))




;; «find-mygitrepo-links»  (to ".find-mygitrepo-links")
;; Skel: (find-find-links-links-new "mygitrepo" "stem" "")
;; Tests: (find-mygitrepo-links "edrxrepl")
;;        (find-mygitrepo-links "emacs-lua")
;;        (find-mygitrepo-links "shelisp")
;;        (find-mygitrepo-links "luatree")
;;
(defun find-mygitrepo-links (&optional stem &rest pos-spec-list)
"Visit a temporary buffer containing hyperlinks for mygitrepo."
  (interactive)
  (setq stem (or stem "{stem}"))
  (apply
   'find-elinks
   `((find-mygitrepo-links ,stem ,@pos-spec-list)
     (find-mygitrepo-links "emacs-lua" ,@pos-spec-list)
     ;; Convention: the first sexp always regenerates the buffer.
     (find-efunction 'find-mygitrepo-links)
     ""
     ,(ee-template0 "\

# Initialize:
# (find-fline   \"~/{stem}/\")
# (find-fline   \"~/{stem}/README.org\")
# (magit-status \"~/{stem}/\")
# (find-gitk    \"~/{stem}/\")

* (eepitch-shell)
* (eepitch-kill)
* (eepitch-shell)
cd ~/{stem}/
laf
rm -Rf ~/{stem}/.git/
git init
git add README.org
git commit -m \"first commit\"
git branch -M main
git remote add origin https://github.com/edrx/{stem}.git
git push -u origin main




# (ee-copy-rest 1 '(find-angg \"{stem}/README.org\"))

# This file:
#   https://github.com/edrx/{stem}/
#       http://angg.twu.net/{stem}/README.org.html
#       http://angg.twu.net/{stem}/README.org
#               (find-angg \"{stem}/README.org\")
#               (find-angg \"{stem}/\")
# Author: Eduardo Ochs <eduardoochs@gmail.com>
# 
# Some eev-isms:
# (defun c  () (interactive) (eek \"C-c C-e h h\"))
# (defun o  () (interactive) (find-angg \"{stem}/README.org\"))
# (defun v  () (interactive) (brg     \"~/{stem}/README.html\"))
# (defun cv () (interactive) (c) (v))
# 
# (find-mygitrepo-links \"{stem}\")
# (find-orgnode \"Table of Contents\")
#+OPTIONS: toc:nil num:nil

#+begin_comment
* (eepitch-shell)
* (eepitch-kill)
* (eepitch-shell)
cd ~/{stem}/
laf
rm -v *~
rm -v *.html

# (find-fline   \"~/{stem}/\")
# (magit-status \"~/{stem}/\")
# (find-gitk    \"~/{stem}/\")
#
#   (s)tage all changes
#   (c)ommit -> (c)reate
#   (P)ush -> (p)ushremote
#   https://github.com/edrx/{stem}
#
#+end_comment

# Local Variables:
# coding:               utf-8-unix
# modes:                (org-mode fundamental-mode)
# org-html-postamble:   nil
# End:
")
     )
   pos-spec-list))




;; «find-rcirc-quick-links»  (to ".find-rcirc-quick-links")
;; Skel: (find-find-links-links-new "rcirc-quick" "nick passwd" "")
;; Test: (find-rcirc-quick-links)
;;
(defun find-rcirc-quick-links (&optional nick passwd &rest pos-spec-list)
"Super-quick configuration for rcirc on eev."
  (interactive)
  (setq nick (or nick "{nick}"))
  (setq passwd (or passwd "{passwd}"))
  (apply
   'find-elinks-elisp
   `((find-rcirc-quick-links ,nick ,passwd ,@pos-spec-list)
     (find-rcirc-quick-links "edrx" "MyP4ssw0rd" ,@pos-spec-list)
     ;; Convention: the first sexp always regenerates the buffer.
     (find-efunction 'find-rcirc-quick-links)
     ""
     ,(ee-template0 "\
;; See:
;; (find-rcirc-intro)
;; (find-rcirc-intro \"1. The example that I use in workshops\")
;; (find-rcirc-intro \"4. Commands with very short names\")

\(setq rcirc-default-nick \"{nick}\")
\(defun e2 () (interactive) (find-libera-2a \"#eev\"))
\(defun e3 () (interactive) (find-libera-3a \"#eev\"))
\(defun m2 () (interactive) (find-libera-2a \"#emacs\"))
\(defun m3 () (interactive) (find-libera-3a \"#emacs\"))

\(setq rcirc-authinfo '((\"libera\" nickserv \"{nick}\" \"{passwd}\")
		       ))
")
     )
   pos-spec-list))



;; «find-anggwget-links»  (to ".find-anggwget-links")
;; Skel: (find-find-links-links-new "anggwget" "" "")
;; Test: (find-anggwget-links)
;; Use this instead: (find-angg-es-links)
;;   (find-efunction 'find-angg-es-links)


;; «find-find-angg-links»  (to ".find-find-angg-links")
;; Skel: (find-find-links-links-new "find-angg" "fname rest" "url findwget")
;; Tests (use `M-x efi'on the last one): 
;;        (find-find-angg-links "e/bullseye.e")
;;        (find-find-angg-links "e/bullseye.e" "2021aug16")
;;        (find-find-angg-links "e/bullseye.e" "2021aug16" "asroot")
;;             (find-angg       "e/bullseye.e" "2021aug16" "asroot")
;;
(defun find-find-angg-links (&optional fname &rest rest)
"Visit a temporary buffer containing hyperlinks for find-angg."
  (interactive)
  (setq fname (or fname "{fname}"))
  (let* ((url0 (format "http://angg.twu.net/%s" fname))
         (url1 (format "http://angg.twu.net/%s.html" fname))
         (url2 (if (car rest) (format "%s#%s" url1 (car rest))))
         (findwget `(find-wgeta ,url0 ,@rest)))
    (apply
     'find-elinks
     `((find-find-angg-links ,fname ,@rest)
       ;; Convention: the first sexp always regenerates the buffer.
       (find-efunction 'find-find-angg-links)
       ""
       ""
       ,url0
       ,url1
       ,url2
       ,(ee-S `(find-wgeta       ,url0 ,@rest))
       ,(ee-S `(find-wgeta-elisp ,url0 ,@rest))
       ""
       ,(ee-S `(find-angg ,fname ,@rest))
       ,(ee-template0 "\
")
       )
     nil ;; pos-spec-list
     )))

(defalias 'find-find-angg 'find-find-angg-links)


;; «find-find-es-links»  (to ".find-find-es-links")
;; Skel: (find-find-links-links-new "find-es" "fname rest" "url findwget")
;; Tests (use `M-x efi'on the last one): 
;;        (find-find-es-links "bullseye")
;;        (find-find-es-links "bullseye" "2021aug16")
;;        (find-find-es-links "bullseye" "2021aug16" "asroot")
;;             (find-es       "bullseye" "2021aug16" "asroot")
;;
(defun find-find-es-links (&optional fname &rest rest)
"Visit a temporary buffer containing hyperlinks for find-es."
  (interactive)
  (setq fname (or fname "{fname}"))
  (let* ((url0 (format "http://angg.twu.net/e/%s.e" fname))
         (url1 (format "http://angg.twu.net/e/%s.e.html" fname))
         (url2 (if (car rest) (format "%s#%s" url1 (car rest))))
         (findwget `(find-wgeta ,url0 ,@rest)))
    (apply
     'find-elinks
     `((find-find-es-links ,fname ,@rest)
       ;; Convention: the first sexp always regenerates the buffer.
       (find-efunction 'find-find-es-links)
       ""
       ""
       ,url0
       ,url1
       ,url2
       ,(ee-S    `(find-wgeta       ,url0 ,@rest))
       ;; ,(ee-S `(find-wgeta-elisp ,url0 ,@rest))
       ""
       ,(ee-S `(find-es ,fname ,@rest))
       ,(ee-template0 "\
")
       )
     nil ;; pos-spec-list
     )))

(defalias 'find-find-es 'find-find-es-links)



;; «find-maclanemoerdijk-links»  (to ".find-maclanemoerdijk-links")
;; Skel: (find-find-links-links-new "maclanemoerdijk" "page comment" "pmain pmain3")
;; Test: (find-maclanemoerdijk-links (+ 11 26) "This makes y into a functor")
;; Used in: (find-LATEX "2021sgl.tex")
;;
(defun find-maclanemoerdijk-links (&optional page comment suffix &rest pos-spec-list)
"Visit a temporary buffer containing hyperlinks for maclanemoerdijk."
  (interactive)
  (setq page (or page 226))
  (setq comment (or comment "{comment}"))
  (setq suffix  (or suffix  "{s}"))
  (let* ((pmain  (- page 11))
         (pmain3 (format "%03d" pmain)))
    (apply
     'find-elinks
     `((find-maclanemoerdijk-links ,page ,comment ,suffix ,@pos-spec-list)
       ;; Convention: the first sexp always regenerates the buffer.
       (find-maclanemoerdijkpage (+ 11 ,pmain) ,comment ,suffix ,@pos-spec-list)
       (find-angg "PYTHON/onepagepdftopng.py")
       (find-es "ps" "mupdf")
       (find-efunction 'find-maclanemoerdijk-links)
       ""
       ,(ee-template0 "\
* (eepitch-shell)
* (eepitch-kill)
* (eepitch-shell)
SGL=$HOME/books/__cats/maclane_moerdijk__sheaves_in_geometry_and_logic.pdf
mutool draw -o ~/LATEX/2021sgl/p{pmain3}.pdf $SGL {page}
mutool info    ~/LATEX/2021sgl/p{pmain3}.pdf
~/PYTHON/onepagepdftopng.py \\
               ~/LATEX/2021sgl/p{pmain3}.pdf \\
               ~/LATEX/2021sgl/p{pmain3}.png

# (find-pdf-page \"~/LATEX/2021sgl/p{pmain3}.pdf\")
# (find-gimp     \"~/LATEX/2021sgl/p{pmain3}.png\")
# (find-fline    \"~/LATEX/2021sgl/p{pmain3}.png\")
# (find-fline    \"~/LATEX/2021sgl/\" \"p{pmain3}.png\")

# (kill-new      \"~/LATEX/2021sgl/p{pmain3}{suffix}.png\")
# (find-fline    \"~/LATEX/2021sgl/p{pmain3}{suffix}.png\")
# (find-pdf-page \"~/LATEX/2021sgl/p{pmain3}{suffix}.pdf\")

cd ~/LATEX/2021sgl/
convert p{pmain3}{suffix}.png p{pmain3}{suffix}.pdf

$% (find-pdf-page \"~/LATEX/2021sgl/p{pmain3}{suffix}.pdf\")
  \\incgr{<}width=6cm{>}{<}2021sgl/p{pmain3}{suffix}.pdf{>}
$


")
       )
     pos-spec-list)))



;; «find-cwm-links»  (to ".find-cwm-links")
;; Skel: (find-find-links-links-new "cwm" "page comment suffix" "pmain pmain3")
;; Test: (find-cwm-links (+ 13 45) "6. Comma Categories")
;; Used in: (find-LATEX "2020cwm.tex")
;;
(defun find-cwm-links (&optional page comment suffix &rest pos-spec-list)
"Visit a temporary buffer containing hyperlinks for cwm."
  (interactive)
  (setq page (or page 226))
  (setq comment (or comment "{comment}"))
  (setq suffix  (or suffix  "{s}"))
  (let* ((pmain  (- page 13))
         (pmain3 (format "%03d" pmain)))
    (apply
     'find-elinks
     `((find-cwm-links ,page ,comment ,suffix ,@pos-spec-list)
       ;; Convention: the first sexp always regenerates the buffer.
       (find-cwm2page (+ 13 ,pmain) ,comment ,suffix ,@pos-spec-list)
       (find-angg "PYTHON/onepagepdftopng.py")
       (find-es "ps" "mupdf")
       (find-efunction 'find-cwm-links)
       ""
       ,(ee-template0 "\
* (eepitch-shell)
* (eepitch-kill)
* (eepitch-shell)
CWM=$HOME/books/__cats/maclane__cwm_springer_2nd_ed.pdf
mutool draw -o ~/LATEX/2021cwm/p{pmain3}.pdf $CWM {page}
mutool info    ~/LATEX/2021cwm/p{pmain3}.pdf
~/PYTHON/onepagepdftopng.py \\
               ~/LATEX/2021cwm/p{pmain3}.pdf \\
               ~/LATEX/2021cwm/p{pmain3}.png

# (find-pdf-page \"~/LATEX/2021cwm/p{pmain3}.pdf\")
# (find-gimp     \"~/LATEX/2021cwm/p{pmain3}.png\")
# (find-fline    \"~/LATEX/2021cwm/p{pmain3}.png\")
# (find-fline    \"~/LATEX/2021cwm/\" \"p{pmain3}.png\")

# (kill-new      \"~/LATEX/2021cwm/p{pmain3}{suffix}.png\")
# (find-fline    \"~/LATEX/2021cwm/p{pmain3}{suffix}.png\")
# (find-pdf-page \"~/LATEX/2021cwm/p{pmain3}{suffix}.pdf\")

cd ~/LATEX/2021cwm/
convert p{pmain3}{suffix}.png p{pmain3}{suffix}.pdf

$% (find-pdf-page \"~/LATEX/2021cwm/p{pmain3}{suffix}.pdf\")
  \\incgr{<}width=6cm{>}{<}2021cwm/p{pmain3}{suffix}.pdf{>}
$


")
       )
     pos-spec-list)))



;; «find-emacs28-bisect-by-hand-links»  (to ".find-emacs28-bisect-by-hand-links")
;; Skel: (find-find-links-links-new "emacs28-bisect-by-hand" "n" "")
;; See:  (find-es "git" "git-bisect-by-hand")
;; Test: (find-emacs28-bisect-by-hand-links "42")
;;
(defun find-emacs28-bisect-by-hand-links (&optional n &rest pos-spec-list)
"Visit a temporary buffer containing hyperlinks for emacs28-bisect-by-hand."
  (interactive)
  (setq n (or n "{n}"))
  (apply
   'find-elinks
   `((find-emacs28-bisect-by-hand-links ,n ,@pos-spec-list)
     ;; Convention: the first sexp always regenerates the buffer.
     (find-efunction 'find-emacs28-bisect-by-hand-links)
     ""
     ,(ee-template0 "\

* (eepitch-shell2)
* (eepitch-kill)
* (eepitch-shell2)
# (find-fline \"~/bigsrc/emacs28_{n}/\")
rm -Rfv    ~/bigsrc/emacs28_{n}/
mkdir      ~/bigsrc/emacs28_{n}/
cd         ~/bigsrc/emacs28_{n}/

cd         ~/bigsrc/emacs/
cp -a .* * ~/bigsrc/emacs28_{n}/
cd         ~/bigsrc/emacs28_{n}/

export PAGER=cat
git branch --list -a
git for-each-ref
git log --oneline --graph --all -20

# (find-gitk    \"~/bigsrc/emacs28_{n}/\")
# (magit-status \"~/bigsrc/emacs28_{n}/\")
# (find-fline   \"~/bigsrc/emacs28_{n}/\")

git checkout master~{n}
./autogen.sh                2>&1 | tee oa
# ./configure               2>&1 | tee oc
./configure --with-modules  2>&1 | tee oc
make                        2>&1 | tee om

cat > /tmp/foo.el <<'%%%'
(progn
  (add-to-list 'load-path \"~/eev-current\")
  (require 'eev-beginner)
  )
%%%
~/bigsrc/emacs28_{n}/src/emacs -T emacs28_{n} -fg bisque -bg black -fn $EMACSFONT /tmp/foo.el
~/bigsrc/emacs28_{n}/src/emacs -T emacs28_{n} -fg bisque -bg black -fn $EMACSFONT -Q /tmp/foo.el

")
     )
   pos-spec-list))




;; «find-agda-links»  (to ".find-agda-links")
;; Skel: (find-find-links-links-new "agda" "" "")
;; Test: (find-agda-links)
;;
(defun fal () (interactive) (find-2a nil '(find-agda-links)))
;;
(defun find-agda-links (&rest pos-spec-list)
"Visit a temporary buffer containing hyperlinks for agda."
  (interactive)
  (apply
   'find-elinks-elisp
   `((find-agda-links ,@pos-spec-list)
     ;; Convention: the first sexp always regenerates the buffer.
     (find-efunction 'find-agda-links)
     ""
     (find-angg ".emacs.agda" "recordstutorial")
     (find-es "agda" "agda2-mode-map")
     (find-es "agda" "selinger")
     (find-agdamodeelfile "agda-input.el")
     (eejump-554)
     ""
     ";; For Agda:"
     ";; (keymap-unset eev-mode-map \"M-,\"  'remove)"
     ";; (ee-composes-do ee-composes-bigstr-math '(ee-composes-do-remove-face))"
     ""
     ";; For non-Agda:"
     ";; (define-key   eev-mode-map (kbd \"M-,\") 'ee-compose-pair)"
     ";; (ee-composes-do ee-composes-bigstr-math)"
     ;; (find-es "agda" "M-,")
     ;;
     ;; (eek "M-h M-k  C-c C-l    ;; agda2-load - replace question mark with hole")
     ;; (eek "M-h M-k  C-c C-SPC  ;; agda2-give - fill in hole")
     ;; (eek "M-h M-k  C-c C-a    ;; agda2-auto-maybe-all - automatically fill in hole")
     ;; (eek "M-h M-k  M-.        ;; agda2-goto-definition-keyboard")
     ;; (eek "M-h M-k  M-,        ;; agda2-go-back")
     ;; (eek "M-h M-k  C-c C-c    ;; agda2-make-case - case split")
     ;; (eek "M-h M-k  C-c C-r    ;; agda2-refine - refine with constructor")
     ;; (eek "M-h M-k  C-c C-,    ;; agda2-goal-and-context - goal type and context")
     ;; (eek "M-h M-k  C-c C-.    ;; agda2-goal-and-context-and-inferred - ...type")
     ;; (eek "M-h M-k  C-c C-d    ;; agda2-infer-type-maybe-toplevel")
     ;; (eek "M-h M-k  C-c C-n    ;; agda2-compute-normalised-maybe-toplevel")
     ;; (eek "M-h M-k  C-c C-w    ;; agda2-why-in-scope-maybe-toplevel")
     ""
     (find-agdausermanualpage (+ 4 12) "2.5 Quick Guide to Editing")
     (find-agdausermanualtext (+ 4 12) "2.5 Quick Guide to Editing")
     (find-agdausermanualpage (+ 4 186) "4.4 Emacs Mode")
     (find-agdausermanualtext (+ 4 186) "4.4 Emacs Mode")
     ""
     (eek "M-h M-k  C-c C-l    ;; load or reload file")
     (eek "M-h M-k  C-c C-SPC  ;; give: fill hole")
     (eek "M-h M-k  C-c C-a    ;; automatically fill in hole")
     (eek "M-h M-k  M-.        ;; go to definition")
     (eek "M-h M-k  M-,        ;; go back")
     (eek "M-h M-k  C-c C-c    ;; case split")
     (eek "M-h M-k  C-c C-r    ;; refine with constructor")
     (eek "M-h M-k  C-c C-,    ;; goal type and context")
     (eek "M-h M-k  C-c C-.    ;; goal type, context, inferred type")
     (eek "M-h M-k  C-c C-d    ;; infer type")
     (eek "M-h M-k  C-c C-n    ;; compute normalized")
     (eek "M-h M-k  C-c C-w    ;; why in scope")
     ""
     ,(ee-template0 "\
(defun ph1p (&optional n a b c d)
  (interactive)
  (find-2a nil '(find-pdftools-page \"~/LATEX/2017planar-has-1.pdf\" n)))

(defun excp (&optional n a b c d)
  (interactive)
  (find-2a nil '(find-pdftools-page \"~/LATEX/2021excuse.pdf\" n)))
")
     )
   pos-spec-list))



;; «find-agdafile-links»  (to ".find-agdafile-links")
;; Skel: (find-find-links-links-new "agdafile" "stem" "")
;; Test: (find-agdafile-links)
;;
(defun find-agdafile-links (&optional stem &rest pos-spec-list)
"Visit a temporary buffer containing hyperlinks for agdafile."
  (interactive)
  (setq stem (or stem "{stem}"))
  (apply
   'find-elinks
   `((find-agdafile-links ,stem ,@pos-spec-list)
     ;; Convention: the first sexp always regenerates the buffer.
     (find-efunction 'find-agdafile-links)
     ""
     ,(ee-template0 "\
# (kill-new \"  AGDA/{stem}.agda\")
# (find-blogme3 \"anggmake.lua\" \"anggtranslate\")
# (find-blogme3 \"anggmake.lua\" \"anggtranslate\" \"AGDA/\")

# (ee-copy-rest 1 '(find-angg \"AGDA/{stem}.agda\"))

-- This file:
--   http://angg.twu.net/AGDA/{stem}.agda.html
--   http://angg.twu.net/AGDA/{stem}.agda
--           (find-angg \"AGDA/{stem}.agda\")
-- Author: Eduardo Ochs <eduardoochs@gmail.com>
-- Version: {(date-as-string 5)}
-- Public domain.
--
-- ;; (find-angg \"AGDA/find-agdatype.el\")
-- (load       \"~/AGDA/find-agdatype.el\")
--
-- (find-eev \"eev-pdflike.el\" \"change-default-viewer\")
-- (defalias 'find-pdf-page 'find-pdftoolsr-page)
-- (defalias 'find-pdf-page 'find-xpdf-page)
--
-- (defun a () (interactive) (find-angg \"AGDA/{stem}.agda\"))

module {stem} where


-- Local Variables:
-- coding:  utf-8-unix
-- End:
")
     )
   pos-spec-list))



;; «find-fvwmdoc-links»  (to ".find-fvwmdoc-links")
;; Skel: (find-find-links-links-new "fvwmdoc" "str" "")
;; Test: (find-fvwmdoc-links)
;;
(defun find-fvwmdoc-links (&optional word &rest pos-spec-list)
"Visit a temporary buffer containing hyperlinks for fvwmdoc."
  (interactive)
  (setq word (or word "{word}"))
  (apply
   'find-elinks
   `((find-fvwmdoc-links ,word ,@pos-spec-list)
     ;; Convention: the first sexp always regenerates the buffer.
     (find-efunction 'find-fvwmdoc-links)

     ""
     ,(ee-template0 "\
# (find-fvwm3file \"doc/\" 1 '(eek \"% m txt RET t k\"))
# (find-fvwm3grep \"grep --color=auto -nRH --null -e {word} doc/*.txt\")
# (find-fvwm3grep \"grep --color=auto -nRH --null -e '{word}' doc/*.txt\")
# (find-fvwm3grep \"grep --color=auto -niRH --null -e {word} doc/*.txt\")
# (find-fvwm3grep \"grep --color=auto -niRH --null -e '{word}' doc/*.txt\")
# (find-fvwm3grep \"grep --color=auto -niRH --null -e {word} doc/*.adoc\")
# (find-fvwm3grep \"grep --color=auto -nRH --null -e {word} doc/*.adoc\")
# (find-fvwm3file \"doc/\")
# (find-angg \".fvwm/doc_Makefile\")
# (find-angg \".fvwm/config\")
# (find-angg \".emacs.fvwm\")
")
     )
   pos-spec-list))


;; «find-agdalatex-links»  (to ".find-agdalatex-links")
;; Skel: (find-find-links-links-new "agdalatex" "stem" "fname fullfname")
;; Test: (find-agdalatex-links "2022AgdaTest")
;;       (find-agdalatex-links "2022Cats3")
;;
(defun find-agdalatex-links (&optional stem &rest pos-spec-list)
"Visit a temporary buffer containing hyperlinks for agdalatex."
  (interactive)
  (setq stem (or stem "{stem}"))
  (let* ((fname     (format         "%s.lagda.tex" stem))
         (fullfname (format "~/LATEX/%s.lagda.tex" stem)))
    (apply
     'find-elinks
     `((find-agdalatex-links ,stem ,@pos-spec-list)
       ;; Convention: the first sexp always regenerates the buffer.
       (find-efunction 'find-agdalatex-links)
       (find-LATEX "2022template.lagda.tex")
       ;; (find-2a nil '(find-LATEX "2022template.lagda.tex"))
       ""
       ,(ee-template0 "\
# (kill-new \"  LATEX/{fname}\")
# (find-blogme3 \"anggmake.lua\" \"anggtranslate\" \"LATEX/2022agda\")

# (find-2a nil    '(find-LATEX \"2022template.lagda.tex\"))
# (ee-copy-rest 1 '(find-LATEX \"{fname}\"))
")
       ,(ee-template0-file "~/LATEX/2022template.lagda.tex")
       )
     pos-spec-list)))



;; «find-fsbot-links»  (to ".find-fsbot-links")


;; «find-fsbot-links»  (to ".find-fsbot-links")
;; Skel: (find-find-links-links-new "fsbot" "word" "fsbotnick")
;; Test: (find-fsbot-links)
;;
(defun find-fsbot-links (&optional word &rest pos-spec-list)
"Visit a temporary buffer containing hyperlinks for fsbot."
  (interactive)
  (setq word (or word "{word}"))
  (let* ((fsbotnick "fsbot"))
    (apply
     'find-elinks
     `((find-fsbot-links ,word ,@pos-spec-list)
       ;; Convention: the first sexp always regenerates the buffer.
       (find-efunction 'find-fsbot-links)
       ""
     (find-es "emacs" "fsbot")
     (find-efunction 'eepitch-libera)
     ""
     ,(ee-template0 "\
* (eepitch-libera \"#emacs\")
/query {fsbotnick}
**
**
* (eepitch-libera \"{fsbotnick}\")
help erbot
**
{word}
forget {word} all
{word} is def1
{word} is also def2
{word}
")
       )
     pos-spec-list)))



;; «find-mvideo-links»  (to ".find-mvideo-links")
;; Skel: (find-find-links-links-new "mvideo" "fname" "fname-")
;; Test: (find-mvideo-links "20220302squeakdemo")
;;
(defun find-mvideo-links (&optional fname &rest pos-spec-list)
"Visit a temporary buffer containing hyperlinks for mvideo."
  (interactive)
  (setq fname (or fname (ee-mvideo-name-here)))
  (let* ((fname- (file-name-sans-extension fname)))
    (apply
     'find-elinks
     `((find-mvideo-links ,fname ,@pos-spec-list)
       ;; Convention: the first sexp always regenerates the buffer.
       (find-efunction 'find-mvideo-links)
       ""
       ,(ee-template0 "\
* (eepitch-shell)
* (eepitch-kill)
* (eepitch-shell)
mv -iv {fname} ~/mvideos/
cp -iv {fname} ~/mvideos/
# (find-fline \"~/mvideos/\" \"{fname}\")
# (find-video \"~/mvideos/{fname}\")
# (find-mvideo \"{fname-}\" \"0:00\")
")
       )
     pos-spec-list)))

(defun ee-mvideo-name-here ()
  (if (eq major-mode 'dired-mode)
      (file-name-nondirectory (ee-dired-to-fname))
    (ee-stuff-around-point "-_0-9A-Za-z")))

(defun find-mvideo (stem &optional time &rest rest)
  (find-video (format "~/mvideos/%s.mp4" stem) time))




;; «find-princeurl-links»  (to ".find-princeurl-links")
;; Skel: (find-find-links-links-new "princeurl" "url" "")
;; Test: (brprinceurl "https://ocaml.org/learn/tutorials/a_first_hour_with_ocaml.html")
;; See: (find-efunction 'ee-find-psne-core)
;;
(code-brurl 'find-princeurl-links
       :remote 'brprinceurl)

(defun find-princeurl-links (&optional url &rest pos-spec-list)
"Visit a temporary buffer containing hyperlinks for princeurl."
  (interactive)
  (setq url (or url "{url}"))
  (apply
   'find-elinks
   `((find-princeurl-links ,url)
     (brprinceurl ,url)
     ;; Convention: the first sexp always regenerates the buffer.
     (find-efunction 'find-princeurl-links)
     ""
     ,(ee-findprinceurl-core url)
     )
   pos-spec-list))

(defun ee-findprinceurl-core (url)
  (let* ((fname0   (ee-url-to-fname0 url))
         (fnamepdf (replace-regexp-in-string ".html$" ".pdf" fname0))
	 (localdir (file-name-directory    fnamepdf))
	 (stempdf  (file-name-nondirectory fnamepdf)))
    (ee-template0 "\
* (eepitch-shell)
* (eepitch-kill)
* (eepitch-shell)
# {url}
# (find-fline \"{localdir}\" \"{stempdf}\")
# (find-pdf-page \"{fnamepdf}\")

cat > /tmp/print.css <<'%%%'
body {<} font-size: 12pt {>}
@page {<} size: A4 {>}
@page {<} @bottom-center {<} content: counter(page); {>} {>}
%%%

# @page {<}
#   @bottom {<}
#     content: counter(page);
#   {>}
# {>}

mkdir -p  {localdir}
cd        {localdir}
prince --media=print \\
       -s /tmp/print.css \\
       -o {fnamepdf}  \\
           {url}
")))





;; «find-luademo-links»  (to ".find-luademo-links")
;; Skel: (find-find-links-links-new "luademo" "fname" "fname-")
;; Test: (find-luademo-links)
;;
(defun find-luademo-links (&optional fname &rest pos-spec-list)
"Visit a temporary buffer containing hyperlinks for luademo."
  (interactive)
  (setq fname (or fname
		  (ee-rmprefix "~/" (ee-fname-here))
		  "{fname}"))
  (let* ((fname- (file-name-nondirectory fname)))
    (apply
     'find-elinks
     `((find-luademo-links ,fname ,@pos-spec-list)
       ;; Convention: the first sexp always regenerates the buffer.
       (find-efunction 'find-luademo-links)
       (ee-use-red-bullets)
       (ee-use-red-stars)
       (setenv "LUA_INIT" "@/home/edrx/LUA/lua50init.lua")
       ""
       ,(ee-template0 "\
 (eepitch-shell)
 (eepitch-kill)
 (eepitch-shell)
makeR
makeR1  {fname}.html
Scp-np  {fname}      $TWUP/{fname}
Scp-np  {fname}.html $TWUP/{fname}.html
Scp-np  LUA/lua50init.lua      $TWUP/LUA/lua50init.lua
Scp-np  LUA/lua50init.lua.html $TWUP/LUA/lua50init.lua.html

 (eepitch-shell)
 (eepitch-kill)
 (eepitch-shell)
rm -Rv /tmp/luademo/
mkdir  /tmp/luademo/
cd     /tmp/luademo/
wget http://angg.twu.net/LUA/lua50init.lua
wget http://angg.twu.net/{fname}
# (find-fline \"/tmp/luademo/\")

 (setenv \"LUA_INIT\" \"@/tmp/luademo/lua50init.lua\")
 (find-anchor \"/tmp/luademo/{fname-}\")
")
       )
     pos-spec-list)))



;; «find-emlua-links»  (to ".find-emlua-links")
;; Skel: (find-find-links-links-new "emlua" "" "")
;; Test: (find-emlua-links)
;;
(defun find-emlua-links (&rest pos-spec-list)
"Visit a temporary buffer containing hyperlinks for emlua."
  (interactive)
  (apply
   'find-elinks
   `((find-emlua-links ,@pos-spec-list)
     ;; Convention: the first sexp always regenerates the buffer.
     (find-efunction 'find-emlua-links)
     ""
     ,(ee-template0 "\
* (add-to-list 'load-path \"~/emlua/\")
* (require 'emlua-repl)
* (emlua-init)
* (code-c-d \"emlua\" \"~/emlua/\" :anchor)
")
     ;;
     (find-emlua "emlua-repl.el")
     (find-emlua "emlua-repl.el" "eepitch-emlua")
     (find-emlua "emlua-repl.el" "eepitch-emlua" "test block")
     )
   pos-spec-list))



;; «find-pict2elua-links»  (to ".find-pict2elua-links")
;; Skel: (find-find-links-links-new "pict2elua" "" "")
;; Test: (find-pict2elua-links)
;;
(defun find-pict2elua-links (&rest pos-spec-list)
"Visit a temporary buffer containing hyperlinks for pict2elua."
  (interactive)
  (apply
   'find-elinks
   `((find-pict2elua-links ,@pos-spec-list)
     ;; Convention: the first sexp always regenerates the buffer.
     (find-efunction 'find-pict2elua-links)
     ""
     (find-1stclassvideo-links "2022pict2elua")
     (find-yttranscript-links "2022pict2elua" "hiHsUhGVLGM")
     (find-TH "pict2e-lua")
     (find-angg "pict2e-lua/README.org")
     (find-angg "LUA/Pict2e1.lua")
     (find-angg "LUA/Pict2e1-1.lua")
     ""
     ,(ee-template0 "\
")
     )
   pos-spec-list))

(defalias 'pil 'find-pict2elua-links)



;; «find-maximaindex-links»  (to ".find-maximaindex-links")
;; Skel: (find-find-links-links-new "maximaindex" "names" "lines")
;; Tests: (find-maximaindex-links)
;;        (find-maximaindex-links "draw gr2d")
;;        (ee-find-maximaindex-lines "foo bar")
;;
(defun find-maximaindex-links (&optional names &rest pos-spec-list)
"Visit a temporary buffer containing hyperlinks for maximaindex."
  (interactive)
  (setq names (or names ""))
  (let* ((lines (ee-find-maximaindex-lines names)))
    (apply
     'find-elinks
     `((find-maximaindex-links ,names ,@pos-spec-list)
       (find-maximaindex-links "lambda subst" ,@pos-spec-list)
       ;; Convention: the first sexp always regenerates the buffer.
       (find-efunction 'find-maximaindex-links)
       ""
       ,(ee-template0 "\
# (find-maximaindex)
{lines}
")
       )
     pos-spec-list)))

(defun ee-find-maximaindex-lines (names)
  (let* ((f1 (lambda (name rest)
	       (format "# (find-maximaindex \"%s\"%s)\n" name rest)))
         (f2 (lambda (name)
	       (format "%s%s"
		       (funcall f1 name "")
		       (funcall f1 name " :RET")))))
    (mapconcat f2 (split-string names) "")))

(defun fmi () (interactive) (find-maximaindex-links))



;; «find-maximamsg-links»  (to ".find-maximamsg-links")
;; Skel: (find-find-links-links-new "maximamsg" "n yyyymm day" "")
;; Test: (find-maximamsg-links)
;;
(defun find-maximamsg-links (&optional n yyyymm day &rest pos-spec-list)
"Visit a temporary buffer containing hyperlinks for maximamsg."
  (interactive)
  (setq n (or n 999999))
  ;; (setq yyyymm (or yyyymm "{yyyymm}"))
  ;; (setq day (or day "{day}"))
  (apply
   'find-elinks
   `((find-maximamsg-links ,n ,yyyymm ,day ,@pos-spec-list)
     ;; Convention: the first sexp always regenerates the buffer.
     (find-efunction 'find-maximamsg-links)
     (find-efunction 'find-maximamsg)
     ""
     ,@(ee-find-maximamsg-links n yyyymm day)
     )
   pos-spec-list))

(defun ee-find-maximamsg-links (&optional n yyyymm day &rest pos-spec-list)
  (setq yyyymm (or yyyymm (format-time-string "%Y%m")))
  (setq day    (or day    (format-time-string "%d")))
  (setq n      (or n      99999))
  (list (ee-template0 "\
# (find-es \"maxima\" \"mailing-lists\")
# (setq last-kbd-macro (kbd \"C-x 1 M-3 M-e M-> M-e M-o\"))
# (find-maximamsg \"{n} {yyyymm} {day}\" \"\")
# https://sourceforge.net/p/maxima/mailman/message/{n}/
# https://sourceforge.net/p/maxima/mailman/maxima-discuss/?viewmonth={yyyymm}
# https://sourceforge.net/p/maxima/mailman/maxima-discuss/?viewmonth={yyyymm}&viewday={day}
# https://sourceforge.net/p/maxima/mailman/maxima-discuss/?viewmonth={yyyymm}&viewday={day}&style=threaded
# https://sourceforge.net/p/maxima/mailman/maxima-discuss/?viewmonth={yyyymm}&style=threaded&limit=250
# (find-esgrep \"grep --color=auto -nH --null -e find-maximamsg maxima.e\")
# (find-esgrep \"grep --color=auto -nH --null -e maxima-discuss maxima.e\")
# (find-esgrep \"grep --color=auto -nH --null -e maxima/mailman maxima.e\")
# (find-lynx \"https://sourceforge.net/p/maxima/mailman/maxima-discuss/?viewmonth={yyyymm}&viewday={day}\" \"Showing\")
# (find-lynx \"https://sourceforge.net/p/maxima/mailman/maxima-discuss/?viewmonth={yyyymm}&viewday={day}&style=threaded\" \"Showing\")
# (find-lynx \"https://sourceforge.net/p/maxima/mailman/maxima-discuss/?viewmonth={yyyymm}&style=threaded&limit=250\" \"Showing\")

# (find-lynx \"https://sourceforge.net/p/maxima/mailman/message/{n}/\" 72)
")))

;; «find-maximamsg»  (to ".find-maximamsg")
;; Test: (find-maximamsg-links)
;;
(defun find-maximamsg (&optional str &rest rest)
  (interactive (let ((n (ee-stuff-around-point "[0-9]")))
		 (if (not (equal n ""))
		     (list n))))
  (cl-destructuring-bind
      (&optional n yyyymm day &rest rest) 
      (ee-split (or str "999999"))
    (find-maximamsg-links n yyyymm day)))




;; «find-editeevsubtitles-links»  (to ".find-editeevsubtitles-links")
;; Skel: (find-find-links-links-new "editeevsubtitles" "c mp4stem hash time" "")
;; Tests: (find-editeevsubtitles-links-1 "2022pict2elua")
;;        (find-editeevsubtitles-links "2022pict2elua" "2022-pict2e-lua" "hiHsUhGVLGM")
;;        (find-editeevsubtitles-links "c2m211somas1d" "2021-1-C2-somas-1-dicas" "pCD1p9FZYdI" "18:18")
;;
(defun find-editeevsubtitles-links-1 (c)
  (let* ((yt      (ee-1stclassvideos-field c :yt))
	 (mp4stem (ee-1stclassvideos-mp4stem c))
	 (hash    (ee-1stclassvideos-hash c))
	 (length  (ee-1stclassvideos-field c :length)))
    (find-editeevsubtitles-links c mp4stem hash length)))

(defun find-editeevsubtitles-links (&optional c mp4stem hash time &rest pos-spec-list)
"Visit a temporary buffer containing hyperlinks for editeevsubtitles."
  (interactive)
  (setq c (or c "{c}"))
  (setq mp4stem (or mp4stem "{mp4stem}"))
  (setq hash (or hash "{hash}"))
  (setq time (or time "{time}"))
  (apply
   'find-elinks
   `((find-editeevsubtitles-links ,c ,mp4stem ,hash ,time ,@pos-spec-list)
     ;; Convention: the first sexp always regenerates the buffer.
     (find-efunction 'find-editeevsubtitles-links)
     ""
     ,(ee-template0 "\
# (find-youtubedl-links nil nil \"{hash}\" nil \"{c}\")
# (find-yttranscript-links \"{c}\" \"{hash}\")
# ^ Save the sexps to /tmp/o, and use the find-2a below to copy them to
#   $S/http/angg.twu.net/eev-videos/{mp4stem}.sexps:

(find-fline \"$S/http/angg.twu.net/eev-videos/\" \"{mp4stem}\")
(find-2a
  ' (find-fline \"/tmp/o\")
  ' (find-fline \"$S/http/angg.twu.net/eev-videos/{mp4stem}.sexps\")
  )
(find-video \"$S/http/angg.twu.net/eev-videos/{mp4stem}.mp4\")

# Convert the sexps to a .vtt:

* (eepitch-lua51)
* (eepitch-kill)
* (eepitch-lua51)
chdir \"~/LUA/\"
dofile \"Subtitles.lua\"  -- (find-angg \"LUA/Subtitles.lua\")

infname  = \"/tmp/o\"
infname  = \"$S/http/angg.twu.net/eev-videos/{mp4stem}.sexps\"
outfname = \"$S/http/angg.twu.net/eev-videos/{mp4stem}.vtt\"
sts = Subtitles.fromsexps(ee_readfile(infname)):addtime(\"{time}\")
= sts
out = sts:vtt()..\"\\n\\n\"
ee_writefile(outfname, out)


# Compare:
(find-2a
  ' (find-fline \"$S/http/angg.twu.net/eev-videos/{mp4stem}.sexps\")
  ' (find-fline \"$S/http/angg.twu.net/eev-videos/{mp4stem}.vtt\")
  )

# Etc:
# (find-wgeteevsubtitles-links \"{mp4stem}\" \".vtt\")
# (find-psne-1stclassvideo-links \"{c}\")

# Upload subtitles to angg and to youtube:

* (eepitch-shell)
* (eepitch-kill)
* (eepitch-shell)
cp -v $S/http/angg.twu.net/eev-videos/{mp4stem}.vtt \\
  /tmp/{mp4stem}.vtt \

cd /tmp/
Scp-np {mp4stem}.vtt $TWUP/eev-videos/
Scp-np {mp4stem}.vtt $TWUS/eev-videos/

# (find-twupfile \"eev-videos\" \"{mp4stem}.vtt\")
# (find-twusfile \"eev-videos\" \"{mp4stem}.vtt\")
# http://angg.twu.net/eev-videos/{mp4stem}.vtt
# 'http://www.youtube.com/watch?v={hash}'

")
     )
   pos-spec-list))




;; «find-stream-links»  (to ".find-stream-links")
;; Skel: (find-find-links-links-new "stream" "" "")
;; Test: (find-stream-links)
;;
(defun find-stream-links (&rest pos-spec-list)
"Visit a temporary buffer containing hyperlinks for stream."
  (interactive)
  (apply
   'find-elinks
   `((find-stream-links ,@pos-spec-list)
     ;; Convention: the first sexp always regenerates the buffer.
     (find-efunction 'find-stream-links)
     ""
     ,(ee-template0 "\
* (eepitch-shell3)
* (eepitch-kill)
* (eepitch-shell3)
streamlink --player=/usr/bin/mpv https://live-hls-web-aje.getaj.net/AJE/03.m3u8 best

# Aljazeera live news
# xdg-open -new-tab https://www.aljazeera.com/live/ &
# streamlink --player=/usr/bin/mpv https://www.aljazeera.com/live/ 540p &
# or 420p
# streamlink --player=/usr/bin/mpv https://live-hls-web-aje.getaj.net/AJE/03.m3u8 best &
# if you define the player here, it will not open in another user
# workspace. So that, it is better not to define it. Then streamlink will
# pick up another available player

# streamlink https://live-hls-web-aje.getaj.net/AJE/index.m3u8
# if you want to master the video resolution 
# or use the command above
")
     )
   pos-spec-list))





;;
;; Local Variables:
;; mode:                 emacs-lisp
;; coding:               utf-8-unix
;; ee-comment-prefix:    ";;"
;; End: