[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/relint 125b869 02/44: Try harder recovering from read e
From: |
Mattias Engdegård |
Subject: |
[elpa] externals/relint 125b869 02/44: Try harder recovering from read errors |
Date: |
Tue, 26 Mar 2019 12:57:24 -0400 (EDT) |
branch: externals/relint
commit 125b8693d6c986be888b01c7757c675d5ebbd064
Author: Mattias Engdegård <address@hidden>
Commit: Mattias Engdegård <address@hidden>
Try harder recovering from read errors
In particular, don't abandon the whole file because of a circular sexp.
---
trawl.el | 28 ++++++++++++++++++++++------
1 file changed, 22 insertions(+), 6 deletions(-)
diff --git a/trawl.el b/trawl.el
index 2882df8..ce26dfb 100644
--- a/trawl.el
+++ b/trawl.el
@@ -333,16 +333,32 @@
(insert-file-contents file)
(goto-char (point-min))
(let ((pos nil)
+ (keep-going t)
(read-circle nil)
(trawl--variables nil)
(trawl--checked-variables nil))
- (condition-case err
- (while t
+ (while keep-going
(setq pos (point))
- (let ((form (read (current-buffer))))
- (trawl--check-toplevel-form form file pos)))
- (end-of-file nil)
- (error (trawl--report file pos nil (prin1-to-string err))))))
+ (let ((form nil))
+ (condition-case err
+ (setq form (read (current-buffer)))
+ (end-of-file
+ (setq keep-going nil))
+ (invalid-read-syntax
+ (cond
+ ((equal (cadr err) "#")
+ (goto-char pos)
+ (forward-sexp 1))
+ (t
+ (trawl--report file (point) nil
+ (prin1-to-string err))
+ (setq keep-going nil))))
+ (error
+ (trawl--report file (point) nil
+ (prin1-to-string err))
+ (setq keep-going nil)))
+ (when form
+ (trawl--check-toplevel-form form file pos))))))
(when (> trawl--error-count errors-before)
(trawl--show-errors))))
- [elpa] externals/relint d6320f9 14/44: Detect functions with regexp arguments, (continued)
- [elpa] externals/relint d6320f9 14/44: Detect functions with regexp arguments, Mattias Engdegård, 2019/03/26
- [elpa] externals/relint d19133e 09/44: Better variable name patterns, Mattias Engdegård, 2019/03/26
- [elpa] externals/relint d4d8f97 11/44: Eval mapcar and mapcan with partial-evaluated lists, Mattias Engdegård, 2019/03/26
- [elpa] externals/relint 34304b4 08/44: Add (provides) line to make file importable, Mattias Engdegård, 2019/03/26
- [elpa] externals/relint 62ca3d4 05/44: Slight performance improvement, Mattias Engdegård, 2019/03/26
- [elpa] externals/relint 6ab713e 07/44: Reinstate erroneously removed line, Mattias Engdegård, 2019/03/26
- [elpa] externals/relint cb1fdc5 06/44: Add caret pointing out the error in the quoted regexp, Mattias Engdegård, 2019/03/26
- [elpa] externals/relint b4fc385 04/44: Rename trawl--batch to trawl-batch, Mattias Engdegård, 2019/03/26
- [elpa] externals/relint 0214845 01/44: Move to github, Mattias Engdegård, 2019/03/26
- [elpa] externals/relint 830f4bf 03/44: Allow use from batch mode, Mattias Engdegård, 2019/03/26
- [elpa] externals/relint 125b869 02/44: Try harder recovering from read errors,
Mattias Engdegård <=