From c91bc2f64caf3a1b9862db6f854a1620452a7f5c Mon Sep 17 00:00:00 2001 From: Taylor R Campbell Date: Wed, 23 Mar 2011 03:49:16 +0000 Subject: 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 --- paredit.el | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'paredit.el') 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 -- cgit v1.2.1