Skip to content
Browse files

emacs: implements toggling of error display (#148).

  • Loading branch information...
1 parent ad7afc4 commit 56c590f3177c368293792b0566a9c6520fafc74c @asmanur asmanur committed Dec 14, 2013
Showing with 15 additions and 0 deletions.
  1. +15 −0 emacs/merlin.el
View
15 emacs/merlin.el
@@ -396,6 +396,21 @@ buffer. Return the process created"
(with-current-buffer (merlin-get-process-buffer-name)
merlin-process-users)))
+(defun merlin-toggle-view-errors ()
+ "Toggle the viewing of errors in the buffer."
+ (interactive)
+ (setq merlin-error-after-save (not merlin-error-after-save))
+ (if merlin-error-after-save
+ (progn
+ (merlin-rewind)
+ (merlin-after-save)
+ (message "Errors are now reported. Use %s to stop reporting them."
+ (substitute-command-keys "\\[merlin-toggle-view-errors]")))
+ (progn
+ (merlin-error-reset)
+ (message "Errors are not reported anymore. Use %s to start again reporting them."
+ (substitute-command-keys "\\[merlin-toggle-view-errors]")))))
+
(defun merlin-restart-process ()
"Restart the merlin toplevel for this buffer, taking into account new flags."
(interactive)

0 comments on commit 56c590f

Please sign in to comment.
Something went wrong with that request. Please try again.