[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/macrostep 31a23eb 085/110: Toggle separate-buffer expansio
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/macrostep 31a23eb 085/110: Toggle separate-buffer expansion with prefix (#8) |
Date: |
Sat, 7 Aug 2021 09:18:08 -0400 (EDT) |
branch: elpa/macrostep
commit 31a23ebd0d85a9746e7bf35b1ca4c37764092767
Author: joddie <jonxfield@gmail.com>
Commit: joddie <jonxfield@gmail.com>
Toggle separate-buffer expansion with prefix (#8)
---
macrostep.el | 42 +++++++++++++++++++++++++-----------------
1 file changed, 25 insertions(+), 17 deletions(-)
diff --git a/macrostep.el b/macrostep.el
index 8536a07..779e4a5 100644
--- a/macrostep.el
+++ b/macrostep.el
@@ -462,14 +462,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")
(cl-destructuring-bind (start . end)
(funcall macrostep-sexp-bounds-function)
(goto-char start)
@@ -481,20 +486,23 @@ 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 ((mode major-mode)
- (buffer
- (get-buffer-create (generate-new-buffer-name "*macro
expansion*"))))
- (set-buffer buffer)
- (funcall mode)
- (setq macrostep-expansion-buffer t)
- (setq macrostep-outer-environment env)
- (save-excursion
- (setq start (point))
- (insert text)
- (setq end (point-marker)))
- (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 ((mode major-mode)
+ (buffer
+ (get-buffer-create (generate-new-buffer-name "*macro
expansion*"))))
+ (set-buffer buffer)
+ (funcall mode)
+ (setq macrostep-expansion-buffer t)
+ (setq macrostep-outer-environment env)
+ (save-excursion
+ (setq start (point))
+ (insert text)
+ (setq end (point-marker)))
+ (pop-to-buffer buffer))))
(unless macrostep-mode (macrostep-mode t))
(let ((existing-overlay (macrostep-overlay-at-point))
- [nongnu] elpa/macrostep 39e809a 064/110: swank-macrostep: call PROVIDE at the end, (continued)
- [nongnu] elpa/macrostep 39e809a 064/110: swank-macrostep: call PROVIDE at the end, ELPA Syncer, 2021/08/07
- [nongnu] elpa/macrostep 1be6c4d 061/110: Extract Elisp macro environments accurately, ELPA Syncer, 2021/08/07
- [nongnu] elpa/macrostep d9c7629 063/110: Improvements to Elisp environment handling, ELPA Syncer, 2021/08/07
- [nongnu] elpa/macrostep 59972eb 071/110: Fix handling of subforms contained within other subforms, ELPA Syncer, 2021/08/07
- [nongnu] elpa/macrostep a0ae61c 073/110: Properly handle forms not present in the expansion, ELPA Syncer, 2021/08/07
- [nongnu] elpa/macrostep 817322b 074/110: Properly place the macrostep[-compiler]-macro-face, ELPA Syncer, 2021/08/07
- [nongnu] elpa/macrostep aa40d97 076/110: Test expansion within Elisp macro-defining macros, ELPA Syncer, 2021/08/07
- [nongnu] elpa/macrostep 1edee85 080/110: Reorganise and comment, ELPA Syncer, 2021/08/07
- [nongnu] elpa/macrostep bbfb033 081/110: Reorganise and document generic interface, ELPA Syncer, 2021/08/07
- [nongnu] elpa/macrostep 2bdc946 082/110: Remove dynamic binding of `macrostep-environment'., ELPA Syncer, 2021/08/07
- [nongnu] elpa/macrostep 31a23eb 085/110: Toggle separate-buffer expansion with prefix (#8),
ELPA Syncer <=
- [nongnu] elpa/macrostep 47cbacb 087/110: Define `macrostep-propertize` before using it, ELPA Syncer, 2021/08/07
- [nongnu] elpa/macrostep a8e730e 089/110: Improve Makefile, ELPA Syncer, 2021/08/07
- [nongnu] elpa/macrostep 2473a6f 094/110: Pass START and END args to sexp-at-point-function, ELPA Syncer, 2021/08/07
- [nongnu] elpa/macrostep 03d4d7b 096/110: Add basic C macro expansion via cmacexp.el, ELPA Syncer, 2021/08/07
- [nongnu] elpa/macrostep 9a6b04a 100/110: Restore Emacs 23 compatibility, ELPA Syncer, 2021/08/07
- [nongnu] elpa/macrostep d48e52b 101/110: Add tests for compiler-macro expansion, ELPA Syncer, 2021/08/07
- [nongnu] elpa/macrostep aa59895 103/110: Add .travis.yml, ELPA Syncer, 2021/08/07
- [nongnu] elpa/macrostep 7b2c1f3 108/110: Load all autoloaded macros, ELPA Syncer, 2021/08/07
- [nongnu] elpa/macrostep 4d75baf 003/110: Bump version number, ELPA Syncer, 2021/08/07
- [nongnu] elpa/macrostep 8a85acc 022/110: Refactor backquote handling and text properties., ELPA Syncer, 2021/08/07