From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/25810 Path: main.gmane.org!not-for-mail From: Hrvoje Niksic Newsgroups: gmane.emacs.gnus.general Subject: Re: Adding MIME viewers Date: 11 Oct 1999 10:51:42 +0200 Sender: owner-ding@hpc.uh.edu Message-ID: <87ln9axotd.fsf@pc-hrvoje.srce.hr> References: NNTP-Posting-Host: coloc-standby.netfonds.no Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1035163130 15963 80.91.224.250 (21 Oct 2002 01:18:50 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Mon, 21 Oct 2002 01:18:50 +0000 (UTC) Return-Path: Original-Received: from spinoza.math.uh.edu (spinoza.math.uh.edu [129.7.128.18]) by sclp3.sclp.com (8.8.5/8.8.5) with ESMTP id EAA14694 for ; Mon, 11 Oct 1999 04:57:40 -0400 (EDT) Original-Received: from sina.hpc.uh.edu (lists@Sina.HPC.UH.EDU [129.7.3.5]) by spinoza.math.uh.edu (8.9.1/8.9.1) with ESMTP id DAB06525; Mon, 11 Oct 1999 03:54:03 -0500 (CDT) Original-Received: by sina.hpc.uh.edu (TLB v0.09a (1.20 tibbs 1996/10/09 22:03:07)); Mon, 11 Oct 1999 03:54:27 -0500 (CDT) Original-Received: from sclp3.sclp.com (root@sclp3.sclp.com [204.252.123.139]) by sina.hpc.uh.edu (8.9.3/8.9.3) with ESMTP id DAA22221 for ; Mon, 11 Oct 1999 03:53:59 -0500 (CDT) Original-Received: from pc-hrvoje.srce.hr (mail@pc-hrvoje.srce.hr [161.53.2.132]) by sclp3.sclp.com (8.8.5/8.8.5) with ESMTP id EAA14668 for ; Mon, 11 Oct 1999 04:51:53 -0400 (EDT) Original-Received: from hniksic by pc-hrvoje.srce.hr with local (Exim 3.03 #1 (Debian)) id 11abBG-0007EJ-00 for ; Mon, 11 Oct 1999 10:51:42 +0200 Original-To: ding@gnus.org X-Attribution: Hrvoje X-Face: &{dT~)Pu6V<0y?>3p$;@vh\`C7xB~A0T-J%Og)J,@-1%q6Q+, gs<-9M#&`I8cJp2b1{vPE|~+JE+gx;a7%BG{}nY^ehK1"q#rG O,Rn1A_Cy%t]V=Brv7h 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.