[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] emacs-26 f1601be 02/39: Flymake provides flymake-report re
From: |
João Távora |
Subject: |
[Emacs-diffs] emacs-26 f1601be 02/39: Flymake provides flymake-report re-entry point for backends |
Date: |
Tue, 3 Oct 2017 10:04:45 -0400 (EDT) |
branch: emacs-26
commit f1601bef93a23ecd5092d9360a48e2288d835886
Author: João Távora <address@hidden>
Commit: João Távora <address@hidden>
Flymake provides flymake-report re-entry point for backends
* lisp/progmodes/flymake-proc.el (flymake-post-syntax-check):
Simplify. Call flymake-report.
* lisp/progmodes/flymake.el (flymake-report): New function.
---
lisp/progmodes/flymake-proc.el | 38 +++++++++++++-------------------------
lisp/progmodes/flymake.el | 18 ++++++++++++++++++
2 files changed, 31 insertions(+), 25 deletions(-)
diff --git a/lisp/progmodes/flymake-proc.el b/lisp/progmodes/flymake-proc.el
index 89633fe..63c65c2 100644
--- a/lisp/progmodes/flymake-proc.el
+++ b/lisp/progmodes/flymake-proc.el
@@ -440,31 +440,18 @@ It's flymake process filter."
(setq flymake-is-running nil))))))))
(defun flymake-post-syntax-check (exit-status command)
- (save-restriction
- (widen)
- (setq flymake-err-info flymake-new-err-info)
- (setq flymake-new-err-info nil)
- (setq flymake-err-info
- (flymake-fix-line-numbers
- flymake-err-info 1 (count-lines (point-min) (point-max))))
- (flymake-delete-own-overlays)
- (flymake-highlight-err-lines flymake-err-info)
- (let (err-count warn-count)
- (setq err-count (flymake-get-err-count flymake-err-info "e"))
- (setq warn-count (flymake-get-err-count flymake-err-info "w"))
- (flymake-log 2 "%s: %d error(s), %d warning(s) in %.2f second(s)"
- (buffer-name) err-count warn-count
- (- (float-time) flymake-check-start-time))
- (setq flymake-check-start-time nil)
-
- (if (and (equal 0 err-count) (equal 0 warn-count))
- (if (equal 0 exit-status)
- (flymake-report-status "" "") ; PASSED
- (if (not flymake-check-was-interrupted)
- (flymake-report-fatal-status "CFGERR"
- (format "Configuration error has
occurred while running %s" command))
- (flymake-report-status nil ""))) ; "STOPPED"
- (flymake-report-status (format "%d/%d" err-count warn-count) "")))))
+ (let ((err-count (flymake-get-err-count flymake-new-err-info "e"))
+ (warn-count (flymake-get-err-count flymake-new-err-info "w")))
+ (if (equal 0 exit-status)
+ (flymake-report flymake-new-err-info)
+ (if flymake-check-was-interrupted
+ (flymake-report-status nil "") ;; STOPPED
+ (if (and (zerop err-count) (zerop warn-count))
+ (flymake-report-fatal-status "CFGERR"
+ (format "Configuration error has
occurred while running %s" command))
+ (flymake-report flymake-new-err-info))))
+ (setq flymake-new-err-info nil)))
+
(defun flymake-parse-output-and-residual (output)
"Split OUTPUT into lines, merge in residual if necessary."
@@ -709,6 +696,7 @@ Return its components if so, nil otherwise."
(flymake-clear-project-include-dirs-cache)
(setq flymake-check-was-interrupted nil)
+ (setq flymake-check-start-time (float-time))
(let* ((source-file-name buffer-file-name)
(init-f (flymake-get-init-function source-file-name))
diff --git a/lisp/progmodes/flymake.el b/lisp/progmodes/flymake.el
index 441784c..a1b16c0 100644
--- a/lisp/progmodes/flymake.el
+++ b/lisp/progmodes/flymake.el
@@ -427,6 +427,24 @@ For the format of LINE-ERR-INFO, see
`flymake-ler-make-ler'."
(setq flymake-mode-line mode-line)
(force-mode-line-update)))
+(defun flymake-report (diagnostics)
+ (save-restriction
+ (widen)
+ (setq flymake-err-info
+ (flymake-fix-line-numbers
+ diagnostics 1 (count-lines (point-min) (point-max))))
+ (flymake-delete-own-overlays)
+ (flymake-highlight-err-lines flymake-err-info)
+ (let ((err-count (flymake-get-err-count flymake-err-info "e"))
+ (warn-count (flymake-get-err-count flymake-err-info "w")))
+ (flymake-log 2 "%s: %d error(s), %d warning(s) in %.2f second(s)"
+ (buffer-name) err-count warn-count
+ (- (float-time) flymake-check-start-time))
+ (if (and (equal 0 err-count) (equal 0 warn-count))
+ (flymake-report-status "" "")
+ (flymake-report-status (format "%d/%d" err-count warn-count) "")))))
+
+
;; Nothing in flymake uses this at all any more, so this is just for
;; third-party compatibility.
(define-obsolete-function-alias 'flymake-display-warning 'message-box "26.1")
- [Emacs-diffs] emacs-26 updated (0fff900 -> ca08b69), João Távora, 2017/10/03
- [Emacs-diffs] emacs-26 bbcb079 06/39: Allow running Flymake tests from interactive sessions, João Távora, 2017/10/03
- [Emacs-diffs] emacs-26 1c30f9f 05/39: Flymake diagnostics now apply to arbitrary buffer regions, João Távora, 2017/10/03
- [Emacs-diffs] emacs-26 8c85ab0 12/39: Echo Flymake error messages when navigating errors interactively, João Távora, 2017/10/03
- [Emacs-diffs] emacs-26 0d26e45 11/39: Add a new Flymake test for multiple errors and warnings, João Távora, 2017/10/03
- [Emacs-diffs] emacs-26 54beebb 14/39: Flymake highlights GCC info/notes as detected by flymake-proc.el, João Távora, 2017/10/03
- [Emacs-diffs] emacs-26 f1601be 02/39: Flymake provides flymake-report re-entry point for backends,
João Távora <=
- [Emacs-diffs] emacs-26 ae64bf1 08/39: New Flymake variable flymake-diagnostic-types-alist and much cleanup, João Távora, 2017/10/03
- [Emacs-diffs] emacs-26 6954270 03/39: Completely rewrite Flymake's subprocess output processing, João Távora, 2017/10/03
- [Emacs-diffs] emacs-26 f930963 18/39: Simplify Flymake logging and erroring, João Távora, 2017/10/03
- [Emacs-diffs] emacs-26 734aa88 09/39: Flymake's flymake-proc.el parses column numbers from gcc/javac errors, João Távora, 2017/10/03
- [Emacs-diffs] emacs-26 9f8ad13 07/39: Refactor Flymake tests in preparation for more tests, João Távora, 2017/10/03
- [Emacs-diffs] emacs-26 491cc4a 13/39: Flymake checks file names before considering diagnostics, João Távora, 2017/10/03
- [Emacs-diffs] emacs-26 7787988 10/39: Flymake warning face easier to distinguish, João Távora, 2017/10/03
- [Emacs-diffs] emacs-26 5ec7d73 19/39: Flymake's flymake-proc.el backend slightly easier to debug, João Távora, 2017/10/03
- [Emacs-diffs] emacs-26 9a629a7 23/39: Add interactive flymake-start function, João Távora, 2017/10/03
- [Emacs-diffs] emacs-26 b0bb181 15/39: Protect Flymake's eager checks against commands like fill-paragraph, João Távora, 2017/10/03