aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lisp/emacs-lisp/checkdoc.el21
1 files changed, 21 insertions, 0 deletions
diff --git a/lisp/emacs-lisp/checkdoc.el b/lisp/emacs-lisp/checkdoc.el
index ecf6f8203a2..e93294d6cc2 100644
--- a/lisp/emacs-lisp/checkdoc.el
+++ b/lisp/emacs-lisp/checkdoc.el
@@ -1638,6 +1638,17 @@ function,command,variable,option or symbol." ms1))))))
1638 ;; * If a user option variable records a true-or-false 1638 ;; * If a user option variable records a true-or-false
1639 ;; condition, give it a name that ends in `-flag'. 1639 ;; condition, give it a name that ends in `-flag'.
1640 1640
1641 ;; "True ..." should be "Non-nil ..."
1642 (when (looking-at "\"\\*?\\(True\\)\\b")
1643 (if (checkdoc-autofix-ask-replace
1644 (match-beginning 1) (match-end 1)
1645 "Say \"Non-nil\" instead of \"True\"? "
1646 "Non-nil")
1647 nil
1648 (checkdoc-create-error
1649 "\"True\" should usually be \"Non-nil\""
1650 (match-beginning 1) (match-end 1))))
1651
1641 ;; If the variable has -flag in the name, make sure 1652 ;; If the variable has -flag in the name, make sure
1642 (if (and (string-match "-flag$" (car fp)) 1653 (if (and (string-match "-flag$" (car fp))
1643 (not (looking-at "\"\\*?Non-nil\\s-+means\\s-+"))) 1654 (not (looking-at "\"\\*?Non-nil\\s-+means\\s-+")))
@@ -1798,6 +1809,16 @@ Replace with \"%s\"? " original replace)
1798 "Probably \"%s\" should be imperative \"%s\"" 1809 "Probably \"%s\" should be imperative \"%s\""
1799 original replace) 1810 original replace)
1800 (match-beginning 1) (match-end 1)))))) 1811 (match-beginning 1) (match-end 1))))))
1812 ;; "Return true ..." should be "Return non-nil ..."
1813 (when (looking-at "\"Return \\(true\\)\\b")
1814 (if (checkdoc-autofix-ask-replace
1815 (match-beginning 1) (match-end 1)
1816 "Say \"non-nil\" instead of \"true\"? "
1817 "non-nil")
1818 nil
1819 (checkdoc-create-error
1820 "\"true\" should usually be \"non-nil\""
1821 (match-beginning 1) (match-end 1))))
1801 ;; Done with functions 1822 ;; Done with functions
1802 ))) 1823 )))
1803 ;;* When a documentation string refers to a Lisp symbol, write it as 1824 ;;* When a documentation string refers to a Lisp symbol, write it as