branch: elpa/paredit
commit 9faf474ddc220d2341e37171ae8373d3721a41e4
Author: Taylor R Campbell <[email protected]>
Commit: Taylor R Campbell <[email protected]>
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))