emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] scratch/flymake-refactor-cleaner-for-emacs-26 9357120 13/3


From: João Távora
Subject: [Emacs-diffs] scratch/flymake-refactor-cleaner-for-emacs-26 9357120 13/39: Echo Flymake error messages when navigating errors interactively
Date: Mon, 2 Oct 2017 20:12:22 -0400 (EDT)

branch: scratch/flymake-refactor-cleaner-for-emacs-26
commit 935712065344574a1105580a8b3f7bc69d49bc9d
Author: João Távora <address@hidden>
Commit: João Távora <address@hidden>

    Echo Flymake error messages when navigating errors interactively
    
    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 | 22 +++++++++++++---------
 1 file changed, 13 insertions(+), 9 deletions(-)

diff --git a/lisp/progmodes/flymake.el b/lisp/progmodes/flymake.el
index 7968070..ada00ba 100644
--- a/lisp/progmodes/flymake.el
+++ b/lisp/progmodes/flymake.el
@@ -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."



reply via email to

[Prev in Thread] Current Thread [Next in Thread]