Warning: this is an htmlized version!
The original is across this link,
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")

;; (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-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-quadro-links»		(to "find-quadro-links")
;; «.find-baudio-links»		(to "find-baudio-links")
;; «.bsec»			(to "bsec")
;; «.ee-bsec»			(to "ee-bsec")
;; «.find-luarocks-links»	(to "find-luarocks-links")
;; «.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»	(to "find-youtubedl-links")
;; «.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-screencast-links»	(to "find-screencast-links")
;; «.find-angg-upload-links»	(to "find-angg-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-br-links»		(to "find-br-links")
;; «.find-curso-links»		(to "find-curso-links")
;; «.find-curso-makefile-links»	(to "find-curso-makefile-links")
;; «.find-pastebin-links»	(to "find-pastebin-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-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-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: LR = R ]
\[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")
;;
(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 ,@pos-spec-list)
      ""
      (kill-new ,stem)
      (find-blogme3 "anggmake.lua" "blogmestems")
      (find-blogme3 "anggmake.lua" "blogmestems" "2017.1-LA")
      (kill-new ,(format "%s" stem))
      (find-THfile "Makefile" "2017.1-LA")
      (kill-new ,(format "%s/Makefile" stem))
      (find-blogme3file "anggmake.lua" "2016.2-LA/Makefile")
      (find-TH ,stem)
      ""
      ,(ee-template0 "
* (eepitch-Twu)
* (eepitch-kill)
* (eepitch-Twu)
mkdir ~/public_html/{year}.{sem}-{name}/
mkdir   ~/slow_html/{year}.{sem}-{name}/

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

# (find-lualatex-links \"{year}-{sem}-{name}-material\")
")
      ""
      ""
      ;;
      (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
;; (find-curso-links \"{year}\" \"{sem}\" \"{name}\" \"78\")
;;
;; (find-fline     \"~/{stem}/\")
;; (find-xpdfpage  \"~/{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]]

\[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-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}]
"))





;; «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):
# 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 ~/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")










;; «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")
;; (find-angg "blogme4/eoo.lua")
;; (find-angg "LUA/canvas2.lua")
;; (find-angg "LUA/canvas2.lua" "Class")
;; (find-efunction 'ee-delete-and-extract-line)
;;
;; (defun class () (interactive)
;;   (let ((str (ee-no-trailing-nl
;; 	      (ee-no-properties
;; 	       (ee-delete-and-extract-line 1)))))
;;     (insert (format "\
;; %s = Class {
;;   type    = \"%s\",
;;   __index = {
;;   },
;; }" str str))))

;; (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")
;;
(defun find-gigapedia-links (&optional stem &rest rest)
  "Visit a temporary buffer containing hyperlinks for gigapedia."
  (interactive)
  (setq stem (or stem (ee-no-properties (car kill-ring))))
  (setq stem (or stem "{stem}"))
  (apply 'find-elinks `(
    (find-gigapedia-links ,stem ,@rest)
    (find-fline "/tmp/")
    ;; Body:
    ""
    ,(ee-template `(stem) "\
* (eepitch-shell)
* (eepitch-kill)
* (eepitch-shell)
# (find-man \"7z\")
cd /tmp/
7z e -y {stem}.7z
ebooksclub.org
# (find-xpdfpage   \"/tmp/{stem}.pdf\")
# (find-pdftotext  \"/tmp/{stem}.pdf\")
# (find-djvupage   \"/tmp/{stem}.djvu\")
# (find-djvutotext \"/tmp/{stem}.djvu\")
")
    ) rest))

(define-key eev-mode-map "\M-G" 'find-gigapedia-links)

;; Test:
;; (find-fline "/tmp/")
;; (find-gigapedia-links)






;; «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-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.
#
# 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:               raw-text-unix
#  ee-delimiter-hash:    \"\\n#*\\n\"
#  ee-delimiter-percent: \"\\n%*\\n\"
#  ee-anchor-format:     \"«%s»\"
#  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 &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"))
  (apply 'find-elinks `(
    ;; Convention: the first sexp always regenerates the buffer.
    (find-prince-links ,stem ,GA ,@rest)
    (find-efunction 'find-prince-links)
    ;; Body:
    ""
    ,(ee-template0 "\
* (eepitch-shell)
* (eepitch-kill)
* (eepitch-shell)
cat > /tmp/print.css <<'%%%'
body {<} font-size: 8pt !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

* (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»  (to ".find-youtubedl-links")
;; (find-es "video" "youtube-dl")
;; (find-eev "eev-template.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{??}
$$
"))


;; (defun myskel-diag (name)
;;   (format "\
;; %%D diagram %s
;; %%D 2Dx    100
;; %%D 2D 100
;; %%D 2D
;; %%D 2D
;; %%D 2D
;; %%D 2D +20
;; %%D 2D
;; %%D ((
;; %%D
;; %%D ))
;; %%D enddiagram
;; $$\\diag{%s}$$" name name))
;;
;; (defun idiagskel () (interactive)
;;   (let (name)
;;     (beginning-of-line)
;;     (setq name (buffer-substring (point) (point-at-eol)))
;;     (delete-region (point) (point-at-eol))
;;     (insert (myskel-diag name))))



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

(defun ee-latex-header (d/ stem)
  (ee-template '(d/ stem) "\
% (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")
;; (find-find-links-links "tail-call" "stem firstargs")

(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 `(
    ;; Convention: the first sexp always regenerates the buffer.
    (find-pdflikedef-links ,stem ,firstargs ,@rest)
    (find-efunction 'find-pdflikedef-links)
    (emacs-lisp-mode)
    ;; Body:
    ""
    ,(ee-template0 "\
;; (find-efunction 'code-{stem})

;; find-{stem}page
;; find-{stem}-page
;; code-{stem}
;;
\(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-options '())
\(defun  ee-find-{stem}-page (fname &optional page)
  `(\"{stem}\"
    ,@ee-find-{stem}-page-options
    ,@(if page `(,(format \"--page=%d\" page)))
    ,fname))

\(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 (&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-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-find-links-links "<none>" "blogme-upload" "stem")
;; A test: (find-blogme-upload-links "2012.1")

;; (find-eapropos "suffix")
;; (defun ee-rmprefixsuffix (prefix 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-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)
     ;; Convention: the first sexp always regenerates the buffer.
     (find-efunction 'find-escript-upload-links)
     (find-es ,stem)
     ,(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}
")
     )
   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-xpdfpage   \"~/LATEX/{stem}.pdf\")
# http://angg.twu.net/LATEX/{stem}.pdf
#   file:///home/edrx/LATEX/{stem}.pdf

# Make .tgz and upload it
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
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
mkdir  {dir}
tar -C {dir} -xvzf /tmp/{stem}.tgz
cd     {dir}
lualatex {stem}.tex

# Test the .zip.
# The e-script below downloads, unpacks and compiles the .tgz in {dir}
#
rm -rfv /tmp/{stem}.zip
rm -rfv {dir}
cd /tmp/
wget http://angg.twu.net/LATEX/{stem}.zip
mkdir    {dir}
unzip -d {dir} /tmp/{stem}.zip
cd       {dir}
lualatex {stem}.tex

% (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 "__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-sh0 \"mv -iv {fname} ~/books/{dir}/\")
# (wrobak 2 ' (find-angg \"books/{dir}/{dir}.el\"))

;; <{author}>
;; (find-books \"{dir}/{dir}.el\" \"{author}\")
\(code-{fmt}       \"{stem}\" \"~/books/{dir}/{fname}\")
\(code-{fmt}totext \"{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")
;; A test: (find-lualatex-links)

(defun find-lualatex-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-lualatex-links ,stem ,@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/")
     (ee-copy-rest 1 '(find-LATEX ,(concat stem ".tex")))
     ""
     ,(ee-template0 "\
% (find-angg \"LATEX/{stem}.tex\")
% (defun c () (interactive) (find-LATEXsh \"lualatex -record {stem}.tex\"))
% (defun d () (interactive) (find-xpdfpage \"~/LATEX/{stem}.pdf\"))
% (defun b () (interactive) (find-zsh \"bibtex {stem}; makeindex {stem}\"))
% (defun e () (interactive) (find-LATEX \"{stem}.tex\"))
% (defun u () (interactive) (find-latex-upload-links \"{stem}\"))
% (find-xpdfpage \"~/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")
     ;;
     "\
\\documentclass[oneside]{book}
\\usepackage[colorlinks]{hyperref} % (find-es \"tex\" \"hyperref\")
%\\usepackage[latin1]{inputenc}
\\usepackage{amsmath}
\\usepackage{amsfonts}
\\usepackage{amssymb}
\\usepackage{pict2e}
\\usepackage{color}                % (find-LATEX \"edrx15.sty\" \"colors\")
\\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{edrx15}               % (find-angg \"LATEX/edrx15.sty\")
\\input edrxaccents.tex            % (find-angg \"LATEX/edrxaccents.tex\")
\\input edrxchars.tex              % (find-LATEX \"edrxchars.tex\")
\\input edrxheadfoot.tex           % (find-dn4ex \"edrxheadfoot.tex\")
\\input edrxgac2.tex               % (find-LATEX \"edrxgac2.tex\")
%
\\begin{document}

\\catcode`\\^^J=10
\\directlua{dednat6dir = \"dednat6/\"}
\\directlua{dofile(dednat6dir..\"dednat6.lua\")}
\\directlua{texfile(tex.jobname)}
\\directlua{verbose()}
%\\directlua{output(preamble1)}
\\def\\expr#1{\\directlua{output(tostring(#1))}}
\\def\\eval#1{\\directlua{#1}}
\\def\\pu{\\directlua{pu()}}

\\directlua{dofile \"edrxtikz.lua\"} % (find-LATEX \"edrxtikz.lua\")
\\directlua{dofile \"edrxpict.lua\"} % (find-LATEX \"edrxpict.lua\")
%L V.__tostring = function (v) return format(\"(%.3f,%.3f)\", v[1], v[2]) end

\\end{document}

% Local Variables:
% coding: utf-8-unix
% ee-anchor-format: \"«%s»\"
% End:"
     ) pos-spec-list))



;; Older version:

;; (defun find-lualatex-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-lualatex-links ,stem ,@pos-spec-list)
;;      ;; Convention: the first sexp always regenerates the buffer.
;;      (find-efunction 'find-lualatex-links)
;;      ""
;;      (kill-new ,(concat "  LATEX/" stem ".tex\n"))
;;      (kill-new ,(concat "  LATEX/" stem ".lua\n"))
;;      (find-blogme3 "anggmake.lua" "anggtranslate")
;;      (find-blogme3 "anggmake.lua" "anggtranslate" "LATEX/")
;;      (ee-copy-rest 1 '(find-LATEX ,(concat stem ".tex")))
;;      ""
;;      ,(ee-template0 "\
;; % (find-angg \"LATEX/{stem}.tex\")
;; % (find-angg \"LATEX/{stem}.lua\")
;; % (defun c () (interactive) (find-LATEXsh \"lualatex -record {stem}.tex\"))
;; % (defun c () (interactive) (find-LATEXsh \"lualatex --output-format=dvi {stem}.tex\"))
;; % (defun d () (interactive) (find-xpdfpage \"~/LATEX/{stem}.pdf\"))
;; % (defun d () (interactive) (find-xdvipage \"~/LATEX/{stem}.dvi\"))
;; % (defun e () (interactive) (find-LATEX \"{stem}.tex\"))
;; % (defun l () (interactive) (find-LATEX \"{stem}.lua\"))
;; % (defun u () (interactive) (find-latex-upload-links \"{stem}\"))
;; % (defun z () (interactive) (find-zsh \"flsfiles-tgz {stem}.fls {stem}.tgz\")
;; % (find-xpdfpage \"~/LATEX/{stem}.pdf\")
;; % (find-xdvipage \"~/LATEX/{stem}.dvi\")
;; % (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")
;;      ;;
;;      "\
;; \\documentclass[oneside]{book}
;; \\usepackage[colorlinks]{hyperref} % (find-es \"tex\" \"hyperref\")
;; %\\usepackage[latin1]{inputenc}
;; \\usepackage{amsmath}
;; \\usepackage{amsfonts}
;; \\usepackage{amssymb}
;; \\usepackage{pict2e}
;; \\usepackage{color}                % (find-LATEX \"edrx15.sty\" \"colors\")
;; \\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{edrx15}               % (find-angg \"LATEX/edrx15.sty\")
;; \\input edrxaccents.tex            % (find-angg \"LATEX/edrxaccents.tex\")
;; \\input edrxchars.tex              % (find-LATEX \"edrxchars.tex\")
;; \\input edrxheadfoot.tex           % (find-dn4ex \"edrxheadfoot.tex\")
;; \\input edrxgac2.tex               % (find-LATEX \"edrxgac2.tex\")
;; %
;; \\begin{document}
;; 
;; \\catcode`\\^^J=10
;; \\directlua{dednat6dir = \"dednat6/\"}
;; \\directlua{dofile(dednat6dir..\"dednat6.lua\")}
;; \\directlua{texfile(tex.jobname)}
;; \\directlua{verbose()}
;; %\\directlua{output(preamble1)}
;; \\def\\expr#1{\\directlua{output(tostring(#1))}}
;; \\def\\eval#1{\\directlua{#1)}}
;; \\def\\pu{\\directlua{pu()}}
;; 
;; \\directlua{dofile \"edrxtikz.lua\"} % (find-LATEX \"edrxtikz.lua\")
;; \\directlua{dofile \"edrxpict.lua\"} % (find-LATEX \"edrxpict.lua\")
;; %L V.__tostring = function (v) return format(\"(%.3f,%.3f)\", v[1], v[2]) end
;; 
;; \\end{document}
;; 
;; % Local Variables:
;; % coding: utf-8-unix
;; % ee-anchor-format: \"«%s»\"
;; % End:"
;;      ;;
;;      ,(ee-template0 "\n\n\n
;; % (ee-copy-rest 1 '(find-LATEX \"{stem}.lua\"))
;; 
;; -- This file:
;; -- http://angg.twu.net/LATEX/{stem}.lua
;; -- http://angg.twu.net/LATEX/{stem}.lua.html
;; --              (find-LATEX \"{stem}.lua\")
;; -- See:         (find-LATEX \"{stem}.tex\")
;; 
;; --[[
;; * (eepitch-lua51)
;; * (eepitch-kill)
;; * (eepitch-lua51)
;; dofile \"{stem}.lua\"
;; 
;; --]]
;; 
;; 
;; -- Local Variables:
;; -- coding: raw-text-unix
;; -- End:")
;;      ) pos-spec-list))




;; Test: (find-lualatex-links "2015-1-C2-figuras1")
;; Test: (find-lualatex-links "tmp2")
;; Test: (find-lualatex-links ___)






;; «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-curso-links» (to ".find-curso-links")

(defun find-curso-links (&optional year sem name nlines &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}"))
  (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)
;;      ,(ee-template0 "\
;; ")
     )
   pos-spec-list))

;; (find-estring (ee-find-curso-script "2016" "1" "GA" "20"))
;;
(defun ee-find-curso-script (year sem name nlines)
  "Return a list of sexps and strings for curso.
This is an internal function used by `find-curso-links'."
  (ee-template0 "\
# (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
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
#
* (kill-new (find-sh00 \"cat /tmp/o\"))
* (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 -v $A edrx@angg.twu.net:/home/edrx/slow_html/{year}.{sem}-{name}/
Scp-np -v $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
{
Scp-np -v {year}.{sem}-{name}.{<}djvu,pdf{>} edrx@angg.twu.net:/home/edrx/slow_html/{year}.{sem}-{name}/
Scp-np -v {year}.{sem}-{name}.{<}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\"))

# (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-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)






;;
;; Local Variables:
;; mode:                 emacs-lisp
;; coding:               raw-text-unix
;; ee-delimiter-hash:    "\n#*\n"
;; ee-delimiter-percent: "\n%*\n"
;; ee-anchor-format:     "«%s»"
;; ee-comment-prefix:    ";;"
;; End: