From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Kevin Ryde Newsgroups: gmane.emacs.bugs Subject: bug#4927: 23.1; checkdoc-proper-noun-regexp with regexp-opt Date: Sun, 15 Nov 2009 08:44:28 +1100 Message-ID: <87lji8zsqr.fsf@blah.blah> Reply-To: Kevin Ryde , 4927@emacsbugs.donarmstrong.com NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: ger.gmane.org 1258236461 10537 80.91.229.12 (14 Nov 2009 22:07:41 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 14 Nov 2009 22:07:41 +0000 (UTC) To: bug-gnu-emacs@gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Nov 14 23:07:35 2009 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1N9QmM-0005CR-36 for geb-bug-gnu-emacs@m.gmane.org; Sat, 14 Nov 2009 23:07:34 +0100 Original-Received: from localhost ([127.0.0.1]:38314 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1N9QmL-000474-GS for geb-bug-gnu-emacs@m.gmane.org; Sat, 14 Nov 2009 17:07:33 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1N9QmG-00046z-EB for bug-gnu-emacs@gnu.org; Sat, 14 Nov 2009 17:07:28 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1N9QmB-00046P-FV for bug-gnu-emacs@gnu.org; Sat, 14 Nov 2009 17:07:27 -0500 Original-Received: from [199.232.76.173] (port=60459 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1N9QmB-00046M-6C for bug-gnu-emacs@gnu.org; Sat, 14 Nov 2009 17:07:23 -0500 Original-Received: from rzlab.ucr.edu ([138.23.92.77]:50884) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1N9QmA-0004v8-GC for bug-gnu-emacs@gnu.org; Sat, 14 Nov 2009 17:07:22 -0500 Original-Received: from rzlab.ucr.edu (rzlab.ucr.edu [127.0.0.1]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id nAEM7KpE011258; Sat, 14 Nov 2009 14:07:20 -0800 Original-Received: (from debbugs@localhost) by rzlab.ucr.edu (8.14.3/8.14.3/Submit) id nAELo44j008760; Sat, 14 Nov 2009 13:50:04 -0800 Resent-Date: Sat, 14 Nov 2009 13:50:04 -0800 X-Loop: owner@emacsbugs.donarmstrong.com Resent-From: Kevin Ryde Resent-To: bug-submit-list@donarmstrong.com Resent-CC: Emacs Bugs 2Resent-Date: Sat, 14 Nov 2009 21:50:04 +0000 Resent-Message-ID: Resent-Sender: owner@emacsbugs.donarmstrong.com X-Emacs-PR-Message: report 4927 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Original-Received: via spool by submit@emacsbugs.donarmstrong.com id=B.12582350898194 (code B ref -1); Sat, 14 Nov 2009 21:50:04 +0000 Original-Received: (at submit) by emacsbugs.donarmstrong.com; 14 Nov 2009 21:44:49 +0000 X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. Original-Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id nAELilsl008191 for ; Sat, 14 Nov 2009 13:44:49 -0800 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1N9QQJ-0006p5-7p for bug-gnu-emacs@gnu.org; Sat, 14 Nov 2009 16:44:47 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1N9QQC-0006j4-Rd for bug-gnu-emacs@gnu.org; Sat, 14 Nov 2009 16:44:45 -0500 Original-Received: from [199.232.76.173] (port=48358 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1N9QQC-0006ii-LY for bug-gnu-emacs@gnu.org; Sat, 14 Nov 2009 16:44:40 -0500 Original-Received: from mailout2-5.pacific.net.au ([61.8.2.228]:40389 helo=mailout2.pacific.net.au) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1N9QQB-00022M-OM for bug-gnu-emacs@gnu.org; Sat, 14 Nov 2009 16:44:40 -0500 Original-Received: from mailproxy2.pacific.net.au (mailproxy2.pacific.net.au [61.8.2.163]) by mailout2.pacific.net.au (Postfix) with ESMTP id 8EB3B1937B9 for ; Sun, 15 Nov 2009 08:44:30 +1100 (EST) Original-Received: from blah.blah (ppp20E0.dyn.pacific.net.au [61.8.32.224]) by mailproxy2.pacific.net.au (Postfix) with ESMTP id CDE242740A for ; Sun, 15 Nov 2009 08:44:29 +1100 (EST) Original-Received: from gg by blah.blah with local (Exim 4.69) (envelope-from ) id 1N9QQ0-0001Ee-QL for bug-gnu-emacs@gnu.org; Sun, 15 Nov 2009 08:44:28 +1100 User-Agent: Gnus/5.110011 (No Gnus v0.11) Emacs/23.1 (gnu/linux) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) Resent-Date: Sat, 14 Nov 2009 17:07:27 -0500 X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:32621 Archived-At: --=-=-= This is the simplification I mentioned before for the way checkdoc-proper-noun-regexp is built. You'd be tempted to build the regexp within checkdoc-proper-noun-region-engine (maybe just with mapconcat) for easier customizing of checkdoc-proper-noun-list, but I suppose nobody changes it. 2009-11-13 Kevin Ryde * emacs-lisp/checkdoc.el (checkdoc-proper-noun-regexp): Build value with regexp-opt instead of explicit joining loop. --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=checkdoc.el.regexp-opt.diff --- checkdoc.el.~1.80.~ 2009-11-09 08:46:10.000000000 +1100 +++ checkdoc.el 2009-11-09 09:33:33.000000000 +1100 @@ -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 --=-=-= In GNU Emacs 23.1.1 (i486-pc-linux-gnu, GTK+ Version 2.16.5) of 2009-09-14 on raven, modified by Debian configured using `configure '--build=i486-linux-gnu' '--host=i486-linux-gnu' '--prefix=/usr' '--sharedstatedir=/var/lib' '--libexecdir=/usr/lib' '--localstatedir=/var/lib' '--infodir=/usr/share/info' '--mandir=/usr/share/man' '--with-pop=yes' '--enable-locallisppath=/etc/emacs23:/etc/emacs:/usr/local/share/emacs/23.1/site-lisp:/usr/local/share/emacs/site-lisp:/usr/share/emacs/23.1/site-lisp:/usr/share/emacs/site-lisp:/usr/share/emacs/23.1/leim' '--with-x=yes' '--with-x-toolkit=gtk' '--with-toolkit-scroll-bars' 'build_alias=i486-linux-gnu' 'host_alias=i486-linux-gnu' 'CFLAGS=-DDEBIAN -g -O2' 'LDFLAGS=-g' 'CPPFLAGS='' 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 --=-=-=--