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

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

[nongnu] elpa/paredit 9faf474 073/224: Use `scan-sexps' for noninteracti


From: ELPA Syncer
Subject: [nongnu] elpa/paredit 9faf474 073/224: Use `scan-sexps' for noninteractive `check-parens'.
Date: Sat, 7 Aug 2021 09:22:22 -0400 (EDT)

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

    Use `scan-sexps' for noninteractive `check-parens'.
    
    Ignore-this: 5116ca507a480c4bb4cfe95b9ab34820
    
    This enables the use of the safer `paredit-handle-sexp-errors'
    instead of `condition-case' for these purposes.
    
    darcs-hash:20110320192038-00fcc-e4799c56417a15787ca03f8b06962718412bbe88
---
 paredit.el | 13 +++++--------
 1 file changed, 5 insertions(+), 8 deletions(-)

diff --git a/paredit.el b/paredit.el
index 33dff5e..a05ed06 100644
--- a/paredit.el
+++ b/paredit.el
@@ -2079,8 +2079,10 @@ With a prefix argument N, move up N lists before 
wrapping."
                 (search-forward "\\" nil t))
       (delete-char -1)
       (forward-char))
-    (funcall (condition-case condition (progn (check-parens) 'buffer-string)
-               (error (lambda () nil))))))
+    (paredit-handle-sexp-errors
+        (progn (scan-sexps (point-min) (point-max))
+               (buffer-string))
+      nil)))
 
 ;;;; Slurpage & Barfage
 
@@ -2477,12 +2479,7 @@ If no parse state is supplied, compute one from the 
beginning of the
       (progn
         (save-restriction
           (narrow-to-region start end)
-          ;; Can't use `check-parens' here -- it signals the wrong kind
-          ;; of errors.
-          (save-excursion
-            (goto-char (point-min))
-            (while (not (eobp))
-              (forward-sexp))))
+          (scan-sexps (point-min) (point-max)))
         t)
     nil))
 



reply via email to

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