summaryrefslogtreecommitdiff
path: root/lisp/emacs-lisp/checkdoc.el
diff options
context:
space:
mode:
authorOleh Krehel <ohwoeowho@gmail.com>2015-05-18 10:07:03 +0200
committerOleh Krehel <ohwoeowho@gmail.com>2015-05-18 10:07:03 +0200
commitd3d50a9c99ef42a270127fe0f5a9e435eb760079 (patch)
treeb49653391cd45361e292c7e9c58838a23bae62e4 /lisp/emacs-lisp/checkdoc.el
parent8ae43eec7d49f468411bd1aea285be1d3ed0aa4a (diff)
downloademacs-d3d50a9c99ef42a270127fe0f5a9e435eb760079.tar.gz
emacs-d3d50a9c99ef42a270127fe0f5a9e435eb760079.tar.bz2
emacs-d3d50a9c99ef42a270127fe0f5a9e435eb760079.zip
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))
Diffstat (limited to 'lisp/emacs-lisp/checkdoc.el')
-rw-r--r--lisp/emacs-lisp/checkdoc.el9
1 files changed, 6 insertions, 3 deletions
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."