[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/eev 7037317e4c: Added `find-clprin2'.
From: |
ELPA Syncer |
Subject: |
[elpa] externals/eev 7037317e4c: Added `find-clprin2'. |
Date: |
Wed, 5 Mar 2025 15:58:35 -0500 (EST) |
branch: externals/eev
commit 7037317e4c1119f02955a98152f99e5ac01ce9a0
Author: Eduardo Ochs <eduardoochs@gmail.com>
Commit: Eduardo Ochs <eduardoochs@gmail.com>
Added `find-clprin2'.
---
ChangeLog | 11 +++++++++++
VERSION | 4 ++--
eev-blinks.el | 55 ++++++++++++++++++++++++++++++++++++++++---------------
eev-code.el | 31 ++++++++++++++++++++++---------
eev-elinks.el | 10 +++++++---
eev-intro.el | 10 +++++++++-
6 files changed, 91 insertions(+), 30 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 52cf30afe4..75e0849b4b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2025-03-05 Eduardo Ochs <eduardoochs@gmail.com>
+
+ * eev-blinks.el (find-clprin2, ee-clprin2): new aliases.
+
+2025-03-04 Eduardo Ochs <eduardoochs@gmail.com>
+
+ * eev-code.el (ee-code-c-d-add-pair): use `ee-aset' instead of
+ `ee-areplace'.
+ ("el"): made `find-elfile' point to ".../lisp/emacs-lisp/" instead
+ of to ".../lisp/".
+
2025-03-02 Eduardo Ochs <eduardoochs@gmail.com>
* eev-blinks.el (find-eaproposf, find-eaproposv, find-eapropost):
diff --git a/VERSION b/VERSION
index d8fb006f02..ded0f68250 100644
--- a/VERSION
+++ b/VERSION
@@ -1,2 +1,2 @@
-Sun Mar 2 22:27:05 GMT 2025
-Sun Mar 2 19:27:05 -03 2025
+Wed Mar 5 20:50:17 GMT 2025
+Wed Mar 5 17:50:17 -03 2025
diff --git a/eev-blinks.el b/eev-blinks.el
index b50b45b9e5..05e3e17438 100644
--- a/eev-blinks.el
+++ b/eev-blinks.el
@@ -21,7 +21,7 @@
;;
;; Author: Eduardo Ochs <eduardoochs@gmail.com>
;; Maintainer: Eduardo Ochs <eduardoochs@gmail.com>
-;; Version: 20250302
+;; Version: 20250305
;; Keywords: e-scripts
;;
;; Latest version: <http://anggtwu.net/eev-current/eev-blinks.el>
@@ -1158,8 +1158,8 @@ fieldname value\", like this:
;; (find-efunction 'cl-prin1-to-string)
;;
;; In this section we define the functions `find-clprin1',
-;; `find-clprin1s' and `find-clprin1ind', that are based on
-;; `cl-prin1-to-string'. Try:
+;; `find-clprin1s', `find-clprin1ind', and `find-clprin2',, that are
+;; based on `cl-prin1-to-string'. Try:
;;
;; (cl-defstruct mytriple a b c)
;; (make-mytriple :a 22 :c "44")
@@ -1168,9 +1168,14 @@ fieldname value\", like this:
;; (cl-find-class 'cl-structure-class)
;; (find-2a nil '(find-clprin1ind (cl-find-class 'cl-structure-class)))
;;
+;; The `s' in `find-clprin1s' is a plural, and the `ind' in
+;; `find-clprin1ind' means "indent in a nice way". `clprin2' is an
+;; alias for `clprin1ind'.
+;;
;; Here are some examples of classes with special `cl-print-object'
;; methods:
;;
+;; (find-efunctiondescr 'cl-print-object)
;; (find-egrep "grep --color=auto -nH --null -e cl-print-object *.el */*.el")
;;
;; Some tests for `print-level':
@@ -1200,6 +1205,8 @@ right places in the output of `cl-prin1-to-string' and
then runs
`ee-indent-as-elisp' in the result."
(apply 'find-estring-elisp (ee-clprin1ind o) pos-spec-list))
+(defalias 'find-clprin2 'find-clprin1ind)
+
;; Low-level functions used by `find-clprin1' and friends.
;; I sometimes use them with `-->', the main threading macro of
@@ -1226,11 +1233,15 @@ right places in the output of `cl-prin1-to-string' and
then runs
;; (find-estring-elisp (ee-clprin1 (cl-find-class 'cl-structure-class)))
;; (find-estring-elisp (ee-clprin1ind (cl-find-class 'cl-structure-class)))
(defun ee-clprin1ind (o)
+ "Like `cl-prin1-to-string', but indents the result in a nice way."
(let* ((str1 (cl-prin1-to-string o))
(str2 (replace-regexp-in-string " :" "\n:" str1))
(str3 (replace-regexp-in-string " #s" "\n#s" str2))
- (str4 (ee-indent-as-elisp str3)))
- str4))
+ (str4 (replace-regexp-in-string "•[ \n]+" " " str3)) ; a hack!
+ (str5 (ee-indent-as-elisp str4)))
+ str5))
+
+(defalias 'ee-clprin2 'ee-clprin1ind)
@@ -1880,21 +1891,34 @@ Hint: install the Debian package \"unicode-data\".")
;;; \___|_|\___/|___/\__,_|_| \___||___/
;;;
;; «ee-symbol-function» (to ".ee-symbol-function")
-;; This is an experimental hack for handling some versions of Emacs31. See:
-;; https://lists.gnu.org/archive/html/help-gnu-emacs/2024-07/msg00292.html
-;; https://lists.gnu.org/archive/html/help-gnu-emacs/2024-07/msg00311.html
-;; https://lists.gnu.org/archive/html/help-gnu-emacs/2024-07/msg00328.html
-;; (find-efile "emacs-lisp/cl-preloaded.el" "(cl--define-built-in-type
closure")
-;; TODO: fix this:
-;; (find-elisp-intro "6. Defining functions")
+;; Some terminology: if we run
+;;
+;; (defun foo (a) (* 10 a))
+;; (symbol-function 'foo)
+;;
+;; the result used to be an "old-style lambda": (lambda (a) (* 10 a))
+;; but in newer emacses it is a "vector-like lambda": #[(a) ((* 10 a)) nil]
+;;
+;; Many functions in eev expect old-style lambdas - and this is a hack
+;; that makes them work in newer emacses. See:
+;; https://lists.gnu.org/archive/html/help-gnu-emacs/2024-07/msg00292.html
+;; https://lists.gnu.org/archive/html/help-gnu-emacs/2024-07/msg00311.html
+;; https://lists.gnu.org/archive/html/help-gnu-emacs/2024-07/msg00328.html
+;; (find-es "emacs" "lambdas-for-beginners")
+;; http://anggtwu.net/2025-modern.html
+;;
+;; The names of the fields of a vector-like lambda can be found here:
+;; (find-elfile "cl-preloaded.el" "built-in-type closure" "vector-like")
+;;
+;; TODO: Fix this: (find-elisp-intro "6. Defining functions")
(defun ee-closure-to-list (c)
- "Experimental!!! See the comments in the source!"
+ "Convert a \"vector-like lambda\" to a list."
(cl-loop for i from 1 to (length c)
collect (aref c (1- i))))
(defun ee-closure-to-lambda (c)
- "Experimental!!! See the comments in the source!"
+ "Convert a \"vector-like lambda\" to an \"old-style lambda\"."
(let ((list (ee-closure-to-list c)))
(seq-let [arglist body _ _ docstring interactivespec] list
`(lambda ,arglist
@@ -1903,7 +1927,8 @@ Hint: install the Debian package \"unicode-data\".")
,@body))))
(defun ee-symbol-function (sym)
- "Experimental!!! See the comments in the source!"
+ "Like `symbol-function', but always returns an \"old-style lambda\".
+See the comments in the source!"
(let ((o (symbol-function sym)))
(if (and (fboundp 'closurep)
(closurep o))
diff --git a/eev-code.el b/eev-code.el
index f0aed58dc0..60632ce271 100644
--- a/eev-code.el
+++ b/eev-code.el
@@ -1,6 +1,6 @@
;;; eev-code.el -- `code-c-d', that generates and evaluates Lisp defuns. -*-
lexical-binding: nil; -*-
-;; Copyright (C) 2012-2024 Free Software Foundation, Inc.
+;; Copyright (C) 2012-2025 Free Software Foundation, Inc.
;;
;; This file is part of GNU eev.
;;
@@ -19,7 +19,7 @@
;;
;; Author: Eduardo Ochs <eduardoochs@gmail.com>
;; Maintainer: Eduardo Ochs <eduardoochs@gmail.com>
-;; Version: 20241027
+;; Version: 20250304
;; Keywords: e-scripts
;;
;; Latest version: <http://anggtwu.net/eev-current/eev-code.el>
@@ -68,11 +68,16 @@
;;; \__,_|_|_|___/\__|___/
;;;
;; «alists» (to ".alists")
-;; A simple and flexible implementation of argument lists.
-;; Inspired by: (find-node "(cl)Argument Lists")
-;; (find-node "(cl)Argument Lists" "&body")
-;; See also: (find-elnode "Symbol Type" ":" "keyword")
-;; (find-elnode "Constant Variables")
+;; Some functions for association lists. See:
+;; (find-elnode "Association Lists")
+;; Note: these functions are from 2019! At that point I found the
+;; standard functions for alists confusing, and I felt that it would
+;; be better to write my own variants, with simpler semantics...
+;; See also:
+;; (find-node "(cl)Argument Lists")
+;; (find-node "(cl)Argument Lists" "&body")
+;; (find-elnode "Symbol Type" ":" "keyword")
+;; (find-elnode "Constant Variables")
;; Test: (ee-aref '((1 . one) (2 . two) (3 . three)) 2)
;; -> two
@@ -140,7 +145,7 @@ and is used by `ee-find-xxxfile-sexps' and
`find-file-links'.")
(defun ee-code-c-d-add-pair (c d)
(setq d (format "%s" d))
- (setq ee-code-c-d-pairs (ee-areplace ee-code-c-d-pairs c (list d))))
+ (setq ee-code-c-d-pairs (ee-aset ee-code-c-d-pairs c (list d))))
@@ -368,7 +373,6 @@ Note: the POS-SPEC-LIST arguments are currently not used."
emacs-major-version emacs-minor-version)))
(code-c-d "eli" ee-emacs-lisp-directory "eintr" :gz) ; (find-elinode "Top")
-(code-c-d "el" ee-emacs-lisp-directory "elisp" :gz) ; (find-elnode "Top")
(code-c-d "e" ee-emacs-lisp-directory "emacs" :gz) ; (find-enode "Top")
(code-c-d "org" (ee-locate-library "org") "org" :gz) ; (find-orgnode "Top")
(code-c-d "cl" (ee-efile "emacs-lisp/") "cl" :gz) ; (find-clnode "Top")
@@ -378,6 +382,15 @@ Note: the POS-SPEC-LIST arguments are currently not used."
(code-c-d "equail" (ee-eleimfile "quail/") :gz)
(code-c-d "eetc" data-directory :gz)
+;; 2025mar04: INCOMPATIBLE CHANGE!
+;; Now `find-elfile' points to ".../lisp/emacs-lisp/" instead of
+;; to ".../lisp/", and, as it is declared last, doing
+;; (find-elfile "backquote.el")
+;; and then `M-x kl' will generate the right link.
+;;
+;; (code-c-d "el" ee-emacs-lisp-directory "elisp" :gz) ; (find-elnode "Top")
+(code-c-d "el" (ee-efile "emacs-lisp/") "elisp" :gz) ; (find-elfile "")
+
(code-c-d "eev" ee-eev-source-directory :anchor) ; (find-eev "")
(code-c-d "eevvideos" "$S/http/anggtwu.net/eev-videos/") ; (find-eevvideos "")
diff --git a/eev-elinks.el b/eev-elinks.el
index a4ea9db02a..72738e7eef 100644
--- a/eev-elinks.el
+++ b/eev-elinks.el
@@ -649,14 +649,17 @@ This is an internal function used by `find-ekey-links' and
(find-efunction 'find-etype-links)
""
,(ee-template0 "\
+# (find-eapropost \".*\")
# (find-eapropost \"{typeregexp}\")
# (find-eaproposf \"{typeregexp}\")
+# (find-eaproposf \"^{typesymbol}-\")
# (find-eaproposf \"^{typesymbol}--\")
# (find-etypedescr '{typesymbol})
# (cl-describe-type '{typesymbol})
# (find-eaproposf \"^{typesymbol}--\")
-# (--> '{typesymbol} cl-find-class cl--class-slots (mapconcat
'cl-prin1-to-string it \"\\n\"))
+# (--> '{typesymbol} cl-find-class cl--class-slots ee-clprin1s)
+# (--> '{typesymbol} cl-find-class cl--class-slots find-clprin1s)
# (find-efunction-links 'make-{typesymbol})
# (find-eloadhistory-for 'make-{typesymbol} 2 \" make-{typesymbol})\")
@@ -1478,8 +1481,9 @@ If D is t then try to use `ee-package-dir' to get the
directory."
{findelpafiles}
# (ee-package-dir '{pkg})
-# (find-epp (ee-package-desc '{pkg}))
-# (find-estruct (ee-package-desc '{pkg}))
+# (find-epp (package-get-descriptor '{pkg}))
+# (find-estruct (package-get-descriptor '{pkg}))
+# (find-clprin1ind (package-get-descriptor '{pkg}))
# (package-initialize)
# (package-refresh-contents)
diff --git a/eev-intro.el b/eev-intro.el
index 2f7f35fb52..e5743e455b 100644
--- a/eev-intro.el
+++ b/eev-intro.el
@@ -15794,7 +15794,15 @@ have run the `defalias'es below:
(defalias 'kli 'ee-kl-insert)
(defalias 'kla2 'eekla2)
-To make these aliases permanent, copy them to your ~/.emacs.
+The recommended way to activate these aliases is to load the file
+\"eev-aliases.el\". Most people use settings in which it is loaded by
+default - see:
+
+ (find-eev \"eev-aliases.el\" \"kla\")
+ (find-eev-levels-intro \"4. Aliases\")
+ (find-eev \"eev-beginner.el\" \"eev-beginner\")
+ (find-eev \"eev-beginner.el\" \"eev-beginner\" \"eev-aliases\")
+
Without these aliases everything in eev-kla.el will still work,
but you will have to type `M-x eekla' instead of `M-x kla', `M-x
eeklas' instead of `M-x klas', and so on.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [elpa] externals/eev 7037317e4c: Added `find-clprin2'.,
ELPA Syncer <=