emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Bryan Fink <bryan@basho.com>
To: emacs-orgmode@gnu.org
Subject: ascii-export vs. "<<" and ">>" patch
Date: Thu, 7 Jan 2010 12:30:57 -0500	[thread overview]
Message-ID: <473d01841001070930g19ba5a3l92beeb6a8a9c5478@mail.gmail.com> (raw)

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

Hi.  I'm using org-mode to write some documentation about Erlang
modules.  Erlang's "binary" data type has a syntax like:

   <<"this is binary data">>

Org-mode's ascii-exporter in version 6.33f blindly strips all <<>>
pairs from the file, leaving the text as

   "this is binary data"

which, unfortunately, is still valid Erlang syntax, but has a different meaning.

So, to help me and others write Erlang documentation in org-mode, I
submit the patch attached to this email, which changes org-ascii.el
such that it checks the org-protected text property before stripping
<<>> characters, so examples marked as verbatim text should go
untouched.

-Bryan

[-- Attachment #2: 0001-do-not-strip-and-from-protected-sections-during-asci.patch --]
[-- Type: application/octet-stream, Size: 841 bytes --]

From c7a6a3034b9e9588e22144e580105dd2016dc04a Mon Sep 17 00:00:00 2001
From: Bryan Fink <bryan@basho.com>
Date: Thu, 7 Jan 2010 12:02:28 -0500
Subject: [PATCH] do not strip "<<" and ">>" from protected sections during ascii export

---
 lisp/org-ascii.el |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/lisp/org-ascii.el b/lisp/org-ascii.el
index 3019a1a..8ef2b2c 100644
--- a/lisp/org-ascii.el
+++ b/lisp/org-ascii.el
@@ -494,7 +494,8 @@ publishing directory."
   ;; Remove target markers
   (goto-char (point-min))
   (while (re-search-forward  "<<<?\\([^<>]*\\)>>>?\\([ \t]*\\)" nil t)
-    (replace-match "\\1\\2")))
+    (if (not (get-text-property (point) 'org-protected))
+        (replace-match "\\1\\2"))))
 
 (defun org-html-expand-for-ascii (line)
   "Handle quoted HTML for ASCII export."
-- 
1.6.5.5


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

_______________________________________________
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode

             reply	other threads:[~2010-01-07 17:31 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-01-07 17:30 Bryan Fink [this message]
2010-01-08  8:41 ` ascii-export vs. "<<" and ">>" patch Carsten Dominik

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

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=473d01841001070930g19ba5a3l92beeb6a8a9c5478@mail.gmail.com \
    --to=bryan@basho.com \
    --cc=emacs-orgmode@gnu.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.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).