From mboxrd@z Thu Jan 1 00:00:00 1970 From: tomas@tuxteam.de Subject: Re: Re: [PATCH] org-export-generic, "text markup" -- and a request Date: Sat, 24 Jul 2010 10:23:29 +0200 Message-ID: <20100724082329.GA21627@tomas> References: <20100723111931.GA29930@tomas> <201007240839.53358.DanielBausch@gmx.de> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; x-action=pgp-signed Content-Transfer-Encoding: quoted-printable Return-path: Received: from [140.186.70.92] (port=34349 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OcZxR-00013Q-5P for emacs-orgmode@gnu.org; Sat, 24 Jul 2010 04:19:46 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OcZxQ-0007jG-0L for emacs-orgmode@gnu.org; Sat, 24 Jul 2010 04:19:44 -0400 Received: from alextrapp1.equinoxe.de ([217.22.192.104]:51279 helo=www.elogos.de) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OcZxP-0007iw-NW for emacs-orgmode@gnu.org; Sat, 24 Jul 2010 04:19:43 -0400 Content-Disposition: inline In-Reply-To: <201007240839.53358.DanielBausch@gmx.de> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Daniel Bausch Cc: tomas@tuxteam.de, emacs-orgmode@gnu.org -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Sat, Jul 24, 2010 at 08:39:53AM +0200, Daniel Bausch wrote: > Hi Tomas! >=20 > I have nothing to contribute to the real topic, but I wanted to inform = you=20 > that there is a software called dokuwiki - so I got a bit irritated, wh= ether=20 > you are reffering to that or to mediawiki, as you first stated. No, that was a typo. In my special case it's actually dokuwiki (wasn't my choice). But the patch itself isnt dependent on that. > And (at least on the mailinglist) your patch is delivered as an empty f= ile. Whoops! thanks for the heads-up. Here it is, inline (remember that I filtered out whitespace diffs -- the indentation after patching isn't right, but the patch is more readable): Usage is in my original mail. - -----------------------------------------------------------------------= - 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 outli= ne 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)))) =20 + (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))) =20 +(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)))) =20 (defun org-export-generic-format (export-plist prop &optional len n reve= rse) "converts a property specification to a string given types of properti= es - -----------------------------------------------------------------------= - Regards - -- tom=C3=A1s -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) iD8DBQFMSqMBBcgs9XrR2kYRArNHAJwKtIEHDAY3F6+o7mhT9pKLreJHPQCcDM7w fgjepSJwjsZqm3lv7903Caw=3D =3DpbVQ -----END PGP SIGNATURE-----