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

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

[nongnu] elpa/paredit c91bc2f 099/224: Fix bug in change to check struct


From: ELPA Syncer
Subject: [nongnu] elpa/paredit c91bc2f 099/224: Fix bug in change to check structure in backward-delete of comment end.
Date: Sat, 7 Aug 2021 09:22:27 -0400 (EDT)

branch: elpa/paredit
commit c91bc2f64caf3a1b9862db6f854a1620452a7f5c
Author: Taylor R Campbell <campbell@mumble.net>
Commit: Taylor R Campbell <campbell@mumble.net>

    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(-)

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



reply via email to

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