Checkdoc: use syntax functions instead of regex
authorPhilipp Stephani <phst@google.com>
Fri, 30 Dec 2016 17:00:54 +0000 (18:00 +0100)
committerPhilipp Stephani <phst@google.com>
Sat, 31 Dec 2016 16:30:46 +0000 (17:30 +0100)
commit4bbd5424a2290ab4bd88c0af602b7aa7d53a407e
treec6928916fdb29df58d509e519953adc1fe21f6a3
parent8a165813cb9321a8979ac6d98530f5e4392fb879
Checkdoc: use syntax functions instead of regex

In checkdoc.el, get rid of the error-prone regex to find definition
forms, and use existing syntax-based navigation functions instead.
This fixes a corner case with one-argument `defvar' forms.

* lisp/emacs-lisp/checkdoc.el (checkdoc--next-docstring): New function.
(checkdoc-next-docstring, checkdoc-defun): Use it.
* test/lisp/emacs-lisp/checkdoc-tests.el (checkdoc-tests--next-docstring):
Add unit test.
lisp/emacs-lisp/checkdoc.el
test/lisp/emacs-lisp/checkdoc-tests.el