[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/relint 187d586 27/44: Scan arguments to `skip-chars-{fo
From: |
Mattias Engdegård |
Subject: |
[elpa] externals/relint 187d586 27/44: Scan arguments to `skip-chars-{forward, backward}' |
Date: |
Tue, 26 Mar 2019 12:57:28 -0400 (EDT) |
branch: externals/relint
commit 187d586847f4545e6ba276098ca37d294ca6109f
Author: Mattias Engdegård <address@hidden>
Commit: Mattias Engdegård <address@hidden>
Scan arguments to `skip-chars-{forward,backward}'
Make use of the new skip set parser in xr.
---
trawl.el | 30 ++++++++++++++++++++++++++----
1 file changed, 26 insertions(+), 4 deletions(-)
diff --git a/trawl.el b/trawl.el
index 254fdbf..613e800 100644
--- a/trawl.el
+++ b/trawl.el
@@ -2,7 +2,7 @@
;; Author: Mattias Engdegård <address@hidden>
;; Version: 1.2
-;; Package-Requires: ((xr "1.4"))
+;; Package-Requires: ((xr "1.7"))
;; Keywords: lisp, maint, regexps
;; This program is free software; you can redistribute it and/or modify
@@ -124,15 +124,31 @@
2))) ; Lop off quotes
(concat (make-string quoted-pos ?.) "^")))
+(defun trawl--check-skip-set (skip-set-string name file pos path)
+ (let ((complaints
+ (condition-case err
+ (mapcar (lambda (warning)
+ (let ((ofs (car warning)))
+ (format "In %s: %s (pos %d)\n %s\n %s"
+ name (cdr warning) ofs
+ (trawl--quote-string skip-set-string)
+ (trawl--caret-string skip-set-string ofs))))
+ (xr-skip-set-lint skip-set-string))
+ (error (list (format "In %s: Error: %s: %s"
+ name (cadr err)
+ (trawl--quote-string skip-set-string)))))))
+ (mapc (lambda (msg) (trawl--report file pos path msg))
+ complaints)))
+
(defun trawl--check-re-string (re name file pos path)
(let ((complaints
(condition-case err
(mapcar (lambda (warning)
- (let ((pos (car warning)))
+ (let ((ofs (car warning)))
(format "In %s: %s (pos %d)\n %s\n %s"
- name (cdr warning) pos
+ name (cdr warning) ofs
(trawl--quote-string re)
- (trawl--caret-string re pos))))
+ (trawl--caret-string re ofs))))
(xr-lint re))
(error (list (format "In %s: Error: %s: %s"
name (cadr err)
@@ -649,6 +665,12 @@
(memq trim trawl--checked-variables))
(trawl--check-re trim (format "call to %s" (car form))
file pos (cons 4 path))))))
+ (`(,(or `skip-chars-forward `skip-chars-backward)
+ ,skip-arg . ,_)
+ (let ((str (trawl--get-string skip-arg file pos path)))
+ (when str
+ (trawl--check-skip-set str (format "call to %s" (car form))
+ file pos (cons 1 path)))))
(`(,(or `defvar `defconst `defcustom)
,name ,re-arg . ,rest)
(when (symbolp name)
- [elpa] externals/relint 0f76132 40/44: Add README.org, (continued)
- [elpa] externals/relint 0f76132 40/44: Add README.org, Mattias Engdegård, 2019/03/26
- [elpa] externals/relint e824db0 38/44: Expand locally defined macros, Mattias Engdegård, 2019/03/26
- [elpa] externals/relint c215d54 34/44: More careful evaluation of if, when, unless, and, or, Mattias Engdegård, 2019/03/26
- [elpa] externals/relint 15c799e 35/44: Evaluate calls to functions defined in the same file., Mattias Engdegård, 2019/03/26
- [elpa] externals/relint 2d1f488 32/44: mapcar on non-list sequence, Mattias Engdegård, 2019/03/26
- [elpa] externals/relint af745bb 30/44: Update the package description. Increment version to 1.4, Mattias Engdegård, 2019/03/26
- [elpa] externals/relint e1b1ef9 22/44: Run in two phases on each file, Mattias Engdegård, 2019/03/26
- [elpa] externals/relint 7a1b632 33/44: Add wildcard-to-regexp as 'pure' function, Mattias Engdegård, 2019/03/26
- [elpa] externals/relint f6fb8e6 31/44: Sundry cosmetic fixes, Mattias Engdegård, 2019/03/26
- [elpa] externals/relint 151dbb8 23/44: Handle some destructive list functions, Mattias Engdegård, 2019/03/26
- [elpa] externals/relint 187d586 27/44: Scan arguments to `skip-chars-{forward, backward}',
Mattias Engdegård <=
- [elpa] externals/relint 5af5466 26/44: Scan string-trim arguments, Mattias Engdegård, 2019/03/26
- [elpa] externals/relint 4dbcad9 24/44: Increment version to 1.2, Mattias Engdegård, 2019/03/26
- [elpa] externals/relint 104e66c 15/44: Fix bugs in evaluation of `rx' and `rx-to-strings', Mattias Engdegård, 2019/03/26
- [elpa] externals/relint 3f8509a 13/44: Add more functions to check for regexp arguments, Mattias Engdegård, 2019/03/26
- [elpa] externals/relint f8878ca 16/44: Report rx errors in the result buffer, Mattias Engdegård, 2019/03/26
- [elpa] externals/relint 8e37762 18/44: Protect against improper lists in function calls, Mattias Engdegård, 2019/03/26
- [elpa] externals/relint 66522ca 12/44: Increment version to 1.1, Mattias Engdegård, 2019/03/26
- [elpa] externals/relint 683f31b 28/44: Increment version to 1.3, Mattias Engdegård, 2019/03/26
- [elpa] externals/relint ac5d0cf 25/44: Add more safe functions, Mattias Engdegård, 2019/03/26
- [elpa] externals/relint 02bf0ba 21/44: Use explicit list of pure functions, Mattias Engdegård, 2019/03/26