Gnus development mailing list
 help / color / mirror / Atom feed
From: Xavier Maillard <zedek@gnu-rox.org>
Subject: Re: Embedded lisp in the message body: hwoto ?
Date: Thu, 07 Oct 2004 17:45:48 +0200	[thread overview]
Message-ID: <plop87sm8qbkgj.fsf@gnu-rox.org> (raw)
In-Reply-To: <871xgb7x16.fsf@guti.no-ip.org>

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

On  7 oct 2004, Cristian Gutierrez wrote:

> Este viernes, Jesper Harder dijo:
> > Xavier Maillard <zedek@gnu-rox.org> writes:
> > 
> > > 2. I have friends of mine with whoom I often exchange Lisp
> > > snippets and so I would like to have the lisp snippet
> > > rendered differently from the rest of the article
> > 
> > This should be easy.  Just use inline attachments:
> > (defun foo (x)
> > (+ 2 x))
> > 
> > i.e.
> > 
> > 

[-- Attachment #2: Type: application/emacs-lisp, Size: 36 bytes --]

[-- Attachment #3: Type: text/plain, Size: 4133 bytes --]

> 
> Amazing! Is there any chance to highlight snippets in other
> languages? (Perl/Python for example). Inlining a little perl
> snippet (text/x-perl) didn't work here...

Yes and the cool and neat thing, you can add your own !

For inlined content, just check:

,----[ C-h v mm-inlined-types RET ]
| mm-inlined-types's value is 
| ("image/.*" "text/.*" "message/delivery-status"
|"message/rfc822" "message/partial" "message/external-body"
|"application/emacs-lisp" "application/x-emacs-lisp"
|"application/pgp-signature" "application/x-pkcs7-signature"
|"application/pkcs7-signature" "application/x-pkcs7-mime"
|"application/pkcs7-mime") 
| 
| 
| List of media types that are to be displayed inline.
| See also `mm-inline-media-tests', which says how to display a media
| type inline.
| 
| You can customize this variable.
| 
| Defined in `mm-decode'.
`----

Plus:

,----[ C-h v mm-inline-media-tests RET ]
| mm-inline-media-tests's value is shown below.
| 
| Alist of media types/tests saying whether types can be displayed inline.
| 
| You can customize this variable.
| 
| Defined in `mm-decode'.
| 
| Value:
| (("image/p?jpeg" mm-inline-image
|   (lambda
|     (handle)
|     (mm-valid-and-fit-image-p 'jpeg handle)))
|  ("image/png" mm-inline-image
|   (lambda
|     (handle)
|     (mm-valid-and-fit-image-p 'png handle)))
|  ("image/gif" mm-inline-image
|   (lambda
|     (handle)
|     (mm-valid-and-fit-image-p 'gif handle)))
|  ("image/tiff" mm-inline-image
|   (lambda
|     (handle)
|     (mm-valid-and-fit-image-p 'tiff handle)))
|  ("image/xbm" mm-inline-image
|   (lambda
|     (handle)
|     (mm-valid-and-fit-image-p 'xbm handle)))
|  ("image/x-xbitmap" mm-inline-image
|   (lambda
|     (handle)
|     (mm-valid-and-fit-image-p 'xbm handle)))
|  ("image/xpm" mm-inline-image
|   (lambda
|     (handle)
|     (mm-valid-and-fit-image-p 'xpm handle)))
|  ("image/x-xpixmap" mm-inline-image
|   (lambda
|     (handle)
|     (mm-valid-and-fit-image-p 'xpm handle)))
|  ("image/bmp" mm-inline-image
|   (lambda
|     (handle)
|     (mm-valid-and-fit-image-p 'bmp handle)))
|  ("image/x-portable-bitmap" mm-inline-image
|   (lambda
|     (handle)
|     (mm-valid-and-fit-image-p 'pbm handle)))
|  ("text/plain" mm-inline-text identity)
|  ("text/enriched" mm-inline-text identity)
|  ("text/richtext" mm-inline-text identity)
|  ("text/x-patch" mm-display-patch-inline
|   (lambda
|     (handle)
|     (locate-library "diff-mode")))
|  ("application/emacs-lisp" mm-display-elisp-inline identity)
|  ("application/x-emacs-lisp" mm-display-elisp-inline identity)
|  ("text/dns" mm-display-dns-inline identity)
|  ("text/html" mm-inline-text-html
|   (lambda
|     (handle)
|     (or mm-inline-text-html-renderer mm-text-html-renderer)))
|  ("text/x-vcard" mm-inline-text-vcard
|   (lambda
|     (handle)
|     (or
|      (featurep 'vcard)
|      (locate-library "vcard"))))
|  ("message/delivery-status" mm-inline-text identity)
|  ("message/rfc822" mm-inline-message identity)
|  ("message/partial" mm-inline-partial identity)
|  ("message/external-body" mm-inline-external-body identity)
|  ("text/.*" mm-inline-text identity)
|  ("audio/wav" mm-inline-audio
|   (lambda
|     (handle)
|     (and
|      (or
|       (featurep 'nas-sound)
|       (featurep 'native-sound))
|      (device-sound-enabled-p))))
|  ("audio/au" mm-inline-audio
|   (lambda
|     (handle)
|     (and
|      (or
|       (featurep 'nas-sound)
|       (featurep 'native-sound))
|      (device-sound-enabled-p))))
|  ("application/pgp-signature" ignore identity)
|  ("application/x-pkcs7-signature" ignore identity)
|  ("application/pkcs7-signature" ignore identity)
|  ("application/x-pkcs7-mime" ignore identity)
|  ("application/pkcs7-mime" ignore identity)
|  ("multipart/alternative" ignore identity)
|  ("multipart/mixed" ignore identity)
|  ("multipart/related" ignore identity)
|  ("audio/.*" ignore ignore)
|  ("image/.*" ignore ignore)
|  (".*" mm-inline-text mm-readable-p))
| 
| [back]
`----

You can add a perl highlithing engine quite easily.

Regards.
-- 
Registered Linux-User #340967 with the Linux Counter, http://counter.li.org.


      reply	other threads:[~2004-10-07 15:45 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-09-30 23:42 Xavier Maillard
2004-10-01 18:24 ` Jesper Harder
2004-10-01 20:28   ` Xavier Maillard
2004-10-01 20:49     ` Jesper Harder
2004-10-01 20:49   ` Xavier Maillard
2004-10-02 19:44     ` Jesper Harder
2004-10-03 14:24       ` Xavier Maillard
2004-10-05  1:24         ` Katsumi Yamaoka
2004-10-05  4:45           ` [SOLVED] (was: Embedded lisp in the message body: hwoto ?) Xavier Maillard
2004-10-02 15:55   ` Embedded lisp in the message body: hwoto ? Xavier Maillard
2004-10-07  8:27   ` Cristian Gutierrez
2004-10-07 15:45     ` Xavier Maillard [this message]

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=plop87sm8qbkgj.fsf@gnu-rox.org \
    --to=zedek@gnu-rox.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).