emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Jambunathan K <kjambunathan@gmail.com>
To: emacs-orgmode@gnu.org
Subject: [PATCH] org-export-preprocess-string: Use backend var
Date: Sat, 19 Feb 2011 22:30:52 +0530	[thread overview]
Message-ID: <8162sgx8l7.fsf@gmail.com> (raw)

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: 0001-org-export-preprocess-string-Use-backend-var.patch --]
[-- Type: text/x-patch, Size: 1505 bytes --]

From 2b1f84fdcd7d79ad95e71bc2ca96fb16ad76b446 Mon Sep 17 00:00:00 2001
From: Jambunathan K <kjambunathan@gmail.com>
Date: Sat, 19 Feb 2011 22:26:10 +0530
Subject: [PATCH] org-export-preprocess-string: Use backend var

---
 lisp/org-exp.el |   22 +++++-----------------
 1 files changed, 5 insertions(+), 17 deletions(-)

diff --git a/lisp/org-exp.el b/lisp/org-exp.el
index 9a35b00..a17091b 100644
--- a/lisp/org-exp.el
+++ b/lisp/org-exp.el
@@ -1197,23 +1197,11 @@ on this string to produce the exported version."
       ;; Another hook
       (run-hooks 'org-export-preprocess-before-backend-specifics-hook)
 
-      ;; LaTeX-specific preprocessing
-      (when (eq backend 'latex)
-	(require 'org-latex nil)
-	(org-export-latex-preprocess parameters))
-
-      ;; ASCII-specific preprocessing
-      (when (eq backend 'ascii)
-	(org-export-ascii-preprocess parameters))
-
-      ;; HTML-specific preprocessing
-      (when (eq backend 'html)
-	(org-export-html-preprocess parameters))
-
-      ;; DocBook-specific preprocessing
-      (when (eq backend 'docbook)
-	(require 'org-docbook nil)
-	(org-export-docbook-preprocess parameters))
+      ;; Backend-specific preprocessing
+      (let* ((backend-name (symbol-name backend))
+	     (f (intern (format "org-export-%s-preprocess" backend-name))))
+	(require (intern (concat "org-" backend-name)) nil)
+	(funcall f parameters))
 
       ;; Remove or replace comments
       (org-export-handle-comments (plist-get parameters :comments))
-- 
1.7.2.3



[-- 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:[~2011-02-19 17:01 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-19 17:00 Jambunathan K [this message]
2011-02-28 11:20 ` [Accepted] org-export-preprocess-string: Use backend var Bastien Guerry
2011-02-28 12:46   ` Jambunathan K
2011-02-28 13:56     ` Bastien
2011-03-19 13:29     ` Matt Lundin
2011-03-19 20:33       ` Matt Lundin
2011-02-28 11:22 ` [PATCH] " Bastien

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=8162sgx8l7.fsf@gmail.com \
    --to=kjambunathan@gmail.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).