Gnus development mailing list
 help / color / mirror / Atom feed
From: Julien Danjou <julien@danjou.info>
To: ding@gnus.org
Subject: Re: [gnus git] branch master updated: Make gnus-group-add-icon work
Date: Wed, 22 Sep 2010 19:15:06 +0200	[thread overview]
Message-ID: <sa3aan9em3p.fsf@cigue.easter-eggs.fr> (raw)
In-Reply-To: <m3sk11encw.fsf@quimbies.gnus.org> (Lars Magne Ingebrigtsen's message of "Wed, 22 Sep 2010 18:47:59 +0200")

[-- Attachment #1: Type: text/plain, Size: 1331 bytes --]

On Wed, Sep 22 2010, Lars Magne Ingebrigtsen wrote:

> Hooks are generally for user-enabled stuff.  Even the highlight thing
> really shouldn't be in that hook.

I agree. But it was not empty! This is why I did add it here. :-)

OTOH I can look to empty the hook by default.

> And it looks like an expensive function.  It starts with:
>
>   (save-excursion
>     (let* ((end (line-end-position))
>            ;; now find out where the line starts and leave point there.
>            (beg (line-beginning-position)))
>       (save-restriction
>         (narrow-to-region beg end)
>         (goto-char beg)
>         (let ((mystart (text-property-any beg end 'gnus-group-icon t)))
>
> And this is run once per line, whether you have %E to or not, isn't it?

Sure, it is. But I will say early optimization is bad. I don't think is
is slowing things down. C'mon! ;-)

But, what I would prefer to do, is to build the %E value with the image
directly, and then use that propertized string to replace %E in the
spec. This would avoid scanning group lines…

What do you think?

PS: You know, I'm new, and I don't think like I'm authorized to move
that old code all around, so I'm doing things little by little for now.
;-)

-- 
Julien Danjou
// ᐰ <julien@danjou.info>   http://julien.danjou.info

[-- Attachment #2: Type: application/pgp-signature, Size: 197 bytes --]

  reply	other threads:[~2010-09-22 17:15 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <E1OyONL-0007B2-00@quimby.gnus.org>
2010-09-22 12:28 ` Lars Magne Ingebrigtsen
2010-09-22 13:45   ` Julien Danjou
2010-09-22 16:47     ` Lars Magne Ingebrigtsen
2010-09-22 17:15       ` Julien Danjou [this message]
2010-09-22 17:18         ` Lars Magne Ingebrigtsen

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

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

  git send-email \
    --in-reply-to=sa3aan9em3p.fsf@cigue.easter-eggs.fr \
    --to=julien@danjou.info \
    --cc=ding@gnus.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.
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 NNTP newsgroup(s).