emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Daniel Clemente <n142857@gmail.com>
To: Carsten Dominik <carsten.dominik@gmail.com>
Cc: org-mode list <emacs-orgmode@gnu.org>
Subject: Re: Faces bug in org-indent-mode
Date: Fri, 21 Aug 2009 13:03:13 +0200	[thread overview]
Message-ID: <87prapwhse.fsf@CPU107.opentrends.net> (raw)
In-Reply-To: <54F61D36-7A75-42B6-9AE5-FCDE2F373F4F@gmail.com> (Carsten Dominik's message of "Thu, 20 Aug 2009 20:57:33 +0100")

El dj, ago 20 2009 a les 21:57, Carsten Dominik va escriure:
>>
>> * something
>> aaa =eee
>> * two= *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 =eee…=)
- a face defined in a heading goes on past the heading (like the *iii…)

  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 to extend up to 1 line below.
  The .*? from there comes from the so-called body in org-emphasis-regexp-components, body="."
  I have done some tests and I think that body="\\(?:\\*+[^\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-emph-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 common 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 „don't cross boundaries between headings and content“.


-- Daniel

[1]: "\\([ 	('`\"{]\\|^\\)\\(\\([*/_=~+]\\)\\([^ 	\r\n,\"']\\|[^ 	\r\n,\"'].*?\\(?:\n.*?\\)\\{0,1\\}[^ 	\r\n,\"']\\)\\3\\)\\([- 	.,:!?;'\")}\\]\\|$\\)"

[2]: "\\([ 	('`\"{]\\|^\\)\\(\\([*/_=~+]\\)\\([^ 	\r\n,\"']\\|[^ 	\r\n,\"'].*?\\(?:\n\\*+[^\n ].*?\\|\n[^\n*].*?\\)\\{0,1\\}[^ 	\r\n,\"']\\)\\3\\)\\([- 	.,:!?;'\")}\\]\\|$\\)"

  reply	other threads:[~2009-08-21 11:03 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-08-20 13:07 Faces bug in org-indent-mode Jason F. McBrayer
2009-08-20 13:34 ` Daniel Clemente
2009-08-20 19:57   ` Carsten Dominik
2009-08-21 11:03     ` Daniel Clemente [this message]
2009-08-25  7:56       ` Carsten Dominik
2009-08-26 11:42         ` Daniel Clemente
2009-08-26 12:26           ` Carsten Dominik
2009-08-20 19:54 ` Carsten Dominik

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87prapwhse.fsf@CPU107.opentrends.net \
    --to=n142857@gmail.com \
    --cc=carsten.dominik@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).