branch: elpa/macrostep
commit 1c01145054a0cc984a596573dbf650bc7383a4b8
Merge: 8950313 2519692
Author: Jonathan Oddie <[email protected]>
Commit: Jonathan Oddie <[email protected]>
Merge pull request #9 from xuchunyang/master
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.