From: Hrvoje Niksic <hniksic@srce.hr>
Subject: Re: Adding MIME viewers
Date: 11 Oct 1999 10:51:42 +0200 [thread overview]
Message-ID: <87ln9axotd.fsf@pc-hrvoje.srce.hr> (raw)
In-Reply-To: Robert Bihlmeyer's message of "09 Oct 1999 16:20:41 +0200"
Robert Bihlmeyer <robbe@orcus.priv.at> writes:
> (defun mm-display-patch-inline (handle)
> (let (text)
> (with-temp-buffer
> (mm-insert-part handle)
> (diff-mode)
> (font-lock-fontify-buffer)
> (if (fboundp 'extent-list)
> (mapc (lambda (el) (set-extent-property el 'duplicable t))
> (extent-list)))
> (setq text (buffer-string)))
> (mm-insert-inline handle text)))
mapc on the extent-list is a waste of resources -- use map-extents
instead. Also, don't duplicate *all* the extents, but only the
relevant ones, say those with the `text-prop' property. For instance:
(map-extents (lambda (ext ignored)
(set-extent-property ext 'duplicable t)
nil)
nil nil nil nil nil 'text-prop)
(The above is untested.)
> Maybe this is really a misfeature of fontification, and the original
> version should work?
No, using nonduplicable properties is a feature, because normally we
*don't* want the colors to leak elsewhere. font-lock uses the
text-properties interface because it comes more naturally than the
extents interface, not because of a need for automatic duplication.
next prev parent reply other threads:[~1999-10-11 8:51 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
1999-09-10 9:48 Toby Speight
1999-09-25 8:59 ` Lars Magne Ingebrigtsen
1999-09-27 13:44 ` Toby Speight
1999-09-27 14:07 ` Lars Magne Ingebrigtsen
1999-10-04 12:06 ` Toby Speight
1999-10-09 14:20 ` Robert Bihlmeyer
1999-10-11 8:51 ` Hrvoje Niksic [this message]
1999-11-06 2:53 ` 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=87ln9axotd.fsf@pc-hrvoje.srce.hr \
--to=hniksic@srce.hr \
/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).