Skip to content

Provide method for clearing errors in buffer. #698

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
edw opened this issue Aug 4, 2014 · 3 comments
Closed

Provide method for clearing errors in buffer. #698

edw opened this issue Aug 4, 2014 · 3 comments

Comments

@edw
Copy link

edw commented Aug 4, 2014

It can be difficult to read code, especially large regions of code, that have an error overlay applied. AFAIK, Emacs does not provide a command for removing overlays, so one needs to M-: (delete-all-overlays) RET to remove the error. This is a hassle. I've currently bound this procedure to C-x C-M-e:

(defun cider-clear-errors ()
  (interactive)
  (delete-all-overlays))
@bbatsov
Copy link
Member

bbatsov commented Aug 4, 2014

That's a bit too extreme (as it will delete unrelated overlays). A proper solution would be:

(remove-overlays (point-min) (point-max) 'cider-note-p t)

Guess we can wrap this in an interactive command.

@vspinu
Copy link
Contributor

vspinu commented Aug 4, 2014

Are you talking about the compilation error message? If so it's only one in the whole buffer and #690 deletes it once you modify the region. I have been using it for a day now and it feels pretty right. Alternatively it can be deleted when the pointer enters the error region or on a timeout. I am a bit inclined towards deleting it on entering. I will try it today.

@vspinu
Copy link
Contributor

vspinu commented Aug 4, 2014

It turns out that point-entered hook is a text and not an overlay property. So sorry, it's too complicated.

As we are on it, I think CIDER should blink the region when jumping to an error and don't leave an overlay at all. This is precisely how comilation in emacs works (see next-error-highlight). Unfortunately cider is not quite integrated with emacs next-error functionality. I plan to look more comprehensively into this issue at the end of the week.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants