[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/dict-tree baa4931 028/154: Doesn't quite work - revert
From: |
Stefan Monnier |
Subject: |
[elpa] externals/dict-tree baa4931 028/154: Doesn't quite work - revert to breaking setf abstraction |
Date: |
Mon, 14 Dec 2020 12:21:37 -0500 (EST) |
branch: externals/dict-tree
commit baa4931b883834c00deb187562d94c2ce3a74665
Author: Toby Cubitt <toby-predictive@dr-qubit.org>
Commit: tsc25 <toby-predictive@dr-qubit.org>
Doesn't quite work - revert to breaking setf abstraction
---
dict-tree.el | 96 +++++++++++++++++++++++++++++++++---------------------------
1 file changed, 53 insertions(+), 43 deletions(-)
diff --git a/dict-tree.el b/dict-tree.el
index e1214f8..63c5eb6 100644
--- a/dict-tree.el
+++ b/dict-tree.el
@@ -232,10 +232,18 @@ If START or END is negative, it counts from the end."
"Stores list of loaded dictionaries.")
-(defmacro dictree--cell-create (data &optional meta-data)
+;; (defstruct
+;; (dictree--cell
+;; :named
+;; (:constructor nil)
+;; (:constructor dictree--cell-create
+;; (data &optional plist)))
+;; data plist)
+
+(defmacro dictree--cell-create (data &optional plist)
;; INTERNAL USE ONLY
;; wrap the data in a cons cell
- `(cons ,data ,meta-data))
+ `(cons ,data ,plist))
;; get data component from data cons cell
(defmacro dictree--cell-data (cell) ; INTERNAL USE ONLY
@@ -262,52 +270,54 @@ If START or END is negative, it counts from the end."
(defalias 'dictree--set-cache-maxnum 'setcdr) ; INTERNAL USE ONLY
-(defmacro dictree--wrap-insfun-2 (f-2)
- ;; construct body of `dictree--wrap-insfun'
- (let ((comma-f `(nil ,f-2)))
- (setcar comma-f ',)
- (macroexpand-all
- `(lambda (new old)
- (setf (dictree--cell-data old)
- (,comma-f (dictree--cell-data new)
- (dictree--cell-data old)))))))
+;; (defmacro dictree--wrap-insfun-2 (f-2)
+;; ;; construct body of `dictree--wrap-insfun'
+;; (let ((comma-f `(nil ,f-2)))
+;; (setcar comma-f ',)
+;; (macroexpand-all
+;; `(lambda (new old)
+;; (setf (dictree--cell-data old)
+;; (,comma-f (dictree--cell-data new)
+;; (dictree--cell-data old)))))))
-(defmacro dictree--wrap-insfun-1 (f-1)
- ;; return body of `dictree--wrap-insfun'
- `(eval (backquote ,(macroexpand `(dictree--wrap-insfun-2 ,f-1)))))
+;; (defmacro dictree--wrap-insfun-1 (f-1)
+;; ;; return body of `dictree--wrap-insfun'
+;; `(eval (backquote ,(macroexpand-all `(dictree--wrap-insfun-2 ,f-1)))))
+
+;; (defun dictree--wrap-insfun (insfun) ; INTERNAL USE ONLY
+;; ;; return wrapped insfun to deal with data wrapping
+;; (byte-compile (dictree--wrap-insfun-1 insfun)))
+
+;; (eval-when-compile
+;; (let ((buff (get-buffer "*Compile-Log*")))
+;; (when buff
+;; (save-excursion
+;; (set-buffer buff)
+;; (setq buffer-read-only nil)
+;; (goto-char (point-max))
+;; (insert
+;; "\nThe above warning is true, though it's not obvious from the
+;; source code! Be that as it may, I can't fix this until someone
+;; explains to me how to define `dictree--wrap-insfun' without using
+;; old-style backquotes, whilst still ensuring that the `setf' in
+;; the `dictree--wrap-insfun-2' macro is expanded at compile-time
+;; rather than run-time.
+;; -- Toby Cubitt\n")
+;; (setq buffer-read-only t)))))
(defun dictree--wrap-insfun (insfun) ; INTERNAL USE ONLY
;; return wrapped insfun to deal with data wrapping
- (dictree--wrap-insfun-1 insfun))
-
-(eval-when-compile
- (let ((buff (get-buffer "*Compile-Log*")))
- (when buff
- (save-excursion
- (set-buffer buff)
- (setq buffer-read-only nil)
- (goto-char (point-max))
- (insert
- "\nThe above warning is true, though it's not obvious from the
-source code! Be that as it may, I can't fix this until someone
-explains to me how to define `dictree--wrap-insfun' without using
-old-style backquotes, whilst still ensuring that the `setf' in
-the `dictree--wrap-insfun-2' macro is expanded at compile-time
-rather than run-time.
- -- Toby Cubitt\n")
- (setq buffer-read-only t)))))
-
+ (byte-compile
+ `(lambda (new old)
+ ;; FIXME: should use (setf (dictree--cell-data old) ...) here, but can't
+ ;; figure out how to get that to be expanded at compile-time, to
+ ;; avoid run-time dependency on 'cl package!!?!??!!!??!?!!??!!!
+ ;; (The `dictree--cell-data' aren't expanded at compile-time
+ ;; either, for the same reason.)
+ (setcar old (,insfun (dictree--cell-data new)
+ (dictree--cell-data old)))
+ old)))
-;; (defun dictree--wrap-insfun (insfun) ; INTERNAL USE ONLY
-;; ;; return wrapped insfun to deal with data wrapping
-;; (byte-compile
-;; `(lambda (new old)
-;; ;; FIXME: should use (setf (dictree--cell-data old) ...) here, but
can't
-;; ;; figure out how to get that to be expanded at compile-time to
-;; ;; avoid run-time dependency on 'cl package!!?!??!!!
-;; (setcar old (,insfun (dictree--cell-data new)
-;; (dictree--cell-data old)))
-;; old)))
(defun dictree--wrap-rankfun (rankfun) ; INTERNAL USE ONLY
;; return wrapped rankfun to deal with data wrapping
- [elpa] externals/dict-tree 6d9921e 067/154: Updated docstrings for regexp-related functions and others., (continued)
- [elpa] externals/dict-tree 6d9921e 067/154: Updated docstrings for regexp-related functions and others., Stefan Monnier, 2020/12/14
- [elpa] externals/dict-tree d88b867 002/154: Version 0.10.3 of the predictive completion package., Stefan Monnier, 2020/12/14
- [elpa] externals/dict-tree 7b52ebd 005/154: Version 0.13.1 of the predictive completion package., Stefan Monnier, 2020/12/14
- [elpa] externals/dict-tree ac40f3c 004/154: Version 0.12.2 of the predictive completion package., Stefan Monnier, 2020/12/14
- [elpa] externals/dict-tree 2bca928 003/154: Version 0.12 of the predictive completion package., Stefan Monnier, 2020/12/14
- [elpa] externals/dict-tree 3ecd763 006/154: Added minor miscellaneous new features, mostly to predictive.el., Stefan Monnier, 2020/12/14
- [elpa] externals/dict-tree 26f5dd3 011/154: Work around byte-compilation and goto-line bugs., Stefan Monnier, 2020/12/14
- [elpa] externals/dict-tree 7562023 012/154: Make use of :family attribute of completion-tooltip-face., Stefan Monnier, 2020/12/14
- [elpa] externals/dict-tree f9bf379 013/154: Complete re-write of dict-tree.el, based on new trie.el., Stefan Monnier, 2020/12/14
- [elpa] externals/dict-tree 329110b 018/154: Fixed bug in unranked dictree-complete., Stefan Monnier, 2020/12/14
- [elpa] externals/dict-tree baa4931 028/154: Doesn't quite work - revert to breaking setf abstraction,
Stefan Monnier <=
- [elpa] externals/dict-tree 5834dac 036/154: Replaced bare avl-trees, Stefan Monnier, 2020/12/14
- [elpa] externals/dict-tree 673fd2a 029/154: Abstract away the setcar used to set the data component of a cell, Stefan Monnier, 2020/12/14
- [elpa] externals/dict-tree 2700e21 035/154: Don't compile wrapped functions explicitly, Stefan Monnier, 2020/12/14
- [elpa] externals/dict-tree 70f99ee 037/154: Make certain dictionary commands (mostly saving and loading) interactive again., Stefan Monnier, 2020/12/14
- [elpa] externals/dict-tree 35346a4 041/154: Bug-fix in dictree--write-dict-code, Stefan Monnier, 2020/12/14
- [elpa] externals/dict-tree 608fcd4 049/154: Bug-fix to dictree--write-dict-code, Stefan Monnier, 2020/12/14
- [elpa] externals/dict-tree 179c0b5 045/154: Bug-fix to messages displayed by dictree-populate-from-file, Stefan Monnier, 2020/12/14
- [elpa] externals/dict-tree 6b24547 052/154: Allow "]" to be included in a negated character alternatives, by placing immediately after the "[^"., Stefan Monnier, 2020/12/14
- [elpa] externals/dict-tree a61f90e 053/154: Bug-fix in dictree-wildcard-search, Stefan Monnier, 2020/12/14
- [elpa] externals/dict-tree b33203a 060/154: Manage loading and unloading of dictionaries automatically in predictive-mode, Stefan Monnier, 2020/12/14