From mboxrd@z Thu Jan 1 00:00:00 1970 From: Daniel Clemente Subject: Re: Faces bug in org-indent-mode Date: Fri, 21 Aug 2009 13:03:13 +0200 Message-ID: <87prapwhse.fsf@CPU107.opentrends.net> References: <871vn6y5gy.fsf@CPU107.opentrends.net> <54F61D36-7A75-42B6-9AE5-FCDE2F373F4F@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MeRtz-0003sm-7Y for emacs-orgmode@gnu.org; Fri, 21 Aug 2009 07:03:23 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MeRtt-0003sH-Vc for emacs-orgmode@gnu.org; Fri, 21 Aug 2009 07:03:22 -0400 Received: from [199.232.76.173] (port=60133 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MeRtt-0003s9-Pm for emacs-orgmode@gnu.org; Fri, 21 Aug 2009 07:03:17 -0400 Received: from mail-ew0-f211.google.com ([209.85.219.211]:60778) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MeRtt-0001mZ-55 for emacs-orgmode@gnu.org; Fri, 21 Aug 2009 07:03:17 -0400 Received: by ewy7 with SMTP id 7so556993ewy.31 for ; Fri, 21 Aug 2009 04:03:16 -0700 (PDT) In-Reply-To: <54F61D36-7A75-42B6-9AE5-FCDE2F373F4F@gmail.com> (Carsten Dominik's message of "Thu, 20 Aug 2009 20:57:33 +0100") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Carsten Dominik Cc: org-mode list El dj, ago 20 2009 a les 21:57, Carsten Dominik va escriure: >> >> * something >> aaa =3Deee >> * two=3D *iii >> ooo* uuu >> > Yes, this is kind of hard to fix...... And a minor issue, I guess... ? > Yes, it's a minor issue. I like minor issues :-) There are two display problems here: - a face defined before a heading enters the heading (like the =3Deee=E2=80= =A6=3D) - a face defined in a heading goes on past the heading (like the *iii=E2=80= =A6) I did some tests with org-emph-re (original value: [1]); the interesting = part is \\(?:\n.*?\\)\\{0,1\\} because it is the one that allows the face t= o extend up to 1 line below. The .*? from there comes from the so-called body in org-emphasis-regexp-c= omponents, body=3D"." I have done some tests and I think that body=3D"\\(?:\\*+[^\n ]\\|[^\n*]\= \)." fixes the first problem. The expression represents a non-heading line:= anything not starting by * (except when the initial * precedes a word) and= then many other characters (a "*?" at the end will be added by org-set-emp= h-re) Final value: [2] Is this added complexity worth it? The bug is unpleasant (headings aren't= coloured as headings) and performance shouldn't be much affected in the co= mmon case because ^\\* fails early. Only visually it is a complex regexp. I don't know how to detect the other problem inside a regular expression.= Maybe there's some way to ask =E2=80=9Edon't cross boundaries between head= ings and content=E2=80=9C. -- Daniel [1]: "\\([ ('`\"{]\\|^\\)\\(\\([*/_=3D~+]\\)\\([^ =0D\n,\"']\\|[^ =0D\n,= \"'].*?\\(?:\n.*?\\)\\{0,1\\}[^ =0D\n,\"']\\)\\3\\)\\([- .,:!?;'\")}\\]\\= |$\\)" [2]: "\\([ ('`\"{]\\|^\\)\\(\\([*/_=3D~+]\\)\\([^ =0D\n,\"']\\|[^ =0D\n,= \"'].*?\\(?:\n\\*+[^\n ].*?\\|\n[^\n*].*?\\)\\{0,1\\}[^ =0D\n,\"']\\)\\3\\= )\\([- .,:!?;'\")}\\]\\|$\\)"