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 16:07:10 +0200 Message-ID: <20100724140710.GB23108@tomas> References: <20100723111931.GA29930@tomas> <201007240839.53358.DanielBausch@gmx.de> <20100724082329.GA21627@tomas> <87vd85rtev.wl%dmaus@ictsoc.de> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1699536842==" Return-path: Received: from [140.186.70.92] (port=42128 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OcfZ9-0000Lv-6p for emacs-orgmode@gnu.org; Sat, 24 Jul 2010 10:19:08 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OcfK1-0007P4-2U for emacs-orgmode@gnu.org; Sat, 24 Jul 2010 10:03:29 -0400 Received: from alextrapp1.equinoxe.de ([217.22.192.104]:44321 helo=www.elogos.de) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OcfK0-0007OX-Qf for emacs-orgmode@gnu.org; Sat, 24 Jul 2010 10:03:25 -0400 In-Reply-To: <87vd85rtev.wl%dmaus@ictsoc.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: David Maus Cc: emacs-orgmode@gnu.org --===============1699536842== Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="wzJLGUyc3ArbnUjN" Content-Disposition: inline --wzJLGUyc3ArbnUjN Content-Type: multipart/mixed; boundary="6TrnltStXW4iwmi0" Content-Disposition: inline --6TrnltStXW4iwmi0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, Jul 24, 2010 at 01:49:44PM +0200, David Maus wrote: >=20 > Hi Tom=E1s, >=20 > 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=E1s --6TrnltStXW4iwmi0 Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="org-export-markup.patch" Content-Transfer-Encoding: quoted-printable diff --git a/contrib/lisp/org-export-generic.el b/contrib/lisp/org-export-g= eneric.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-ma= rkup) (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-m= arkup))) =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 revers= e) "converts a property specification to a string given types of properties --6TrnltStXW4iwmi0-- --wzJLGUyc3ArbnUjN Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) iD8DBQFMSvOOBcgs9XrR2kYRAtoZAJ9TvaT6orP3fSAmnlhOy21Nt/nGmgCfeHnc iqXCJ1RdpR6nKZKpKbuvkp4= =nkrQ -----END PGP SIGNATURE----- --wzJLGUyc3ArbnUjN-- --===============1699536842== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ 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 --===============1699536842==--