]> git.eshelyaron.com Git - emacs.git/commitdiff
Treat Flymake errors as just another type of diagnostic
authorJoão Távora <joaotavora@gmail.com>
Thu, 28 Sep 2017 11:21:43 +0000 (12:21 +0100)
committerJoão Távora <joaotavora@gmail.com>
Tue, 3 Oct 2017 13:18:55 +0000 (14:18 +0100)
* lisp/progmodes/flymake.el (flymake--diag-errorp): Remove.
(flymake--handle-report, flymake-popup-current-error-menu):
Don't use it.

lisp/progmodes/flymake.el

index 285ef93db62458d7fedaea5eade454fb0f5495a9..0071ba93eacb6593a7f039289f2bac49cd6e562c 100644 (file)
@@ -401,13 +401,6 @@ associated `flymake-category' return DEFAULT."
           (t
            default))))
 
-(defun flymake--diag-errorp (diag)
-  "Tell if DIAG is a flymake error or something else"
-  (let ((sev (flymake--lookup-type-property 'severity
-                                            (flymake--diag-type diag)
-                                            (warning-numeric-level :error))))
-    (>= sev (warning-numeric-level :error))))
-
 (defun flymake--fringe-overlay-spec (bitmap)
   (and flymake-fringe-indicator-position
        bitmap
@@ -495,10 +488,9 @@ associated `flymake-category' return DEFAULT."
                   (list 'mouse-1 (posn-at-point))))
          (diagnostics (mapcar (lambda (ov) (overlay-get ov 'flymake--diagnostic))
                               diag-overlays))
-         (title (format "Line %d: %d error(s), %d other(s)"
+         (title (format "Line %d: %d diagnostics(s)"
                         (line-number-at-pos)
-                        (cl-count-if #'flymake--diag-errorp diagnostics)
-                        (cl-count-if-not #'flymake--diag-errorp diagnostics)))
+                        (length diagnostics)))
          (choice (x-popup-menu event (list title (cons "" menu)))))
     (flymake-log :debug "choice=%s" choice)
     ;; FIXME: What is the point of going to the problem locus if we're
@@ -560,13 +552,11 @@ FORCE says to handle a report even if it was not expected."
                 (flymake--highlight-line diag)
                 (setf (flymake--diag-backend diag) backend))
               diagnostics)
-        (let ((err-count (cl-count-if #'flymake--diag-errorp diagnostics))
-              (warn-count (cl-count-if-not #'flymake--diag-errorp
-                                           diagnostics)))
-          (when flymake-check-start-time
-            (flymake-log 2 "%d error(s), %d other(s) in %.2f second(s)"
-                         err-count warn-count
-                         (- (float-time) flymake-check-start-time)))))))
+        (when flymake-check-start-time
+          (flymake-log 2 "backend %s reported %d diagnostics in %.2f second(s)"
+                       backend
+                       (length diagnostics)
+                       (- (float-time) flymake-check-start-time))))))
    (t
     (flymake--disable-backend "?"
                               :strange