bug#3921: 23.1.50; checkdoc allow uncapitalized info node links
Kevin Ryde <[email protected]>
| Newsgroups | gmane.emacs.bugs,gmane.emacs.pretest.bugs |
|---|---|
| Message-ID | <[email protected]> |
M-x checkdoc on the file foo.el below complains
Name emacs should appear capitalized as Emacs (C-h,f,e,n,p,q)
at the `(emacs)' info link. I hoped it would recognise that has to be
left as-is, since it must follow the target document's name and nodes.
Perhaps the following, dragging in help-mode.el for a definitive regexp,
and using thingatpt.el just because it's a convenient way to match
surrounding point.
2009-07-25 Kevin Ryde <[email protected]>
* emacs-lisp/checkdoc.el (checkdoc-proper-noun-region-engine): Allow
uncapitalized in info node hyperlinks.
In GNU Emacs 23.1.50.4 (i586-pc-linux-gnu, GTK+ Version 2.16.4)
of 2009-07-24 on blah.blah
configured using `configure 'CFLAGS=-O -g' '--prefix=/down/emacs/b/inst' '--with-x-toolkit=gtk''
Important settings:
value of $LC_ALL: nil
value of $LC_COLLATE: nil
value of $LC_CTYPE: nil
value of $LC_MESSAGES: nil
value of $LC_MONETARY: nil
value of $LC_NUMERIC: nil
value of $LC_TIME: nil
value of $LANG: en_AU
value of $XMODIFIERS: nil
locale-coding-system: iso-latin-1-unix
default-enable-multibyte-characters: t
foo.el
(application/emacs-lisp, 187 B) - not displayed
checkdoc.el.info-link.diff
(text/x-diff, 1.2 KB)
*** checkdoc.el 23 Jul 2009 07:41:51 +1000 1.72
--- checkdoc.el 25 Jul 2009 08:53:18 +1000
***************
*** 173,178 ****
--- 173,181 ----
(defvar checkdoc-version "0.6.1"
"Release version of checkdoc you are currently running.")
+ (require 'help-mode) ;; for help-xref-info-regexp
+ (require 'thingatpt) ;; for handy thing-at-point-looking-at
+
(defvar compilation-error-regexp-alist)
(defvar compilation-mode-font-lock-keywords)
***************
*** 2003,2009 ****
;; 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)))
(if (checkdoc-autofix-ask-replace
b e (format "Text %s should be capitalized. Fix? "
text)
--- 2006,2015 ----
;; 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 node `(emacs)Commands'" etc is ok
! (not (thing-at-point-looking-at
! help-xref-info-regexp)))
(if (checkdoc-autofix-ask-replace
b e (format "Text %s should be capitalized. Fix? "
text)