From: Oleh Krehel Date: Mon, 18 May 2015 08:07:03 +0000 (+0200) Subject: Allow checkdoc to be called in batch X-Git-Tag: emacs-25.0.90~2064 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=d3d50a9c99ef42a270127fe0f5a9e435eb760079;p=emacs.git Allow checkdoc to be called in batch * lisp/emacs-lisp/checkdoc.el (checkdoc-error): When `noninteractive' is non-nil, echo the error with `warn'. How it can be used in -batch: (with-current-buffer (find-file "checkdoc.el") (checkdoc-current-buffer t)) --- diff --git a/lisp/emacs-lisp/checkdoc.el b/lisp/emacs-lisp/checkdoc.el index 777fed082d9..b3ef44a5a1c 100644 --- a/lisp/emacs-lisp/checkdoc.el +++ b/lisp/emacs-lisp/checkdoc.el @@ -2613,9 +2613,12 @@ function called to create the messages." (count-lines (point-min) (or point (point-min)))) ": " msg))) (with-current-buffer (get-buffer checkdoc-diagnostic-buffer) - (goto-char (point-max)) - (let ((inhibit-read-only t)) - (apply #'insert text))))) + (let ((inhibit-read-only t) + (pt (point-max))) + (goto-char pt) + (apply #'insert text) + (when noninteractive + (warn (buffer-substring pt (point-max)))))))) (defun checkdoc-show-diagnostics () "Display the checkdoc diagnostic buffer in a temporary window."