Function: checkdoc-proper-noun-region-engine
checkdoc-proper-noun-region-engine is a byte-compiled function defined
in checkdoc.el.gz.
Signature
(checkdoc-proper-noun-region-engine BEGIN END)
Documentation
Check all text between BEGIN and END for lower case proper nouns.
These are Emacs centric proper nouns which should be capitalized for consistency. Return an error list if any are not fixed, but internally skip over no answers. If the offending word is in a piece of quoted text, then it is skipped.
Source Code
;; Defined in /usr/src/emacs/lisp/emacs-lisp/checkdoc.el.gz
(defun checkdoc-proper-noun-region-engine (begin end)
"Check all text between BEGIN and END for lower case proper nouns.
These are Emacs centric proper nouns which should be capitalized for
consistency. Return an error list if any are not fixed, but
internally skip over no answers.
If the offending word is in a piece of quoted text, then it is skipped."
(save-excursion
(let ((case-fold-search nil)
(errtxt nil) bb be)
(with-syntax-table checkdoc-syntax-table
(goto-char begin)
(while (re-search-forward checkdoc-proper-noun-regexp end t)
(let ((text (match-string 1))
(b (match-beginning 1))
(e (match-end 1)))
(if (and (not (save-excursion
(goto-char b)
(forward-char -1)
(looking-at "[`\".‘]\\|\\\\")))
;; surrounded by /, as in a URL or filename: /emacs/
(not (and (= ?/ (char-after e))
(= ?/ (char-before b))))
(not (checkdoc-in-example-string-p begin end))
;; info or url links left alone
(not (thing-at-point-looking-at
help-xref-info-regexp))
(not (thing-at-point-looking-at
help-xref-url-regexp)))
(if (checkdoc-autofix-ask-replace
b e (format "Text %s should be capitalized. Fix?"
text)
(capitalize text) t)
nil
(if errtxt
;; If there is already an error, then generate
;; the warning output if applicable
(if checkdoc-generate-compile-warnings-flag
(checkdoc-create-error
(format
"Name %s should appear capitalized as %s"
text (capitalize text))
b e))
(setq errtxt
(format
"Name %s should appear capitalized as %s"
text (capitalize text))
bb b be e)))))))
(if errtxt (checkdoc-create-error errtxt bb be)))))