From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: Modern Conventions for Emacs Lisp files? Date: Mon, 15 Apr 2013 09:13:20 -0400 Message-ID: References: <87hajhswdh.fsf@gmail.com> <87y5csu7ml.fsf@gmail.com> <87hajgu5bp.fsf@gmail.com> <87li8m3sny.fsf@gmail.com> <87y5cknq9q.fsf@gmail.com> <834nf86u79.fsf@gnu.org> <87d2tw59ib.fsf@gmail.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1366031616 16865 80.91.229.3 (15 Apr 2013 13:13:36 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 15 Apr 2013 13:13:36 +0000 (UTC) Cc: emacs-devel@gnu.org To: Thorsten Jolitz Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Apr 15 15:13:40 2013 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1URjE4-0001IK-1w for ged-emacs-devel@m.gmane.org; Mon, 15 Apr 2013 15:13:40 +0200 Original-Received: from localhost ([::1]:38998 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1URjE3-0003Df-CZ for ged-emacs-devel@m.gmane.org; Mon, 15 Apr 2013 09:13:39 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:55202) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1URjDr-0002uj-Gv for emacs-devel@gnu.org; Mon, 15 Apr 2013 09:13:28 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1URjDm-0007Mb-FC for emacs-devel@gnu.org; Mon, 15 Apr 2013 09:13:27 -0400 Original-Received: from ironport2-out.teksavvy.com ([206.248.154.182]:10751) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1URjDm-0007MN-AP for emacs-devel@gnu.org; Mon, 15 Apr 2013 09:13:22 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Av4EABK/CFFFxIEd/2dsb2JhbABEvw4Xc4IeAQEEAVYjBQsLDiYSFBgNJIgeBsEtkQoDpHqBXoMT X-IPAS-Result: Av4EABK/CFFFxIEd/2dsb2JhbABEvw4Xc4IeAQEEAVYjBQsLDiYSFBgNJIgeBsEtkQoDpHqBXoMT X-IronPort-AV: E=Sophos;i="4.84,565,1355115600"; d="scan'208";a="7428481" Original-Received: from 69-196-129-29.dsl.teksavvy.com (HELO pastel.home) ([69.196.129.29]) by ironport2-out.teksavvy.com with ESMTP/TLS/ADH-AES256-SHA; 15 Apr 2013 09:13:17 -0400 Original-Received: by pastel.home (Postfix, from userid 20848) id B4B5867BA3; Mon, 15 Apr 2013 09:13:20 -0400 (EDT) In-Reply-To: <87d2tw59ib.fsf@gmail.com> (Thorsten Jolitz's message of "Mon, 15 Apr 2013 13:16:44 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 206.248.154.182 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:158923 Archived-At: > => Result: "^;;[;]+\\{1\\} \\(.*\\)" This is OK (tho a bit inefficient) but things like "^;;[;]+\\{3\\} \\(.*\\)" or "^;;[;]+\\{8,\\} \\(.*\\)" are problematic because we use a backtracking regexp-matcher, so when matching ";;;;;" against "[;]+\\{4\\}", it may consider 4 different ways to match it. For ";;;;;;" that are 4+6=10 ways to match it. For ";;;;;;;" I already prefer not to count them and for 40 semi-colons the number of different ways to match it is staggering. > How can I get the best of both worlds in this case (no infinite loops > but working fontification)? Just match outline-regexp and then call outline-level to find the level number. Stefan