From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eric Schulte Newsgroups: gmane.emacs.devel Subject: Re: BEGIN_SRC..END_SRC Date: Wed, 09 May 2012 10:57:41 -0400 Message-ID: <87k40ljtay.fsf@gmx.com> References: <871umzrvfw.fsf@gmail.com> <87wr4rqg6g.fsf@gmail.com> <83d36j59gv.fsf@gnu.org> <87r4uz58e3.fsf@sec.modprobe.de> <83aa1n57p4.fsf@gnu.org> <5D17181ED92C4552AE8D4404DD035CA0@us.oracle.com> <87vck8sfyv.fsf@uwakimon.sk.tsukuba.ac.jp> <85obq05aua.fsf@iznogoud.viz> <87r4uvs4ae.fsf@uwakimon.sk.tsukuba.ac.jp> <87397b15u7.fsf@gnu.org> <87y5p2nhc3.fsf@catnip.gol.com> <87k40lsfuv.fsf@uwakimon.sk.tsukuba.ac.jp> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: dough.gmane.org 1336582690 8411 80.91.229.3 (9 May 2012 16:58:10 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 9 May 2012 16:58:10 +0000 (UTC) Cc: "Stephen J. Turnbull" , emacs-devel@gnu.org To: Lars Magne Ingebrigtsen Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed May 09 18:58:08 2012 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1SSADE-0006Ok-UN for ged-emacs-devel@m.gmane.org; Wed, 09 May 2012 18:58:05 +0200 Original-Received: from localhost ([::1]:50890 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SSADE-00024q-AW for ged-emacs-devel@m.gmane.org; Wed, 09 May 2012 12:58:04 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:35912) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SSAD8-00024a-Ov for emacs-devel@gnu.org; Wed, 09 May 2012 12:58:02 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SSAD0-0001W0-I4 for emacs-devel@gnu.org; Wed, 09 May 2012 12:57:58 -0400 Original-Received: from mailout-us.gmx.com ([74.208.5.67]:57312) by eggs.gnu.org with smtp (Exim 4.71) (envelope-from ) id 1SSAD0-0001Vk-9v for emacs-devel@gnu.org; Wed, 09 May 2012 12:57:50 -0400 Original-Received: (qmail invoked by alias); 09 May 2012 16:57:47 -0000 Original-Received: from c-174-56-50-60.hsd1.nm.comcast.net (EHLO bagel) [174.56.50.60] by mail.gmx.com (mp-us002) with SMTP; 09 May 2012 12:57:47 -0400 X-Authenticated: #67821228 X-Provags-ID: V01U2FsdGVkX18HJY0Ips0H6SNvUcl6RaZPLjvPMruNSlF8SwyMmC qAgeuEfCGFbh7p User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.1.50 (gnu/linux) X-Y-GMX-Trusted: 0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 74.208.5.67 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:150395 Archived-At: --=-=-= Content-Type: text/plain Lars Magne Ingebrigtsen writes: > "Stephen J. Turnbull" writes: > >> > We don't want to bother with MIME for short snippets. >> >> Then what do you think your MUA is there for? > > The support for embedding small snippets via MIME is dicey in some mail > readers, last time I looked. They present(ed) the first textual part as > the only visible text, and presented the rest as attachments. To contribute to the bikeshedding [1], I've composed an example email in gnus with inline Org-mode-syntax code, inline mime-annotated code, and attached (disposition=inline) code. The results as displayed by gnus, gmail and gmx are shown [2]. I don't know if gnus should limit itself based on the limitations of non-standards-compliant commercial software, but at the least it would seem that while the mime approach /should/ be the most portable it will in fact not be portable to many (maybe most) other MUAs. Since the only non-mime option is some sort of inline markup, although I personally don't mind the Org-mode syntax, I also like the indentation based suggestion as shown here. ;; -*- emacs-lisp -*- (defun foo () "bar" :baz) The only question there being how often would indented non-code be accidentally interpreted by gnus as code? Also, this solution is potentially more Emacs-specific than the existing Org-mode syntax. The following (attached disposition=inline) elisp works as an initial implementation of this behavior on my system. --=-=-= Content-Type: application/emacs-lisp Content-Disposition: inline; filename=indented-code.el Content-Transfer-Encoding: quoted-printable ;; -*- emacs-lisp -*- (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 (format "application/%s" 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) --=-=-= Content-Type: text/plain Best, Footnotes: [1] http://bikeshed.com/ [2] http://i.imgur.com/FBA53.png -- Eric Schulte http://cs.unm.edu/~eschulte/ --=-=-=--