[Top][All Lists]

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

Re: [Orgmode] [ANN] org-icons.el

From: Carsten Dominik
Subject: Re: [Orgmode] [ANN] org-icons.el
Date: Wed, 24 Jun 2009 13:56:01 +0200

On Jun 24, 2009, at 12:13 PM, Nicolas Girard wrote:

2009/6/24 Carsten Dominik <address@hidden>

On Jun 24, 2009, at 11:41 AM, Nicolas Girard wrote:

2009/6/24 Carsten Dominik <address@hidden>
Could you guys please first explain the

;; This part is buggy (sorry)

comment in the patch?

Err... this just reflects my current lack of expressiveness in elisp... don't make me blush :-/

I am not complaining, no need to blush.

The patch looks good.  It does not add any hooks though, it
moves some of the font-lock functionality into special functions
that will then be overwritten by the org-icons package.

Actually I tried to mimic the already existing code, e.g. org-font- lock-add-priority-faces.

A bit of
a brute force approach, but it may actually be the right thing
for this purpose.

I'm unsure it's the best approach either. I'm wondering that all these (while (re-search-forward)) could slow things down.

I don't think these functions should do a while regexp search.  Finding
the next match, leaving the cursor after it, and returning t if something was found should be enough, font-lock will then call the function multiple
times if needed to address the entire visible part of the screen.

Also, searching for the special keywords could maybe be combined into
a single regexp.  Might be faster.

I'm not sure I fully understand the font-locking code, but it seems like it performs several -- possibly many -- regexp searches on one part of the buffer, alternatively adding or removing text properties, right ?

Yes.  And font-lock decides about the region to cover.

I'm just wondering, could this be rewritten as one or several state machines, that would trigger text properties addition/removal only once for a given part of the buffer ?

This is how font-lock works.  While typing, it constantly
rechecks the current line and stuff close to it, but not
the entire buffer.  Sometimes more is needed, for example
inserting a double quote makes the entire rest of the buffer
a string......

I think I can easily apply the patch - I even like the fact that
it cleans up the font locking a bit and moves stuff into functions.

But if this patch is preliminary, keep working on it and give me
a more complete version when done.

Well, thanks for your support !
By the way, you didn't give your opinion on using icons yourself. Please confess us, are you a text-only addicted kind of guy, or a flashy, glossy icons amateur...?

To be honest, I was not excited when I first saw David's icons.
Yours look a lot better - but I don't expect to use them myself.

But others seem to think differently, and I am not going
to stand in the way if the impact on normal Org-mode
performance is unnoticeable.

- Carsten

reply via email to

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