Warning: this is an htmlized version!
The original is here, and the conversion rules are here. |
Some template-based functions of eev that are not five-minute hacks Eduardo Ochs December 24, 2020 1. `find-find-links-links-new' ============================== My presentation at the EmacsConf 2020 was titled "On why most of the best features in eev look like 5-minute hacks", and its last section was about this... (code-video "eev2020video" "$S/http/angg.twu.net/eev-videos/emacsconf2020.mp4") (find-eev2020video "42:05" "4. A tale of several 'The User's") (find-eev2020video "43:27" "user-friendly and hacker-friendly at the same time") (find-eev2020video "43:49" "(find-emacs-tangents-links)") (find-emacs-tangents-links) (find-efunction 'find-emacs-tangents-links) The "skeleton" for that function was created with: (find-find-links-links-new "emacs-tangents" "yyyy mm dd msg txtstem" "") after generating the skeleton I just inserted this in it, # https://sachachua.com/blog/{yyyy}/ # https://sachachua.com/blog/{yyyy}/{mm}/ # https://sachachua.com/blog/{yyyy}/{mm}/{yyyy}-{mm}-{dd}-emacs-news/ # https://lists.gnu.org/archive/html/emacs-tangents/{yyyy}-{mm}/ # https://lists.gnu.org/archive/html/emacs-tangents/{yyyy}-{mm}/{msg}.html * (eepitch-shell) * (eepitch-kill) * (eepitch-shell) # (find-fline \"~/usrc/emacs-tangents/\") # (find-fline \"~/usrc/emacs-tangents/{yyyy}-{mm}-{dd}-emacs-news.org\") mkdir -p ~/usrc/emacs-tangents/ cd ~/usrc/emacs-tangents/ # rm -v {yyyy}-{mm}-{dd}-emacs-news.org wget -nc -O {yyyy}-{mm}-{dd}-emacs-news.org \\ https://lists.gnu.org/archive/html/emacs-tangents/{yyyy}-{mm}/{txtstem}.txt and I had a prototype. `find-find-links-links-new' is the successor of `find-find-links-links', and it took some work to make it indent everything correctly both with and without a `let*' block... (find-efunction 'find-find-links-links-new) 2. `M-x brep' ============= (find-eev-intro "8. (find-psne-intro)") (find-psne-intro) (find-psne-intro "1. Local copies of files from the internet") (find-psne-intro "3. The new way: `M-x brep'") 3. The function that defines `brep' =================================== (find-efunctiondescr 'brep) (find-eev "eev-brxxx.el" "code-brxxxs") (code-brurl 'find-psne-links :remote 'brep) (find-code-brurl 'find-psne-links :remote 'brep) The general idea is explained here: (find-eev2020video "17:20" "find-code-c-d shows the code that code-c-d would execute") (find-eev-quick-intro "9. Shorter hyperlinks") (find-eev-quick-intro "9.1. `code-c-d'") (find-eev-quick-intro "`code-c-d' produces a big string using a template") (find-eev-quick-intro "If we add" "a" "find-" "before the `code-c-d'") (find-eev-quick-intro "9.2. Extra arguments to `code-c-d'") 4. `find-esetkey-links' ======================= (find-esetkey-links) ;; (find-esetkey-links (kbd "s-t") 'tool-bar-mode) (global-set-key (kbd "s-t") 'tool-bar-mode) ;; (find-esetkey-links (kbd "s-m") 'menu-bar-mode) (global-set-key (kbd "s-m") 'menu-bar-mode) ;; (find-esetkey-links (kbd "s-w") 'wrap) (define-key eev-mode-map (kbd "s-w") 'wrap) ;; (find-efunction 'wrap) ;; (defun wrap (p) (interactive "P") "Toggle truncate-lines" ;; (if p (setq truncate-lines (eq p 0)) ;; (setq truncate-lines (not truncate-lines)))) 5. `find-youtubedl-links' ========================- Warning: this one does LOTS of magic! Idea: if we twist the notion of "user" in exactly the right way then "user-friendly" and "hacker-friendly" become very similar. Docs: (find-audiovideo-intro "6. Youtube-dl") (find-efunction 'find-youtubedl-links) (find-efunction 'find-youtubedl-links "LOTS of internal functions") Preparation for the demo: * (eepitch-shell) * (eepitch-kill) * (eepitch-shell) # (find-fline "/tmp/yt-videos/") rm -Rv /tmp/yt-videos/ mkdir /tmp/yt-videos/ cd /tmp/yt-videos/ (setq ee-youtubedl-dirs '("/tmp/yt-videos/")) (setq ee-youtubedl-dir "/tmp/yt-videos/") "The problem with reading Shakespeare and Ancient Greek Plays" https://www.youtube.com/watch?v=vs3-HGB6iEw 0:31: there is a long stretch in the middle of the play where Jokasta, the queen, has no lines (find-preadingvideo) (find-preadingvideo "0:00") (find-preadingvideo "0:31") https://www.youtube.com/watch?v=vs3-HGB6iEw (find-youtubedl-links nil nil "vs3-HGB6iEw") 6. `find-here-links' and `find-extra-file-links' ================================================ See: (find-here-links-intro) (find-refining-intro) (find-audiovideo-intro "4.1. `find-extra-file-links'")