branch: externals/eev commit 97459ec174e692120f7a26609d0dc2d41c4b4ba2 Author: Eduardo Ochs <eduardoo...@gmail.com> Commit: Eduardo Ochs <eduardoo...@gmail.com>
Added links to a discussion on help-gnu-emacs about dyn/lex binding. --- ChangeLog | 11 +++++++++ VERSION | 4 ++-- eepitch.el | 3 ++- eev-intro.el | 73 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++--- eev-tlinks.el | 27 ++++++++++++++-------- eev.el | 2 +- 6 files changed, 104 insertions(+), 16 deletions(-) diff --git a/ChangeLog b/ChangeLog index 9b6e4ab..d0d8f64 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,14 @@ +2021-08-16 Eduardo Ochs <eduardoo...@gmail.com> + + * eev-intro.el (find-lexical-intro): added a section "5. A thread" + with links to a discussion in the help-gnu-emacs mailing list. + + * eepitch.el (find-vtermprocess): added a `(require 'vterm)'. + +2021-08-14 Eduardo Ochs <eduardoo...@gmail.com> + + * eev-tlinks.el (bryl): commented out. + 2021-08-13 Eduardo Ochs <eduardoo...@gmail.com> * eev-intro.el (find-lexical-intro): new function. diff --git a/VERSION b/VERSION index ef91aca..fa564b5 100644 --- a/VERSION +++ b/VERSION @@ -1,2 +1,2 @@ -Sat Aug 14 02:49:07 GMT 2021 -Fri Aug 13 23:49:07 -03 2021 +Mon Aug 16 15:52:15 GMT 2021 +Mon Aug 16 12:52:15 -03 2021 diff --git a/eepitch.el b/eepitch.el index 1f56ed3..7f44b3d 100644 --- a/eepitch.el +++ b/eepitch.el @@ -19,7 +19,7 @@ ;; ;; Author: Eduardo Ochs <eduardoo...@gmail.com> ;; Maintainer: Eduardo Ochs <eduardoo...@gmail.com> -;; Version: 20210811 +;; Version: 20210816 ;; Keywords: e-scripts ;; ;; Latest version: <http://angg.twu.net/eev-current/eepitch.el> @@ -787,6 +787,7 @@ vterm, asking it to create a buffer with that name and to run a vterm on it. If PROGRAM is given then ask vterm to run PROGRAM there instead of the default shell.\n This function is a prototype and will probably change." + (require 'vterm) (let ((buffername (if name (format "*vterm: %s*" name) "*vterm*")) (vterm-shell (or program vterm-shell))) (if (get-buffer buffername) diff --git a/eev-intro.el b/eev-intro.el index 43a2c5b..fb2726a 100644 --- a/eev-intro.el +++ b/eev-intro.el @@ -19,7 +19,7 @@ ;; ;; Author: Eduardo Ochs <eduardoo...@gmail.com> ;; Maintainer: Eduardo Ochs <eduardoo...@gmail.com> -;; Version: 20210813 +;; Version: 20210816 ;; Keywords: e-scripts ;; ;; Latest version: <http://angg.twu.net/eev-current/eev-intro.el> @@ -13195,7 +13195,8 @@ looks at first sight. See, for example: Some functions in eev expect code that is meant to be `eval'-ed later. For example: - (find-multiwindow-intro \"(find-wset\" \"13o_2o_o\") + (find-multiwindow-intro \"2. `find-wset'\") + (find-multiwindow-intro \"2. `find-wset'\" \"(find-wset\" \"13o_2o_o\") (find-wset \"13o_2o_o\" '(find-ebuffer \"B\") '(find-ebuffer \"C\")) The functions in the `code-c-d' family produce code that is first @@ -13483,7 +13484,7 @@ will give you information about the current definition. Source code: (find-efunction 'find-lexical-intro) More intros: (find-eev-quick-intro) (find-eev-intro) - (find-eepitch-intro) + (find-elisp-intro) This buffer is _temporary_ and _editable_. It is meant as both a tutorial and a sandbox. @@ -13717,6 +13718,72 @@ lexical environment.\" +4. Alpha-conversion +=================== +;; In lexical binding mode alpha-conversion works: +;; https://en.wikipedia.org/wiki/Lambda_calculus#%CE%B1-conversion +;; Try: + +(setq b 3) +(defun getb () b) + +(list + (let ((a 2)) (list a (getb))) + (let ((b 2)) (list b (getb))) + ) + +;; In lexical binding mode the 4-line `list' sexp returns a list +;; of two identical lists. These two `let' sexps are equivalent: +;; +;; (let ((a 2)) (list a (getb))) +;; (let ((b 2)) (list b (getb))) +;; +;; and the choice of `a' or `b' for the name of the variable +;; doesn't matter. In dynamic binding mode the `b' of the +;; `(let ((b ...)) ...)' is seen by the (getb), and it shadows +;; the global `b'. + + + + +5. A thread +=========== +It title was: \"Lexical vs. dynamic: small examples?\". +Here is a link to the thread itself and links to the posts that I +considered best or more important: + + https://lists.gnu.org/archive/html/help-gnu-emacs/2021-08/threads.html#00283 + https://lists.gnu.org/archive/html/help-gnu-emacs/2021-08/msg00283.html + https://lists.gnu.org/archive/html/help-gnu-emacs/2021-08/msg00294.html + https://lists.gnu.org/archive/html/help-gnu-emacs/2021-08/msg00314.html + https://lists.gnu.org/archive/html/help-gnu-emacs/2021-08/msg00342.html + https://lists.gnu.org/archive/html/help-gnu-emacs/2021-08/msg00344.html + https://lists.gnu.org/archive/html/help-gnu-emacs/2021-08/msg00345.html + https://lists.gnu.org/archive/html/help-gnu-emacs/2021-08/msg00352.html + https://lists.gnu.org/archive/html/help-gnu-emacs/2021-08/msg00355.html + https://lists.gnu.org/archive/html/help-gnu-emacs/2021-08/msg00350.html + https://lists.gnu.org/archive/html/help-gnu-emacs/2021-08/msg00341.html + +And here are (elisp hyper)links with descriptions: + +(defun ee-dynlex-url (nnnnn) + (format \"https://lists.gnu.org/archive/html/help-gnu-emacs/%s/msg%s.html\" + \"2021-08\" nnnnn)) + +(defun find-dynlexpost (nnnnn &rest ignored) + (find-eww (ee-dynlex-url nnnnn))) + +(find-dynlexpost \"00283\" \"Edrx\" \"initial post\") +(find-dynlexpost \"00294\" \"Edrx\" \"primary source\") +(find-dynlexpost \"00314\" \"Drew\" \"for the dynamic extent of the function call\") +(find-dynlexpost \"00342\" \"Drew\" \"binds special vars dynamically and\") +(find-dynlexpost \"00344\" \"Stefan\" \"same as in code analysis\") +(find-dynlexpost \"00345\" \"Drew\" \"by pretty much all of the wizards of Lisp\") +(find-dynlexpost \"00352\" \"Drew\" \"dynamically binds a lambda to a name\") +(find-dynlexpost \"00355\" \"Drew\" \"dyna-show.el\") +(find-dynlexpost \"00355\" \"Stefan\" \"lexical-let and dlet\") +(find-dynlexpost \"00341\" \"Drew\" \"scope and extent are different things\") + " pos-spec-list))) ;; (find-lexical-intro) diff --git a/eev-tlinks.el b/eev-tlinks.el index 5db38ee..c782890 100644 --- a/eev-tlinks.el +++ b/eev-tlinks.el @@ -19,7 +19,7 @@ ;; ;; Author: Eduardo Ochs <eduardoo...@gmail.com> ;; Maintainer: Eduardo Ochs <eduardoo...@gmail.com> -;; Version: 20210813 +;; Version: 20210816 ;; Keywords: e-scripts ;; ;; Latest version: <http://angg.twu.net/eev-current/eev-tlinks.el> @@ -1094,11 +1094,19 @@ cd {dir} (autoload 'browse-url-url-at-point "browse-url") -(defun bryl (url) - "Play a local copy of a video downloaded from youtube." - (interactive (list (browse-url-url-at-point))) - (let ((fname (and url (ee-youtubedl-url-to-fname url)))) - (if fname (find-video fname)))) +;; TODO: +;; Redefine this using: (find-eevfile "eev-brxxx.el") +;; and add error handling. Tests: +;; (setq ee-my-url "http://www.youtube.com/watch?v=tby5aMrMu6Q") +;; (ee-youtubedl-url-to-hash ee-my-url) +;; (ee-youtubedl-url-to-fname ee-my-url) +;; (find-evardescr 'ee-youtubedl-dirs) +;; +;; (defun bryl (url) +;; "Play a local copy of a video downloaded from youtube." +;; (interactive (list (browse-url-url-at-point))) +;; (let ((fname (and url (ee-youtubedl-url-to-fname url)))) +;; (if fname (find-video fname)))) @@ -2182,7 +2190,7 @@ dofile \\\"%s\\\" (apply 'find-elinks `((find-texlive-links ,date ,@pos-spec-list) ;; Convention: the first sexp always regenerates the buffer. - (find-texlive-links "20190809") + (find-texlive-links "20210816") (find-efunction 'find-texlive-links) "" ,(ee-template0 "\ @@ -2196,6 +2204,7 @@ dofile \\\"%s\\\" # (find-fline \"~/usrc/\" \"install-tl-\") # (find-fline \"~/.texlive2018/\") # (find-fline \"~/.texlive2019/\") +# (find-fline \"~/.texlive2021/\") # (find-fline \"/usr/local/texlive/2018/\") # (find-fline \"/usr/local/texlive/2019/\") # (find-fline \"/usr/local/texlive/2019/\" \"install-tl.log\") @@ -2204,8 +2213,8 @@ dofile \\\"%s\\\" (eepitch-shell2) (eepitch-kill) (eepitch-shell2) -# rm -rfv ~/.texlive2018/ -# sudo rm -rfv /usr/local/texlive/2018/ +# rm -rfv ~/.texlive2021/ +# sudo rm -rfv /usr/local/texlive/2021/ mkdir -p $S/http/mirror.ctan.org/systems/texlive/tlnet/ cd $S/http/mirror.ctan.org/systems/texlive/tlnet/ diff --git a/eev.el b/eev.el index 0b9abf6..8b58af3 100644 --- a/eev.el +++ b/eev.el @@ -6,7 +6,7 @@ ;; Package-Requires: ((emacs "24.4")) ;; Keywords: lisp e-scripts ;; URL: http://angg.twu.net/#eev -;; Version: 20210813 +;; Version: 20210816 ;; This program is free software; you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by