emacs-devel
[Top][All Lists]
Advanced

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

Re: next-error use cases


From: Dmitry Gutov
Subject: Re: next-error use cases
Date: Sat, 23 May 2020 02:50:28 +0300
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.7.0

On 22.05.2020 04:31, Clément Pit-Claudel wrote:
On 21/05/2020 18.49, Dmitry Gutov wrote:
On 22.05.2020 01:06, Juri Linkov wrote:
A binding for flymake-show-diagnostics-buffer in goto-map?
Good idea, not only for flymake, but for all next-error capable buffers:
a keybinding in goto-map to show the buffer with a list of errors/matches.
For example, the user is navigating using 'M-g M-n' when the next-errors buffer
is not visible, then wants to see all errors/matches, so the user needs to type
some M-g key to show it.

So we'll have 'M-g l' to pop up the current 'next-error-last-buffer'.

And 'C-c ! l' to pop Flymake's diagnostics buffer specifically (and change 
next-error-last-buffer's value appropriately). 'C-c ! n' and 'C-c ! p' could 
work along the same idea.

Does this mean that Flycheck should override M-g l too, or will that work 
automatically (how will M-g l know which one to pick?)

I think this will work simply like:

(defun next-error-show-list ()
  (interactive)
  (pop-to-buffer next-error-last-buffer))

But for this to be okay, we'd have to decide on a principle, and Flycheck would have to agree, that next-error-function is set in flycheck-error-list-mode, and not in flycheck-mode.

These are the relevant bits of Flycheck's map, I think:

     (define-key map "c"         #'flycheck-buffer)
     (define-key map "C"         #'flycheck-clear)
     (define-key map "n"         #'flycheck-next-error)
     (define-key map "p"         #'flycheck-previous-error)
     (define-key map "l"         #'flycheck-list-errors)
     (define-key map (kbd "C-w") #'flycheck-copy-errors-as-kill)
     (define-key map "s"         #'flycheck-select-checker)
     (define-key map "h"         #'flycheck-display-error-at-point)
     (define-key map "H"         #'display-local-help)

The copy-errors-as-kill command sounds nice. Not sure if any others can easily apply to Flymake too.



reply via email to

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