diff options
author | Taylor R Campbell <campbell@mumble.net> | 2011-03-20 19:20:38 +0000 |
---|---|---|
committer | Taylor R Campbell <campbell@mumble.net> | 2011-03-20 19:20:38 +0000 |
commit | 9faf474ddc220d2341e37171ae8373d3721a41e4 (patch) | |
tree | 3387f587f205622689870fcb6c059e068ae130ec | |
parent | bd0e5ba35e819d2019a592b608ff4a036038a953 (diff) |
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
-rw-r--r-- | paredit.el | 13 |
1 files changed, 5 insertions, 8 deletions
@@ -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)) |