diff options
| author | Oleh Krehel | 2015-05-18 10:07:03 +0200 |
|---|---|---|
| committer | Oleh Krehel | 2015-05-18 10:07:03 +0200 |
| commit | d3d50a9c99ef42a270127fe0f5a9e435eb760079 (patch) | |
| tree | b49653391cd45361e292c7e9c58838a23bae62e4 | |
| parent | 8ae43eec7d49f468411bd1aea285be1d3ed0aa4a (diff) | |
| download | emacs-d3d50a9c99ef42a270127fe0f5a9e435eb760079.tar.gz 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))
| -rw-r--r-- | lisp/emacs-lisp/checkdoc.el | 9 |
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." | |||
| 2613 | (count-lines (point-min) (or point (point-min)))) | 2613 | (count-lines (point-min) (or point (point-min)))) |
| 2614 | ": " msg))) | 2614 | ": " msg))) |
| 2615 | (with-current-buffer (get-buffer checkdoc-diagnostic-buffer) | 2615 | (with-current-buffer (get-buffer checkdoc-diagnostic-buffer) |
| 2616 | (goto-char (point-max)) | 2616 | (let ((inhibit-read-only t) |
| 2617 | (let ((inhibit-read-only t)) | 2617 | (pt (point-max))) |
| 2618 | (apply #'insert text))))) | 2618 | (goto-char pt) |
| 2619 | (apply #'insert text) | ||
| 2620 | (when noninteractive | ||
| 2621 | (warn (buffer-substring pt (point-max)))))))) | ||
| 2619 | 2622 | ||
| 2620 | (defun checkdoc-show-diagnostics () | 2623 | (defun checkdoc-show-diagnostics () |
| 2621 | "Display the checkdoc diagnostic buffer in a temporary window." | 2624 | "Display the checkdoc diagnostic buffer in a temporary window." |