]> git.eshelyaron.com Git - emacs.git/commitdiff
Echo Flymake error messages when navigating errors interactively
authorJoão Távora <joaotavora@gmail.com>
Thu, 21 Sep 2017 13:20:22 +0000 (14:20 +0100)
committerJoão Távora <joaotavora@gmail.com>
Mon, 2 Oct 2017 23:53:11 +0000 (00:53 +0100)
Perhaps binding M-n and M-p to flymake-goto-next-error and
flymake-goto-prev-error also wouldn't be a bad idea.

* lisp/progmodes/flymake.el (flymake-goto-next-error): Use
target overlay's help-echo.

lisp/progmodes/flymake.el

index 7968070b34a358d5cfcb3fbd5ac88954ecc8c980..ada00ba4545a7b8d380599b604764d4f3a0a0855 100644 (file)
@@ -558,15 +558,19 @@ return DEFAULT."
          (chain (cl-member-if (lambda (ov)
                                 (if (cl-plusp n)
                                     (> (overlay-start ov)
-                                       (point))
-                                 (< (overlay-start ov)
-                                     (point))))
-                             ovs))
-        (target (nth (1- n) chain)))
-    (if target
-       (goto-char (overlay-start target))
-      (when interactive
-       (user-error "No more flymake errors")))))
+                                       (point))
+                                  (< (overlay-start ov)
+                                     (point))))
+                              ovs))
+         (target (nth (1- n) chain)))
+    (cond (target
+           (goto-char (overlay-start target))
+           (when interactive
+             (message
+              (funcall (overlay-get target 'help-echo)
+                       nil nil (point)))))
+          (interactive
+           (user-error "No more flymake errors")))))
 
 (defun flymake-goto-prev-error (&optional n interactive)
   "Go to previous, or Nth previous, flymake error in buffer."