comparison lisp/emacs-lisp/checkdoc.el @ 106228:74465418bc07

* emacs-lisp/checkdoc.el (checkdoc-proper-noun-regexp): Build value with regexp-opt instead of explicit joining loop. (My Bug#4927.)
author Kevin Ryde <user42@zip.com.au>
date Tue, 24 Nov 2009 23:13:09 +0000
parents 510f457168de
children 1d1d5d9bd884
comparison
equal deleted inserted replaced
106227:25c332a2db29 106228:74465418bc07
332 332
333 (defvar checkdoc-proper-noun-regexp 333 (defvar checkdoc-proper-noun-regexp
334 ;; "[.!?]" is for noun at end of a sentence, since those chars 334 ;; "[.!?]" is for noun at end of a sentence, since those chars
335 ;; are symbol syntax in emacs-lisp-mode and so don't match \\_>. 335 ;; are symbol syntax in emacs-lisp-mode and so don't match \\_>.
336 ;; The \" allows it to be the last sentence in a docstring too. 336 ;; The \" allows it to be the last sentence in a docstring too.
337 (let ((expr "\\_<\\(") 337 (concat "\\_<"
338 (l checkdoc-proper-noun-list)) 338 (regexp-opt checkdoc-proper-noun-list t)
339 (while l 339 "\\(\\_>\\|[.!?][ \t\n\"]\\)")
340 (setq expr (concat expr (car l) (if (cdr l) "\\|" ""))
341 l (cdr l)))
342 (concat expr "\\)\\(\\_>\\|[.!?][ \t\n\"]\\)"))
343 "Regular expression derived from `checkdoc-proper-noun-regexp'.") 340 "Regular expression derived from `checkdoc-proper-noun-regexp'.")
344 341
345 (defvar checkdoc-common-verbs-regexp nil 342 (defvar checkdoc-common-verbs-regexp nil
346 "Regular expression derived from `checkdoc-common-verbs-regexp'.") 343 "Regular expression derived from `checkdoc-common-verbs-regexp'.")
347 344