From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/30789 Path: main.gmane.org!not-for-mail From: Toby Speight Newsgroups: gmane.emacs.gnus.general Subject: Re: Making Gnus more worm-safe Date: 08 May 2000 15:32:18 +0100 Organization: Citrix Systems Sender: owner-ding@hpc.uh.edu Message-ID: References: <87hfcdwnwi.fsf@deneb.cygnus.argh.org> NNTP-Posting-Host: coloc-standby.netfonds.no Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: main.gmane.org 1035167275 10319 80.91.224.250 (21 Oct 2002 02:27:55 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Mon, 21 Oct 2002 02:27:55 +0000 (UTC) Return-Path: Original-Received: from bart.math.uh.edu (bart.math.uh.edu [129.7.128.48]) by mailhost.sclp.com (Postfix) with ESMTP id 28A67D051F for ; Mon, 8 May 2000 10:34:30 -0400 (EDT) Original-Received: from sina.hpc.uh.edu (lists@Sina.HPC.UH.EDU [129.7.3.5]) by bart.math.uh.edu (8.9.1/8.9.1) with ESMTP id JAB15896; Mon, 8 May 2000 09:34:10 -0500 (CDT) Original-Received: by sina.hpc.uh.edu (TLB v0.09a (1.20 tibbs 1996/10/09 22:03:07)); Mon, 08 May 2000 09:33:36 -0500 (CDT) Original-Received: from mailhost.sclp.com (postfix@sclp3.sclp.com [204.252.123.139]) by sina.hpc.uh.edu (8.9.3/8.9.3) with ESMTP id JAA00021 for ; Mon, 8 May 2000 09:33:23 -0500 (CDT) Original-Received: from gatekeeper.ctxuk.citrix.com (gatekeeper.ctxuk.citrix.com [195.153.38.114]) by mailhost.sclp.com (Postfix) with ESMTP id 81629D051F for ; Mon, 8 May 2000 10:32:22 -0400 (EDT) Original-Received: from sh.ctxuk.citrix.com (sh.ctxuk.citrix.com [10.30.224.4]) by gatekeeper.ctxuk.citrix.com (8.8.7/BSCF-1.7) with ESMTP id PAA28449 for ; Mon, 8 May 2000 15:32:21 +0100 (BST) Original-Received: from hwav01.ctxuk.citrix.com (hwav01.ctxuk.citrix.com [10.30.224.26]) by sh.ctxuk.citrix.com (8.8.7/BSCF-1.7) with SMTP id PAA23547 for ; Mon, 8 May 2000 15:32:09 +0100 (BST) Original-Received: from 10.30.224.23 by hwav01.ctxuk.citrix.com (InterScan E-Mail VirusWall NT); Mon, 08 May 2000 15:32:34 +0100 (GMT Daylight Time) Original-Received: from lanber.cam.eu.citrix.com ([10.70.1.235]) by hwmail01.ctxuk.citrix.com with SMTP (Microsoft Exchange Internet Mail Service Version 5.5.2650.21) id KQW9T8XA; Mon, 8 May 2000 15:39:53 +0100 Original-To: The Gnus Mailing List Original-Lines: 36 X-Author-Info: Precedence: list X-Majordomo: 1.94.jlt7 Xref: main.gmane.org gmane.emacs.gnus.general:30789 X-Report-Spam: http://spam.gmane.org/gmane.emacs.gnus.general:30789 --=-=-= Florian> Florian Weimer 0> In article <87hfcdwnwi.fsf@deneb.cygnus.argh.org>, Florian wrote: Florian> I'd suggest the following change to mailcap.el: Florian> Florian> - ("emacs-lisp" Florian> - (viewer . mailcap-maybe-eval) Florian> - (type . "application/emacs-lisp")) Florian> Florian> This feature is just too dangerous to be enabled by default. Florian> Florian> If there aren't any objections, I'll remove it. Instead of `mailcap-maybe-eval', I use the following function to display elisp parts highlighted with the usual font-locking: .gnus> (defun mm-display-elisp-inline (handle) .gnus> (let (text) .gnus> (with-temp-buffer .gnus> (mm-insert-part handle) .gnus> (emacs-lisp-mode) .gnus> (font-lock-fontify-buffer) .gnus> (setq text (buffer-string))) .gnus> (mm-insert-inline handle text))) Perhaps it's possible to do this without invoking (emacs-lisp-mode), by `let'ing the appropriate font-lock variables instead. Could we make this the default? In fact, you might consider all of the following: --=-=-= Content-Type: text/x-emacs-lisp Content-Disposition: inline Content-Description: Viewers for elisp and diffs (defun mm-display-patch-inline (handle) (let (text) (with-temp-buffer (mm-insert-part handle) (diff-mode) (font-lock-fontify-buffer) (setq text (buffer-string))) (mm-insert-inline handle text))) (defun mm-display-elisp-inline (handle) (let (text) (with-temp-buffer (mm-insert-part handle) (emacs-lisp-mode) (font-lock-fontify-buffer) (setq text (buffer-string))) (mm-insert-inline handle text))) (defun mm-add-new-type (type displayer test auto-display inlined attachment-override) (push (list type displayer test) mm-inline-media-tests) (if auto-display (push type mm-automatic-display)) (if inlined (push type mm-inlined-types)) (if attachment-override (push type mm-attachment-override-types))) (eval-after-load "mm-decode" '(progn (mm-add-new-type "text/x-patch" 'mm-display-patch-inline '(fboundp 'diff-mode) t t t) (mm-add-new-type "application/x-patch" 'mm-display-patch-inline '(fboundp 'diff-mode) t t t) (mm-add-new-type "text/x-emacs-lisp" 'mm-display-elisp-inline 'identity t t t) (mm-add-new-type "application/emacs-lisp" 'mm-display-elisp-inline 'identity t t t))) --=-=-=--