aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lisp/emacs-lisp/checkdoc.el7
-rw-r--r--test/lisp/emacs-lisp/checkdoc-tests.el9
2 files changed, 14 insertions, 2 deletions
diff --git a/lisp/emacs-lisp/checkdoc.el b/lisp/emacs-lisp/checkdoc.el
index 471a2fbdf48..dd7cfd82b1d 100644
--- a/lisp/emacs-lisp/checkdoc.el
+++ b/lisp/emacs-lisp/checkdoc.el
@@ -1611,8 +1611,11 @@ may require more formatting")
1611 (let ((f nil) (m nil) (start (point)) 1611 (let ((f nil) (m nil) (start (point))
1612 ;; Ignore the "A-" modifier: it is uncommon in practice, 1612 ;; Ignore the "A-" modifier: it is uncommon in practice,
1613 ;; and leads to false positives in regexp ranges. 1613 ;; and leads to false positives in regexp ranges.
1614 (re "[^`‘A-Za-z0-9_]\\([CMs]-[a-zA-Z]\\|\\(\\([CMs]-\\)?\ 1614 (re (rx (not (any "0-9A-Za-z_`‘-"))
1615mouse-[0-3]\\)\\)\\>")) 1615 (group (or (seq (any "CMs") "-" (any "A-Za-z"))
1616 (group (opt (group (any "CMs") "-"))
1617 "mouse-" (any "0-3"))))
1618 eow)))
1616 ;; Find the first key sequence not in a sample 1619 ;; Find the first key sequence not in a sample
1617 (while (and (not f) (setq m (re-search-forward re e t))) 1620 (while (and (not f) (setq m (re-search-forward re e t)))
1618 (setq f (not (checkdoc-in-sample-code-p start e)))) 1621 (setq f (not (checkdoc-in-sample-code-p start e))))
diff --git a/test/lisp/emacs-lisp/checkdoc-tests.el b/test/lisp/emacs-lisp/checkdoc-tests.el
index 57694bd424b..242e41c7f08 100644
--- a/test/lisp/emacs-lisp/checkdoc-tests.el
+++ b/test/lisp/emacs-lisp/checkdoc-tests.el
@@ -37,6 +37,15 @@
37 (insert "(defun foo())") 37 (insert "(defun foo())")
38 (should-error (checkdoc-defun) :type 'user-error))) 38 (should-error (checkdoc-defun) :type 'user-error)))
39 39
40(ert-deftest checkdoc-docstring-avoid-false-positive-ok ()
41 "Check that Bug#68002 is fixed."
42 (with-temp-buffer
43 (emacs-lisp-mode)
44 (insert "(defvar org-element--cache-interrupt-C-g-count 0
45 \"Current number of `org-element--cache-sync' calls.
46See `org-element--cache-interrupt-C-g'.\")")
47 (checkdoc-defun)))
48
40(ert-deftest checkdoc-cl-defmethod-ok () 49(ert-deftest checkdoc-cl-defmethod-ok ()
41 "Checkdoc should be happy with a simple correct cl-defmethod." 50 "Checkdoc should be happy with a simple correct cl-defmethod."
42 (with-temp-buffer 51 (with-temp-buffer