emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] scratch/flymake-refactor 61ba20b 21/52: Echo flymake error


From: João Távora
Subject: [Emacs-diffs] scratch/flymake-refactor 61ba20b 21/52: Echo flymake error messages when navigating errors interactively
Date: Sun, 1 Oct 2017 12:40:46 -0400 (EDT)

branch: scratch/flymake-refactor
commit 61ba20b478cf09ce2af6f5a8aee3dd46d6682045
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-ui.el (flymake-goto-next-error): Use
    target overlay's help-echo.
---
 lisp/progmodes/flymake-ui.el | 16 ++++++++++------
 1 file changed, 10 insertions(+), 6 deletions(-)

diff --git a/lisp/progmodes/flymake-ui.el b/lisp/progmodes/flymake-ui.el
index 7fd9701..9968c33 100644
--- a/lisp/progmodes/flymake-ui.el
+++ b/lisp/progmodes/flymake-ui.el
@@ -546,15 +546,19 @@ with flymake-specific meaning can also be used.
          (chain (cl-member-if (lambda (ov)
                                 (if (cl-plusp n)
                                     (> (overlay-start ov)
-                                        (point))
+                                       (point))
                                   (< (overlay-start ov)
-                                      (point))))
+                                     (point))))
                               ovs))
          (target (nth (1- n) chain)))
-    (if target
-        (goto-char (overlay-start target))
-      (when interactive
-        (user-error "No more flymake errors")))))
+    (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]