From mboxrd@z Thu Jan 1 00:00:00 1970 From: Carsten Dominik Subject: Re: [ANN] org-icons.el Date: Wed, 24 Jun 2009 13:56:01 +0200 Message-ID: <58663F3E-F49C-46AE-B39B-3A5DA714B211@gmail.com> References: <51b0095d0906231238u62ed3107v79dd6f72a284d81b@mail.gmail.com> <64bfe3d50906231554n43790a74p739bc0e7ff426b14@mail.gmail.com> <87my7yeeai.fsf@bzg.ath.cx> <64bfe3d50906231616l4ad64907sa49daa8f826d0248@mail.gmail.com> <51b0095d0906240241v57fb7191u90ed1d87d0585c69@mail.gmail.com> <41C49548-6364-4A9A-86D3-3E70DD5E245D@gmail.com> <51b0095d0906240313w775904a2i2825c103d88ed93@mail.gmail.com> Mime-Version: 1.0 (Apple Message framework v935.3) Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MJR5H-0004Gz-W1 for emacs-orgmode@gnu.org; Wed, 24 Jun 2009 07:56:12 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MJR5D-0004By-Ho for emacs-orgmode@gnu.org; Wed, 24 Jun 2009 07:56:11 -0400 Received: from [199.232.76.173] (port=53923 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MJR5C-0004Bi-V5 for emacs-orgmode@gnu.org; Wed, 24 Jun 2009 07:56:07 -0400 Received: from mail-ew0-f220.google.com ([209.85.219.220]:35750) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MJR5C-0006Q8-Dc for emacs-orgmode@gnu.org; Wed, 24 Jun 2009 07:56:06 -0400 Received: by ewy20 with SMTP id 20so1150449ewy.42 for ; Wed, 24 Jun 2009 04:56:03 -0700 (PDT) In-Reply-To: <51b0095d0906240313w775904a2i2825c103d88ed93@mail.gmail.com> 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: Nicolas Girard Cc: emacs-orgmode Mailinglist On Jun 24, 2009, at 12:13 PM, Nicolas Girard wrote: > > > 2009/6/24 Carsten Dominik > > On Jun 24, 2009, at 11:41 AM, Nicolas Girard wrote: > > 2009/6/24 Carsten Dominik > 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