# HG changeset patch # User Kevin Ryde # Date 1259104389 0 # Node ID 74465418bc0751d699676d9980831a232de3ed4f # Parent 25c332a2db29d8fe7cc8ff411f8aafd90d066357 * emacs-lisp/checkdoc.el (checkdoc-proper-noun-regexp): Build value with regexp-opt instead of explicit joining loop. (My Bug#4927.) diff -r 25c332a2db29 -r 74465418bc07 lisp/emacs-lisp/checkdoc.el --- a/lisp/emacs-lisp/checkdoc.el Tue Nov 24 23:08:15 2009 +0000 +++ b/lisp/emacs-lisp/checkdoc.el Tue Nov 24 23:13:09 2009 +0000 @@ -334,12 +334,9 @@ ;; "[.!?]" is for noun at end of a sentence, since those chars ;; are symbol syntax in emacs-lisp-mode and so don't match \\_>. ;; The \" allows it to be the last sentence in a docstring too. - (let ((expr "\\_<\\(") - (l checkdoc-proper-noun-list)) - (while l - (setq expr (concat expr (car l) (if (cdr l) "\\|" "")) - l (cdr l))) - (concat expr "\\)\\(\\_>\\|[.!?][ \t\n\"]\\)")) + (concat "\\_<" + (regexp-opt checkdoc-proper-noun-list t) + "\\(\\_>\\|[.!?][ \t\n\"]\\)") "Regular expression derived from `checkdoc-proper-noun-regexp'.") (defvar checkdoc-common-verbs-regexp nil