emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Carsten Dominik <carsten.dominik@gmail.com>
To: Nicolas Girard <nicolas.girard@nerim.net>
Cc: emacs-orgmode Mailinglist <emacs-orgmode@gnu.org>
Subject: Re: [ANN] org-icons.el
Date: Wed, 24 Jun 2009 13:56:01 +0200	[thread overview]
Message-ID: <58663F3E-F49C-46AE-B39B-3A5DA714B211@gmail.com> (raw)
In-Reply-To: <51b0095d0906240313w775904a2i2825c103d88ed93@mail.gmail.com>


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

>
>
> 2009/6/24 Carsten Dominik <carsten.dominik@gmail.com>
>
> On Jun 24, 2009, at 11:41 AM, Nicolas Girard wrote:
>
> 2009/6/24 Carsten Dominik <carsten.dominik@gmail.com>
> 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

  parent reply	other threads:[~2009-06-24 11:56 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-06-23 19:38 [ANN] org-icons.el Nicolas Girard
2009-06-23 21:31 ` Xin Shi
2009-06-23 22:35 ` Bastien
2009-06-23 22:55   ` Nicolas Girard
2009-06-23 23:24     ` Bastien
2009-06-23 22:54 ` David O'Toole
     [not found]   ` <87my7yeeai.fsf@bzg.ath.cx>
2009-06-23 23:16     ` David O'Toole
2009-06-24  4:50       ` Carsten Dominik
2009-06-24  9:41         ` Nicolas Girard
2009-06-24  9:48           ` Carsten Dominik
2009-06-24 10:23             ` Nicolas Girard
2009-06-24 11:57               ` Sebastian Rose
     [not found]             ` <51b0095d0906240313w775904a2i2825c103d88ed93@mail.gmail.com>
2009-06-24 11:56               ` Carsten Dominik [this message]
2009-06-24 18:33                 ` David O'Toole
2009-06-24 23:28 ` Daniel Clemente
2009-06-25  9:34   ` Carsten Dominik
2009-06-25 11:04     ` Richard Riley

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=58663F3E-F49C-46AE-B39B-3A5DA714B211@gmail.com \
    --to=carsten.dominik@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=nicolas.girard@nerim.net \
    /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).