[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/macrostep 8f74a4b 084/110: Toggle separate-buffer expansio
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/macrostep 8f74a4b 084/110: Toggle separate-buffer expansion with prefix (#8) |
Date: |
Sat, 7 Aug 2021 09:18:07 -0400 (EDT) |
branch: elpa/macrostep
commit 8f74a4be262820cc8efe120947f35feec8a0c94c
Author: joddie <jonxfield@gmail.com>
Commit: joddie <jonxfield@gmail.com>
Toggle separate-buffer expansion with prefix (#8)
---
macrostep.el | 40 ++++++++++++++++++++++++----------------
1 file changed, 24 insertions(+), 16 deletions(-)
diff --git a/macrostep.el b/macrostep.el
index 43c6e35..b4954a2 100644
--- a/macrostep.el
+++ b/macrostep.el
@@ -374,14 +374,19 @@ quit and return to normal editing.
;;; Interactive functions
;;;###autoload
-(defun macrostep-expand ()
+(defun macrostep-expand (toggle-separate-buffer)
"Expand the Elisp macro form following point by one step.
Enters `macrostep-mode' if it is not already active, making the
buffer temporarily read-only. If macrostep-mode is active and the
form following point is not a macro form, search forward in the
-buffer and expand the next macro form found, if any."
- (interactive)
+buffer and expand the next macro form found, if any.
+
+With a prefix argument, the expansion is displayed in a separate
+buffer instead of inline in the current buffer. Setting
+`macrostep-expand-in-separate-buffer' to non-nil swaps these two
+behaviors."
+ (interactive "P")
(let ((sexp (macrostep-sexp-at-point))
(macrostep-environment (macrostep-environment-at-point)))
(when (not (macrostep-macro-form-p sexp))
@@ -396,19 +401,22 @@ buffer and expand the next macro form found, if any."
;; Create a dedicated macro-expansion buffer and copy the text to
;; be expanded into it, if required
- (when (and macrostep-expand-in-separate-buffer
- (not macrostep-expansion-buffer))
- (let ((buffer
- (get-buffer-create (generate-new-buffer-name "*macro
expansion*"))))
- (set-buffer buffer)
- (emacs-lisp-mode)
- (setq macrostep-expansion-buffer t)
- (setq macrostep-outer-environment macrostep-environment)
- (save-excursion
- (let ((print-level nil)
- (print-length nil))
- (print sexp (current-buffer))))
- (pop-to-buffer buffer)))
+ (let ((separate-buffer-p
+ (if toggle-separate-buffer
+ (not macrostep-expand-in-separate-buffer)
+ macrostep-expand-in-separate-buffer)))
+ (when (and separate-buffer-p (not macrostep-expansion-buffer))
+ (let ((buffer
+ (get-buffer-create (generate-new-buffer-name "*macro
expansion*"))))
+ (set-buffer buffer)
+ (emacs-lisp-mode)
+ (setq macrostep-expansion-buffer t)
+ (setq macrostep-outer-environment macrostep-environment)
+ (save-excursion
+ (let ((print-level nil)
+ (print-length nil))
+ (print sexp (current-buffer))))
+ (pop-to-buffer buffer))))
(let* ((inhibit-read-only t)
(expansion (macrostep-expand-1 sexp))
- [nongnu] elpa/macrostep 4b0d96f 013/110: Remove incorrect use of :version in defgroup, (continued)
- [nongnu] elpa/macrostep 4b0d96f 013/110: Remove incorrect use of :version in defgroup, ELPA Syncer, 2021/08/07
- [nongnu] elpa/macrostep 0bcb143 019/110: Handle backquotes better, ELPA Syncer, 2021/08/07
- [nongnu] elpa/macrostep 1c01145 039/110: Merge pull request #9 from xuchunyang/master, ELPA Syncer, 2021/08/07
- [nongnu] elpa/macrostep c20152b 011/110: Handle aliases by using `indirect-function' instead of `symbol-function', ELPA Syncer, 2021/08/07
- [nongnu] elpa/macrostep 99ac330 029/110: Make inner macrolet definitions correctly shadow outer, ELPA Syncer, 2021/08/07
- [nongnu] elpa/macrostep 0c8b64c 051/110: Position macrostep-slime-macro-form-p in the correct package, ELPA Syncer, 2021/08/07
- [nongnu] elpa/macrostep f34deb7 055/110: Specify text bounds when propertizing SLIME macros, ELPA Syncer, 2021/08/07
- [nongnu] elpa/macrostep b449cd0 059/110: Restore compiler-macro expansion under SLIME, ELPA Syncer, 2021/08/07
- [nongnu] elpa/macrostep 5e0c28f 068/110: Establish *macroexpand-printer-bindings* before pretty printing, ELPA Syncer, 2021/08/07
- [nongnu] elpa/macrostep 80ae101 083/110: Fix SLIME functions for updated generic interface, ELPA Syncer, 2021/08/07
- [nongnu] elpa/macrostep 8f74a4b 084/110: Toggle separate-buffer expansion with prefix (#8),
ELPA Syncer <=
- [nongnu] elpa/macrostep c594c09 092/110: `cl-macs' is no longer needed at run-time, ELPA Syncer, 2021/08/07
- [nongnu] elpa/macrostep 94d40f2 093/110: Check that compiler-macros return a changed form, ELPA Syncer, 2021/08/07
- [nongnu] elpa/macrostep d6aa67c 097/110: Be consistent about only using prefixed `cl-lib`, ELPA Syncer, 2021/08/07
- [nongnu] elpa/macrostep 1e25932 105/110: add lib/.nosearch, ELPA Syncer, 2021/08/07