comparison lisp/emacs-lisp/checkdoc.el @ 105783:588c96104e0c

* emacs-lisp/checkdoc.el (checkdoc-proper-noun-region-engine): Use help-xref-info-regexp and help-xref-url-regexp to identify links. (Further to Bug#3921).
author Kevin Ryde <user42@zip.com.au>
date Tue, 27 Oct 2009 22:52:19 +0000
parents 4d7a7b574da2
children 510f457168de
comparison
equal deleted inserted replaced
105782:65f84b737fd8 105783:588c96104e0c
170 ;; not specifically docstring related. Would this even be useful? 170 ;; not specifically docstring related. Would this even be useful?
171 171
172 ;;; Code: 172 ;;; Code:
173 (defvar checkdoc-version "0.6.1" 173 (defvar checkdoc-version "0.6.1"
174 "Release version of checkdoc you are currently running.") 174 "Release version of checkdoc you are currently running.")
175
176 (require 'help-mode) ;; for help-xref-info-regexp
177 (require 'thingatpt) ;; for handy thing-at-point-looking-at
175 178
176 (defvar compilation-error-regexp-alist) 179 (defvar compilation-error-regexp-alist)
177 (defvar compilation-mode-font-lock-keywords) 180 (defvar compilation-mode-font-lock-keywords)
178 181
179 (defgroup checkdoc nil 182 (defgroup checkdoc nil
2015 (looking-at "`\\|\"\\|\\.\\|\\\\"))) 2018 (looking-at "`\\|\"\\|\\.\\|\\\\")))
2016 ;; surrounded by /, as in a URL or filename: /emacs/ 2019 ;; surrounded by /, as in a URL or filename: /emacs/
2017 (not (and (= ?/ (char-after e)) 2020 (not (and (= ?/ (char-after e))
2018 (= ?/ (char-before b)))) 2021 (= ?/ (char-before b))))
2019 (not (checkdoc-in-example-string-p begin end)) 2022 (not (checkdoc-in-example-string-p begin end))
2020 ;; info node 2023 ;; info or url links left alone
2021 (not (save-excursion 2024 (not (thing-at-point-looking-at
2022 (goto-char b) 2025 help-xref-info-regexp))
2023 (looking-back "\\<[Ii]nfo[ \t\n]+\\(node\\|anchor\\)[ \t\n]+`(" 2026 (not (thing-at-point-looking-at
2024 (line-beginning-position))))) 2027 help-xref-url-regexp)))
2025 (if (checkdoc-autofix-ask-replace 2028 (if (checkdoc-autofix-ask-replace
2026 b e (format "Text %s should be capitalized. Fix? " 2029 b e (format "Text %s should be capitalized. Fix? "
2027 text) 2030 text)
2028 (capitalize text) t) 2031 (capitalize text) t)
2029 nil 2032 nil