emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: BEGIN_SRC..END_SRC


From: Eric Schulte
Subject: Re: BEGIN_SRC..END_SRC
Date: Wed, 16 May 2012 09:05:09 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.1.50 (gnu/linux)

Ted Zlatanov <address@hidden> writes:

> On Wed, 09 May 2012 13:36:33 -0400 Stefan Monnier <address@hidden> wrote: 
>
> SM> This said, I find
>
> SM>    (defun sm-foo ()
> SM>      (try that))
>
> SM> to be a lot more legible anyway, even without any fancy coloring.
>
> OK, so inline Markdown markup looks good to you.  I think Gnus can
> support it together with JIRA-style tags ({code:LANGUAGE}...{code}).
>

FWIW, I've been using the indented markup implementation from my
previous email for a week or so now and it seems fairly robust (it
hasn't trashed any mail so far).  I'll include it here if there is any
interest in using it.  After loading the following and re-viewing this
email in gnus, the code will be font-locked.

    ;; -*- emacs-lisp -*-
    (require 'mm-uu)

    (defvar indented-src-code-start-regexp
      "^    .*-\\*- \\(mode:\\)?\\([^[:space:]]+?\\)\\(-mode\\)? -\\*-")

    (defvar indented-src-code-end-regexp
      "^ ? ? ?[^[:space:]].*$")

    (defvar indented-src-code-lang)

    (defun mm-uu-indented-src-code-test ()
      (setq indented-src-code-lang
            (and (save-excursion (goto-char (point-at-bol))
                                 (looking-at indented-src-code-start-regexp))
                 (match-string 2))))

    (defun mm-uu-indented-src-code-extract ()
      (if indented-src-code-lang
          (mm-make-handle (mm-uu-copy-to-buffer start-point end-point)
                          (list (concat
                                 (if (string= indented-src-code-lang 
"emacs-lisp")
                                     "application/" "text/x-")
                                 indented-src-code-lang) ))
        (mm-uu-verbatim-marks-extract 0 0)))

    (add-to-list 'mm-uu-type-alist
                 `(indented-src-code
                   ,indented-src-code-start-regexp
                   ,indented-src-code-end-regexp
                   mm-uu-indented-src-code-extract
                   mm-uu-indented-src-code-test))

    (mm-uu-configure)

>
> Ted
>
>

-- 
Eric Schulte
http://cs.unm.edu/~eschulte



reply via email to

[Prev in Thread] Current Thread [Next in Thread]