* emacs-lisp/checkdoc.el (checkdoc-proper-noun-regexp): Build
authorKevin Ryde <user42@zip.com.au>
Tue, 24 Nov 2009 23:13:55 +0000 (23:13 +0000)
committerKevin Ryde <user42@zip.com.au>
Tue, 24 Nov 2009 23:13:55 +0000 (23:13 +0000)
value with regexp-opt instead of explicit joining loop.  (My
Bug#4927.)

lisp/ChangeLog
lisp/emacs-lisp/checkdoc.el

index 021ae0d..04cbca0 100644 (file)
@@ -1,5 +1,9 @@
 2009-11-24  Kevin Ryde  <user42@zip.com.au>
 
+       * emacs-lisp/checkdoc.el (checkdoc-proper-noun-regexp): Build
+       value with regexp-opt instead of explicit joining loop.  (My
+       Bug#4927.)
+
        * emacs-lisp/elint.el (elint-add-required-env): Better error message
        when .el source file not found or other error.
 
index 7140c99..5e8d2e0 100644 (file)
@@ -334,12 +334,9 @@ This should be set in an Emacs Lisp file's local variables."
   ;; "[.!?]" 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