emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: tomas@tuxteam.de
To: David Maus <dmaus@ictsoc.de>
Cc: emacs-orgmode@gnu.org
Subject: Re: Re: [PATCH] org-export-generic, "text markup" -- and a request
Date: Sat, 24 Jul 2010 16:07:10 +0200	[thread overview]
Message-ID: <20100724140710.GB23108@tomas> (raw)
In-Reply-To: <87vd85rtev.wl%dmaus@ictsoc.de>


[-- Attachment #1.1.1: Type: text/plain, Size: 414 bytes --]

On Sat, Jul 24, 2010 at 01:49:44PM +0200, David Maus wrote:
> 
> Hi Tomás,
> 
> Could I asked you to send the patch again as an attachment of type
> text/plain?  If you do so Org mode's patchtracker is able to pick it
> up for further review.

OK, I'll retry -- seems I made a mistake the first round. Here it
goes...

(BTW -- has anyone an idea why I can't subscribe to the list?)

Thanks
-- tomás

[-- Attachment #1.1.2: org-export-markup.patch --]
[-- Type: text/x-diff, Size: 2128 bytes --]

diff --git a/contrib/lisp/org-export-generic.el b/contrib/lisp/org-export-generic.el
index 1b099dd..88c6169 100644
--- a/contrib/lisp/org-export-generic.el
+++ b/contrib/lisp/org-export-generic.el
@@ -473,6 +473,8 @@ The prefix ARG specifies how many levels of the outline should become
 underlined headlines.  The default is 3."
   (interactive "P")
   (setq-default org-todo-line-regexp org-todo-line-regexp)
+  (unwind-protect
+      (add-hook 'org-export-preprocess-hook 'org-export-generic-process-markup)
   (let* ((opt-plist (org-combine-plists (org-default-export-plist)
 					(org-infile-export-plist)))
 	 (region-p (org-region-active-p))
@@ -541,6 +543,8 @@ underlined headlines.  The default is 3."
 		  (if (equal ass "default") org-generic-export-type ass)
 		  org-generic-alist))))
 
+	   (markup-table (plist-get export-plist :markup)) ; Need this early
+
 	 (custom-times org-display-custom-times)
 	 (org-generic-current-indentation '(0 . 0))
 	 (level 0) (old-level 0) line txt lastwastext
@@ -1021,8 +1025,23 @@ underlined headlines.  The default is 3."
 	(setq end (next-single-property-change beg 'org-cwidth))
 	(delete-region beg end)
 	(goto-char beg)))
-    (goto-char (point-min))))
+      (goto-char (point-min)))
+    ;; Unwind:
+    (remove-hook 'org-export-preprocess-hook 'org-export-generic-process-markup)))
 
+(defun org-export-generic-process-markup ()
+  (save-excursion
+    (goto-char (point-min))
+    (while (re-search-forward org-emph-re nil t)
+      (let* ((mpre (match-string 1))  ; match prefix...
+	     (msuf (match-string 5))  ; and suffix: leave alone
+	     (mchar (match-string 3)) ; org's "markup charater"
+	     (mtext (match-string 4)) ; the marked-up text
+	     (fmt (or (cdr (assoc mchar markup-table))  ; found?
+		      (concat mchar "%s" mchar)))) ; no: leave alone
+	(replace-match
+	 (format (concat "%s" fmt "%s") mpre mtext msuf)))
+      (backward-char))))
 
 (defun org-export-generic-format (export-plist prop &optional len n reverse)
   "converts a property specification to a string given types of properties

[-- Attachment #1.2: Digital signature --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

[-- Attachment #2: 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-07-24 14:19 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-07-23 11:19 [PATCH] org-export-generic, "text markup" -- and a request tomas
2010-07-24  6:39 ` Daniel Bausch
2010-07-24  8:23   ` tomas
2010-07-24 11:49     ` David Maus
2010-07-24 14:07       ` tomas [this message]
2010-07-25 14:47         ` David Maus
2010-07-25 16:35           ` tomas
2010-07-26 14:41             ` [PATCH] org-export-generic, &quot; text markup&quot; " Robert Goldman
2010-07-31  8:29               ` Bastien
2010-08-02  3:02                 ` Robert Goldman
2010-08-02 13:54 ` Orgmode[PATCH] org-export-generic, "text markup" " Wes Hardaker
2010-08-02 17:29   ` tomas
2010-08-13 20:35   ` Carsten Dominik
2010-08-19  3:04     ` Robert Goldman
2010-08-20 14:09       ` Carsten Dominik
2010-08-20 17:05         ` Robert Goldman
2010-08-21  3:25           ` Carsten Dominik
2010-08-23 14:16             ` Wes Hardaker
2010-08-23 14:24               ` Robert Goldman
2010-08-23 14:15           ` Wes Hardaker

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=20100724140710.GB23108@tomas \
    --to=tomas@tuxteam.de \
    --cc=dmaus@ictsoc.de \
    --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).