Commit cae6554
committed
Adjust lispy--function-parse to a new object representation.
* lispy.el (lispy--function-parse): Update function to a newer object
representation. Fix `lispy-flatten'.
In Emacs 30, it began to use dedicated type to represent
interpreted-function values, `read' function now returns Closure
Function Type instead of simple lists for most types that
`lispy--function-parse' tries to handle (except macros, at least).
See:
- https://git.sv.gnu.org/cgit/emacs.git/commit/?id=f2bccae22bd47a2e7e0937b78ea06131711b935a
- (elisp) Closure Type
- (elisp) Closure Objects
Compare
(defmacro test-macro (&rest body)
,@Body)
(symbol-function 'test-macro)
;; (macro . #[(&rest body) ((\,@ body)) (t)])
with
(defun test-defun (x)
(+ x 1))
(symbol-function 'test-defun)
;; #[(x) ((+ x 1)) (t)]
There's alternative way to mitigate it, by changing
end of `lispy--function-str' to:
(error
(let ((str (cl-prin1-to-string (symbol-function fun))))
(if (string-prefix-p "#f" str)
(substring str 2)
str)))
But it hides the underlying change that needs to be addresed in the
future.
Partially fixes `lispy-let-flatten' as well, but keywords (&optional,
&rest) in function's signature are not recognized correctly.1 parent c2acc4b commit cae6554
1 file changed
+41
-35
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7640 | 7640 | | |
7641 | 7641 | | |
7642 | 7642 | | |
7643 | | - | |
7644 | | - | |
7645 | | - | |
7646 | | - | |
7647 | | - | |
7648 | | - | |
7649 | | - | |
7650 | | - | |
7651 | | - | |
7652 | | - | |
7653 | | - | |
7654 | | - | |
7655 | | - | |
7656 | | - | |
7657 | | - | |
7658 | | - | |
7659 | | - | |
7660 | | - | |
7661 | | - | |
7662 | | - | |
7663 | | - | |
| 7643 | + | |
| 7644 | + | |
| 7645 | + | |
| 7646 | + | |
| 7647 | + | |
| 7648 | + | |
| 7649 | + | |
| 7650 | + | |
| 7651 | + | |
| 7652 | + | |
| 7653 | + | |
| 7654 | + | |
| 7655 | + | |
| 7656 | + | |
| 7657 | + | |
| 7658 | + | |
| 7659 | + | |
| 7660 | + | |
| 7661 | + | |
| 7662 | + | |
| 7663 | + | |
| 7664 | + | |
| 7665 | + | |
| 7666 | + | |
| 7667 | + | |
| 7668 | + | |
| 7669 | + | |
| 7670 | + | |
| 7671 | + | |
| 7672 | + | |
| 7673 | + | |
| 7674 | + | |
| 7675 | + | |
| 7676 | + | |
| 7677 | + | |
| 7678 | + | |
| 7679 | + | |
7664 | 7680 | | |
7665 | | - | |
7666 | | - | |
7667 | | - | |
7668 | | - | |
7669 | | - | |
7670 | | - | |
7671 | | - | |
7672 | | - | |
7673 | | - | |
7674 | | - | |
7675 | | - | |
7676 | | - | |
7677 | | - | |
7678 | | - | |
| 7681 | + | |
| 7682 | + | |
| 7683 | + | |
| 7684 | + | |
7679 | 7685 | | |
7680 | 7686 | | |
7681 | 7687 | | |
| |||
0 commit comments