summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTaylor R Campbell <campbell@mumble.net>2011-03-23 03:49:16 +0000
committerTaylor R Campbell <campbell@mumble.net>2011-03-23 03:49:16 +0000
commitc91bc2f64caf3a1b9862db6f854a1620452a7f5c (patch)
treeb9cee0c170fcf2700244df1d5a903b0fbdd80c6b
parent8a85899de6168de009ab9536717d8481c65aa681 (diff)
Fix bug in change to check structure in backward-delete of comment end.
Ignore-this: a404afd4e847db4ef89b17de42d431e4 It was copied & pasted from `paredit-forward-delete-in-comment' incautiously and lacked a necessary `save-excursion'. darcs-hash:20110323034916-00fcc-55ea95fc6be8f4b57fbadfd2c8cc04942dbd2b1e
-rw-r--r--paredit.el12
1 files changed, 7 insertions, 5 deletions
diff --git a/paredit.el b/paredit.el
index b851a67..76e16bb 100644
--- a/paredit.el
+++ b/paredit.el
@@ -1374,11 +1374,13 @@ With a `C-u' prefix argument, simply delete a character backward,
(defun paredit-backward-delete-maybe-comment-end ()
;; Refuse to delete a comment end if moving the line into the comment
;; would break structure.
- (let ((line-start-state (paredit-current-parse-state)))
- (if (not (comment-search-forward (point-at-eol) t))
- (goto-char (point-at-eol)))
- (let ((line-end-state (paredit-current-parse-state)))
- (paredit-check-region-state line-start-state line-end-state)))
+ (let* ((line-start-state (paredit-current-parse-state))
+ (line-end-state
+ (save-excursion
+ (if (not (comment-search-forward (point-at-eol) t))
+ (goto-char (point-at-eol)))
+ (paredit-current-parse-state))))
+ (paredit-check-region-state line-start-state line-end-state))
(backward-delete-char 1))
;;;; Killing