From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id 8CDDC138465 for ; Sun, 13 Jan 2013 21:15:35 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 2A36D21C04C; Sun, 13 Jan 2013 21:15:34 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 8D26B21C04C for ; Sun, 13 Jan 2013 21:15:33 +0000 (UTC) Received: from hornbill.gentoo.org (hornbill.gentoo.org [94.100.119.163]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 6E89733D777 for ; Sun, 13 Jan 2013 21:15:32 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by hornbill.gentoo.org (Postfix) with ESMTP id D606CE4073 for ; Sun, 13 Jan 2013 21:15:30 +0000 (UTC) From: "Ulrich Mueller" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Ulrich Mueller" Message-ID: <1358111605.a44b58f7535fc651ce8d85b867acd1095311550d.ulm@gentoo> Subject: [gentoo-commits] proj/emacs-tools:gentoo-syntax commit in: / X-VCS-Repository: proj/emacs-tools X-VCS-Files: ChangeLog gentoo-syntax.el X-VCS-Directories: / X-VCS-Committer: ulm X-VCS-Committer-Name: Ulrich Mueller X-VCS-Revision: a44b58f7535fc651ce8d85b867acd1095311550d X-VCS-Branch: gentoo-syntax Date: Sun, 13 Jan 2013 21:15:30 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: 69a7812a-e48b-49c3-98c2-31e18785a2b9 X-Archives-Hash: f9dd518d29bcad29c90150beb0464ffe commit: a44b58f7535fc651ce8d85b867acd1095311550d Author: Ulrich Müller gentoo org> AuthorDate: Sun Jan 13 21:13:25 2013 +0000 Commit: Ulrich Mueller gentoo org> CommitDate: Sun Jan 13 21:13:25 2013 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/emacs-tools.git;a=commit;h=a44b58f7 Keep size of regular expressions below 32 kbyte. * gentoo-syntax.el (ebuild-mode-collect-equal-cdrs): New optional argument LIMIT starts a new element in the destination list, after that number of elements from the source list have been collected. (ebuild-mode-font-lock-keywords): Limit regexp size by calling ebuild-mode-collect-equal-cdrs with the limit argument; a value of 1000 appears to keep the size is below the 32 kbyte limit. See also the change of 2012-09-22. --- ChangeLog | 10 ++++++++++ gentoo-syntax.el | 14 ++++++++------ 2 files changed, 18 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index 61df9c7..a4e0263 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2013-01-13 Ulrich Müller + + * gentoo-syntax.el (ebuild-mode-collect-equal-cdrs): New optional + argument LIMIT starts a new element in the destination list, after + that number of elements from the source list have been collected. + (ebuild-mode-font-lock-keywords): Limit regexp size by calling + ebuild-mode-collect-equal-cdrs with the limit argument; a value + of 1000 appears to keep the size is below the 32 kbyte limit. + See also the change of 2012-09-22. + 2012-09-23 Ulrich Müller * ebuild-mode-keywords.el (ebuild-mode-keywords-eclass-documentation): diff --git a/gentoo-syntax.el b/gentoo-syntax.el index 950dd6e..835317a 100644 --- a/gentoo-syntax.el +++ b/gentoo-syntax.el @@ -175,11 +175,13 @@ A formfeed is not considered whitespace by this function." "\\>" suffix) face)) - (defun ebuild-mode-collect-equal-cdrs (src) - "For alist SRC, collect elements with equal cdr and concat their cars." + (defun ebuild-mode-collect-equal-cdrs (src &optional limit) + "For alist SRC, collect elements with equal cdr and concat their cars. +Optional argument LIMIT restarts collection after that number of elements." (let (dst e) (dolist (c src dst) - (if (setq e (rassoc (cdr c) dst)) + (if (and (setq e (rassoc (cdr c) dst)) + (not (and limit (> (length (car e)) limit)))) (setcar e (append (car e) (car c))) (setq dst (cons (copy-sequence c) dst)))))) ) @@ -193,9 +195,9 @@ A formfeed is not considered whitespace by this function." (mapcar (lambda (x) (apply 'ebuild-mode-make-keywords-list x)) (ebuild-mode-collect-equal-cdrs - (mapcar - (lambda (x) (symbol-value (intern x))) - (all-completions "ebuild-mode-keywords-" obarray 'boundp)))))) + (mapcar (lambda (x) (symbol-value (intern x))) + (all-completions "ebuild-mode-keywords-" obarray 'boundp)) + 1000)))) (defvar eselect-mode-font-lock-keywords (eval-when-compile