branch: elpa/flymake-collection
commit 845c52a1aead7485450c62b48a92096160d99a25
Author: Mohsin Kaleem <[email protected]>
Commit: Mohsin Kaleem <[email protected]>
Revert "define: Reorient save-match-data and save-excursion"
This reverts commit 3e1f44739d207d9ca8e59376c582836321dbfcf1.
This causes Emacs to freeze for some reason, see #25.
---
src/flymake-collection-define.el | 95 ++++++++++++++++++++--------------------
1 file changed, 47 insertions(+), 48 deletions(-)
diff --git a/src/flymake-collection-define.el b/src/flymake-collection-define.el
index 6f621e6aa0..b096e9a117 100644
--- a/src/flymake-collection-define.el
+++ b/src/flymake-collection-define.el
@@ -400,54 +400,53 @@ For an example of this macro in action, see
`flymake-collection-pycodestyle'."
;; until there actually aren't any more to match.
`(let (res ; file-name
line column message id end-line end-column severity-ix)
- (save-match-data
- (save-excursion
- (while (and (not res)
- (search-forward-regexp ,combined-regex nil t))
- (setq
- res
- (progn
- (setq ; file-name (match-string 1)
- line (match-string 2)
- column (match-string 3)
- message (match-string 4)
- id (match-string 5)
- end-line (match-string 6)
- end-column (match-string 7)
- severity-ix (- (seq-find #'match-string
- (number-sequence ,(1+ group-count)
- ,(+ group-count
(length regexps))))
- ,(1+ group-count)))
- (cond
- ;; Log an error when any of the required fields are missing.
- ,@(cl-loop for it in '(severity-ix line message)
- collect
- `((not ,it)
- (flymake-log :error
- ,(format
- "Matched diagnostic didn't
capture a %s group"
- (symbol-name it)))
- nil))
- (t
- (let ((loc (flymake-diag-region flymake-collection-source
- (string-to-number line)
- (when column
- (string-to-number
column))))
- (loc-end (when end-line
- (flymake-diag-region
flymake-collection-source
- (string-to-number
end-line)
- (when end-column
- (string-to-number
end-column))))))
- (when loc-end
- (setcdr loc (cdr loc-end)))
- (list flymake-collection-source
- (car loc)
- (cdr loc)
- (nth severity-ix (quote ,severity-seq))
- (concat
- (when id
- (concat (propertize id 'face
'flymake-collection-diag-id) " "))
- message))))))))))
+ (while (and (not res)
+ (search-forward-regexp ,combined-regex nil t))
+ (setq
+ res
+ (save-match-data
+ (save-excursion
+ (setq ; file-name (match-string 1)
+ line (match-string 2)
+ column (match-string 3)
+ message (match-string 4)
+ id (match-string 5)
+ end-line (match-string 6)
+ end-column (match-string 7)
+ severity-ix (- (seq-find #'match-string
+ (number-sequence ,(1+ group-count)
+ ,(+ group-count
(length regexps))))
+ ,(1+ group-count)))
+ (cond
+ ;; Log an error when any of the required fields are missing.
+ ,@(cl-loop for it in '(severity-ix line message)
+ collect
+ `((not ,it)
+ (flymake-log :error
+ ,(format
+ "Matched diagnostic didn't capture
a %s group"
+ (symbol-name it)))
+ nil))
+ (t
+ (let ((loc (flymake-diag-region flymake-collection-source
+ (string-to-number line)
+ (when column
+ (string-to-number column))))
+ (loc-end (when end-line
+ (flymake-diag-region flymake-collection-source
+ (string-to-number
end-line)
+ (when end-column
+ (string-to-number
end-column))))))
+ (when loc-end
+ (setcdr loc (cdr loc-end)))
+ (list flymake-collection-source
+ (car loc)
+ (cdr loc)
+ (nth severity-ix (quote ,severity-seq))
+ (concat
+ (when id
+ (concat (propertize id 'face
'flymake-collection-diag-id) " "))
+ message)))))))))
res)))
(cl-defmacro flymake-collection-define-rx