[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/macrostep 352b6d2 042/110: Minor improvements to SLIME pro
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/macrostep 352b6d2 042/110: Minor improvements to SLIME prototype |
Date: |
Sat, 7 Aug 2021 09:17:59 -0400 (EDT) |
branch: elpa/macrostep
commit 352b6d214c4a3af6a834db042e9fabce04f5d7cb
Author: joddie <jonxfield@gmail.com>
Commit: joddie <jonxfield@gmail.com>
Minor improvements to SLIME prototype
- Implement `macrostep-slime-macro-form-p'
- Make `macrostep-slime-expand-1' a defun
---
macrostep.el | 17 ++++++++++++-----
1 file changed, 12 insertions(+), 5 deletions(-)
diff --git a/macrostep.el b/macrostep.el
index cd9eda2..b83fedb 100644
--- a/macrostep.el
+++ b/macrostep.el
@@ -866,22 +866,29 @@ expansion will not be fontified. See also
(setq macrostep-sexp-at-point-function #'slime-sexp-at-point)
(setq macrostep-environment-at-point-function ; FIXME?
(lambda () nil))
- (setq macrostep-expand-1-function
- (lambda (sexp)
- (slime-eval `(swank:swank-macroexpand-1 ,sexp))))
+ (setq macrostep-expand-1-function #'macrostep-slime-expand-1)
(setq macrostep-print-function #'macrostep-slime-insert)
- (setq macrostep-macro-form-p-function ; FIXME?
- (lambda (form) t)))
+ (setq macrostep-macro-form-p-function #'macrostep-slime-macro-form-p))
;;;###autoload
(add-hook 'slime-mode-hook #'macrostep-slime-mode-hook)
+(defun macrostep-slime-expand-1 (sexp)
+ (slime-eval `(swank:swank-macroexpand-1 ,sexp)))
+
(defun macrostep-slime-insert (expansion)
"Insert EXPANSION at point, indenting to match the current column."
(let* ((indent-string (concat "\n" (make-string (current-column) ? )))
(expansion (replace-regexp-in-string "\n" indent-string expansion)))
(insert expansion)))
+(defun macrostep-slime-macro-form-p (form)
+ (slime-eval
+ `(cl:let ((sexp (cl:read-from-string ,form)))
+ (cl:and (cl:consp sexp)
+ (cl:macro-function (cl:car sexp))
+ t))))
+
(provide 'macrostep)
- [nongnu] branch elpa/macrostep created (now 424e373), ELPA Syncer, 2021/08/07
- [nongnu] elpa/macrostep d847fb2 001/110: Initial upload to github, ELPA Syncer, 2021/08/07
- [nongnu] elpa/macrostep 0067091 018/110: fix youtube link in docs, ELPA Syncer, 2021/08/07
- [nongnu] elpa/macrostep ee46132 008/110: Print dotted lists in expansions correctly, ELPA Syncer, 2021/08/07
- [nongnu] elpa/macrostep 99d2cc7 020/110: Don't fontify a quoted macro since this won't get expanded normally, ELPA Syncer, 2021/08/07
- [nongnu] elpa/macrostep f8f0424 027/110: Fix header dates, ELPA Syncer, 2021/08/07
- [nongnu] elpa/macrostep 9a534df 052/110: Make macrostep-slime-insert more robust, ELPA Syncer, 2021/08/07
- [nongnu] elpa/macrostep 352b6d2 042/110: Minor improvements to SLIME prototype,
ELPA Syncer <=
- [nongnu] elpa/macrostep 3062d4c 046/110: Add support for compiler macros, ELPA Syncer, 2021/08/07
- [nongnu] elpa/macrostep 874c790 058/110: WIP: smarter SLIME macroexpansion, ELPA Syncer, 2021/08/07
- [nongnu] elpa/macrostep d7991b4 070/110: Track forms using the printer rather than the reader, ELPA Syncer, 2021/08/07
- [nongnu] elpa/macrostep dd14d5c 077/110: Remove unused function `bindings-to-environment`, ELPA Syncer, 2021/08/07
- [nongnu] elpa/macrostep b1c1230 079/110: More tests, ELPA Syncer, 2021/08/07
- [nongnu] elpa/macrostep 4b382cd 088/110: Identify Elisp compiler-macros more selectively, ELPA Syncer, 2021/08/07
- [nongnu] elpa/macrostep a3338d3 104/110: Make test script exit non-zero on failure, ELPA Syncer, 2021/08/07
- [nongnu] elpa/macrostep e537612 106/110: compmiler-macro changed to compiler-macro, ELPA Syncer, 2021/08/07
- [nongnu] elpa/macrostep a5b980e 035/110: Update readme, ELPA Syncer, 2021/08/07
- [nongnu] elpa/macrostep fbd61eb 030/110: Tests for macrolet/cl-macrolet support, ELPA Syncer, 2021/08/07