Warning: this is an htmlized version!
The original is here, and the conversion rules are here. |
;; This file: ;; http://anggtwu.net/ORG/2025-modern.org.html ;; http://anggtwu.net/ORG/2025-modern.org ;; (find-angg "ORG/2025-modern.org") ;; Author: Eduardo Ochs <eduardoochs@gmail.com> ;; ;; See: (find-angg "ORG/2025-modern.org") ;; (find-angg "elisp/2025-modern-advice.el") ;; (find-angg "elisp/2025-modern-prints.el") ;; (find-angg "elisp/2025-modern-reset.el") ;; (find-angg "elisp/emacsconf2024.el") ;; ;; (load "~/elisp/emacsconf2024.el") ;; (set-face-foreground 'org-link "chocolate1") ;; (find-angg "elisp/emacsconf2024.el") ;; ;; (find-angg "elisp/2025-advice.el") ;; (find-es "emacs" "lambdas-for-beginners") ;; (find-efunction 'find-clprin1ind) ;; ;; «.0» (to "0") ;; «.1» (to "1") ;; «.2» (to "2") ;; «.3» (to "3") ;; «.4» (to "4") ;; «.5» (to "5") ;; «.6» (to "6") «0» (to ".0") (defun hockney () (interactive) (find-fline "~/tmp/David Hockney. The arrival of spring, Woldgate, east Yorkshire 2011.jpg")) (find-2a nil '(hockney)) (font "Inconsolata 17" :p) Some problems of modernizing Emacs ================================== http://anggtwu.net/2025-modern.html http://anggtwu.net/#eev Eduardo Ochs 2025mar12 «1» (to ".1") (font "Inconsolata 16" :p) 1. The main themes of this video ================================ 1.1. Emacs have changed a lot in its recent versions and now it has lots of types - its current class tree looks like this: (find-classtree 't) (find-ebuffer "*(find-classtree t)*") 1.2. People used to say "Anyone can learn Lisp in one day" - but now this is gone - I will show why. 1.3. I will also show how to display better "inner views" of Emacs objects by using several tricks with/based on `cl-prin1-to-string'. Some examples, slightly edited: (modern-output "lambdas") (modern-output "advice") (modern-output "class") 1.4. The buttons in "*Help*" buffers are black boxes. For example: (describe-type 'cl-structure-class) (find-2a nil '(find-etypedescr 'cl-structure-class)) «2» (to ".2") (font "Inconsolata 20" :p) 2. Anyone can learn Lisp in one day =================================== From my presentation at the EmacsConf 2024... (find-eev2024hsubs "10:38" "9. Abelson and Sussman") (find-eev2024video "10:38" "9. Abelson and Sussman") (find-eev2024video "11:12" "Anyone can learn Lisp in one day...") (find-eev2024hsubs "11:20" "And I would add: and if the person") (find-eev2024hsubs "11:24" "is starting with Doom Emacs then it would") (find-eev2024hsubs "11:26" "take take five years.") http://anggtwu.net/emacsconf2024.html «3» (to ".3") (font "Inconsolata 25" :p) 3. Lambdas for beginners ======================== See: (find-elisp-intro "6. Defining functions") (setq foo 42) (defun foo (a) (* 10 a)) (symbol-value 'foo) ;; -> 42 (symbol-function 'foo) ;; -> (lambda (a) (* 10 a)) (foo foo) ((lambda (a) (* 10 a)) 42) (* 10 42) 420 «4» (to ".4") (font "Inconsolata 16" :p) "Anyone can learn Lisp in one day..." ^ now this is gone. 4. Lambdas for beginners broken =============================== (defun foo (a b) (+ a b)) (symbol-function 'foo) ;; old -> (lambda (a b) (+ a b)) ;; now -> #[(a b) ((+ a b)) nil] Some terminology... This is an "old-style lambda": (lambda (a b) (+ a b)) This is a "vector-like lambda": #[(a b) ((+ a b)) nil] Until mid-2024 beginners could learn a lot of Lisp by thinking only in terms of objects like these... (defun foo (a b) (+ a b)) (lambda (a b) (+ a b)) .______.____._____. ._______._____. | | | | | | | defun foo .__. .__.__. lambda .__. .__.__. | | | | | | | | | | a b + a b a b + a b Then vector-like lambdas started to appear in many places. «5» (to ".5") (font "Inconsolata 16" :p) 5. Lambdas for beginners broken (2) =================================== This is an "old-style lambda": (lambda (a b) (+ a b)) This is a "vector-like lambda": #[(a b) ((+ a b)) nil] Until mid-2024 beginners could learn a lot of Lisp by thinking only in terms of objects like these... (defun foo (a b) (+ a b)) (lambda (a b) (+ a b)) .______.____._____. ._______._____. | | | | | | | defun foo .__. .__.__. lambda .__. .__.__. | | | | | | | | | | a b + a b a b + a b Then vector-like lambdas started to appear in many places. Before mid-2024 beginners could open (black?) boxes like... (symbol-function 'foo) ...and they would see something elegant and mind-blowing... Now they see a tiny part of a very complex structure, and they are overwhelmed (instead of mind-blown). ^ I was overwhelmed for years - and in this video I am going to pretend that I was not the only one. «6» (to ".6") (font "Noto Mono 13" :p) 6. For the impatient: try this ============================== I hate videos that present things that look fantastic but that are very hard to install... and I've been experimenting with things that can be installed - in /tmp/ - in seconds. So, copy this from http://anggtwu.net/2025-modern.html to an Emacs buffer, and... * (eepitch-shell) * (eepitch-kill) * (eepitch-shell) cd /tmp/ wget -N http://anggtwu.net/elisp/2025-modern-prints.el wget -N http://anggtwu.net/elisp/2025-modern-reset.el wget -N http://anggtwu.net/elisp/2025-modern-button.el * (code-c-d "modern" "/tmp/" :anchor) * (add-to-list 'load-path "/tmp/") * (load "2025-modern-prints.el") * (find-2a nil '(find-modern "2025-modern-prints.el" "advice-adt")) * (find-2a nil '(find-efunctiondescr 'adt-2)) * (find-2a nil '(find-epp adt-o)) * (find-2a nil '(find-clprin2 adt-o)) * (load "2025-modern-reset.el") * (find-2a nil '(find-clprin2 adt-o)) * (load "2025-modern-prints.el") * (find-2a nil '(find-clprin2 adt-o)) * (find-2a nil '(find-clprin2 (cl-find-class 'cl-structure-class))) * (load "2025-modern-button.el") * (find-2a nil '(find-modern "2025-modern-button.el" "find-ebutton-links")) * (code-c-d "modern" "~/elisp/" :anchor) * (eepitch-shell) * (eepitch-kill) * (eepitch-shell) rm -fv /tmp/2025-modern-prints.el rm -fv /tmp/2025-modern-reset.el rm -fv /tmp/2025-modern-button.el * (eepitch-shell) * (eepitch-kill) * (eepitch-shell) cp -v ~/elisp/2025-modern-prints.el /tmp/ cp -v ~/elisp/2025-modern-reset.el /tmp/ cp -v ~/elisp/2025-modern-button.el /tmp/ (font "Noto Mono 16" :p) Note: this is a video for people who hate videos - (find-show-conses-2a '(defun foo (a b) (+ a b))) (find-show-conses-2a '(lambda (a b) (+ a b))) (find-es "emacs" "lambdas-for-beginners") Broken in what sense? Edrx-unfriendly? ====================================== From: http://anggtwu.net/2024-eev-for-5-year-olds.html#taking-apart (find-TH "2024-eev-for-5-year-olds" "taking-apart") Note: Eduardo Ochs Ed r x ...eev is more like a toy that is _slightly interesting_ if you play with it for a few seconds, and _much more interesting_ if you open it and take its pieces apart to see how everything works. (defun foo (a) (* 10 a)) (find-efunctiondescr 'foo) (symbol-function 'foo) ;; -> #[(a) ((* 10 a)) nil] (find-classtree 't) (find-ebuffer "*(find-classtree t)*" "interpreted-function") (find-ebuffer "*(find-classtree t)*" "closure") (find-ebuffer "*(find-classtree t)*" "built-in-class") (find-eaproposf "interpreted-function") (find-clprin1ind (cl-find-class 'interpreted-function)) (find-clprin1ind (cl-find-class 'cl-structure-class)) (find-clprin1ind (cl-find-class 'cl-structure-class)) (find-clprin1ind (cl-find-class 'myab)) Problem 2: advice is difficult (for me) ======================================= (find-angg "elisp/2025-modern-advice.el") Problem 3: the "describe-*" functions ===================================== (describe-function 'adt-2) (find-efunctiondescr 'adt-2) # (find-sh "dict \"rat's nest\"") # Local Variables: # coding: utf-8-unix # modes: (org-mode emacs-lisp-mode) # End: