emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/macrostep 2519692 038/110: Restore narrowing


From: ELPA Syncer
Subject: [nongnu] elpa/macrostep 2519692 038/110: Restore narrowing
Date: Sat, 7 Aug 2021 09:17:58 -0400 (EDT)

branch: elpa/macrostep
commit 251969224e030387d240a2220a6e19ca0fc1e276
Author: Chunyang Xu <xuchunyang56@gmail.com>
Commit: Chunyang Xu <xuchunyang56@gmail.com>

    Restore narrowing
---
 macrostep.el | 23 ++++++++++++-----------
 1 file changed, 12 insertions(+), 11 deletions(-)

diff --git a/macrostep.el b/macrostep.el
index 2abe1e5..f0e5b92 100644
--- a/macrostep.el
+++ b/macrostep.el
@@ -636,17 +636,18 @@ inserted using `macrostep-print-sexp' and pretty-printed 
using
        (delete-region start end)))
        
     (unless original                   ; inserting macro expansion
-      ;; point is now before the expanded form; pretty-print it
-      (narrow-to-region (point) (scan-sexps (point) 1))
-      (save-excursion
-       (pp-buffer)
-       ;; remove the extra newline that pp-buffer inserts
-       (goto-char (point-max))
-       (delete-region
-        (point)
-        (save-excursion (skip-chars-backward " \t\n") (point))))
-      (widen)
-      (indent-sexp))))
+      (save-restriction
+        ;; point is now before the expanded form; pretty-print it
+        (narrow-to-region (point) (scan-sexps (point) 1))
+        (save-excursion
+          (pp-buffer)
+          ;; remove the extra newline that pp-buffer inserts
+          (goto-char (point-max))
+          (delete-region
+           (point)
+           (save-excursion (skip-chars-backward " \t\n") (point))))
+        (widen)
+        (indent-sexp)))))
 
 (defun macrostep-get-gensym-face (symbol)
   "Return the face to use in fontifying SYMBOL in printed macro expansions.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]