[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Modern Conventions for Emacs Lisp files?

From: Stefan Monnier
Subject: Re: Modern Conventions for Emacs Lisp files?
Date: Mon, 15 Apr 2013 09:13:20 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux)

> => Result: "^;;[;]+\\{1\\} \\(.*\\)"

This is OK (tho a bit inefficient) but things like

    "^;;[;]+\\{3\\} \\(.*\\)"
    "^;;[;]+\\{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.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]