* [PATCH] org-export-preprocess-string: Use backend var
@ 2011-02-19 17:00 Jambunathan K
2011-02-28 11:20 ` [Accepted] " Bastien Guerry
2011-02-28 11:22 ` [PATCH] " Bastien
0 siblings, 2 replies; 7+ messages in thread
From: Jambunathan K @ 2011-02-19 17:00 UTC (permalink / raw)
To: emacs-orgmode
[-- 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
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [Accepted] org-export-preprocess-string: Use backend var
2011-02-19 17:00 [PATCH] org-export-preprocess-string: Use backend var Jambunathan K
@ 2011-02-28 11:20 ` Bastien Guerry
2011-02-28 12:46 ` Jambunathan K
2011-02-28 11:22 ` [PATCH] " Bastien
1 sibling, 1 reply; 7+ messages in thread
From: Bastien Guerry @ 2011-02-28 11:20 UTC (permalink / raw)
To: emacs-orgmode
Patch 625 (http://patchwork.newartisans.com/patch/625/) is now "Accepted".
Maintainer comment: none
This relates to the following submission:
http://mid.gmane.org/%3C8162sgx8l7.fsf%40gmail.com%3E
Here is the original message containing the patch:
> Content-Type: text/plain; charset="utf-8"
> MIME-Version: 1.0
> Content-Transfer-Encoding: 7bit
> Subject: [Orgmode] org-export-preprocess-string: Use backend var
> Date: Sat, 19 Feb 2011 22:00:52 -0000
> From: Jambunathan K <kjambunathan@gmail.com>
> X-Patchwork-Id: 625
> Message-Id: <8162sgx8l7.fsf@gmail.com>
> To: emacs-orgmode@gnu.org
>
>
>
>
> >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
>
>
>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [Accepted] org-export-preprocess-string: Use backend var
2011-02-28 11:20 ` [Accepted] " Bastien Guerry
@ 2011-02-28 12:46 ` Jambunathan K
2011-02-28 13:56 ` Bastien
2011-03-19 13:29 ` Matt Lundin
0 siblings, 2 replies; 7+ messages in thread
From: Jambunathan K @ 2011-02-28 12:46 UTC (permalink / raw)
To: emacs-orgmode
Bastien
>> + ;; 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))
A few words of explanation from my side.
Summary: Facilitate transparent plugging-in of per-backend
pre-processing logic to the org exporter.
Jambunathan K.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [Accepted] org-export-preprocess-string: Use backend var
2011-02-28 12:46 ` Jambunathan K
@ 2011-02-28 13:56 ` Bastien
2011-03-19 13:29 ` Matt Lundin
1 sibling, 0 replies; 7+ messages in thread
From: Bastien @ 2011-02-28 13:56 UTC (permalink / raw)
To: emacs-orgmode
Jambunathan K <kjambunathan@gmail.com> writes:
> A few words of explanation from my side.
>
> Summary: Facilitate transparent plugging-in of per-backend
> pre-processing logic to the org exporter.
Thanks!
--
Bastien
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [Accepted] org-export-preprocess-string: Use backend var
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
1 sibling, 1 reply; 7+ messages in thread
From: Matt Lundin @ 2011-03-19 13:29 UTC (permalink / raw)
To: emacs-orgmode
Jambunathan K <kjambunathan@gmail.com> writes:
> Bastien
>
>>> + ;; 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))
>
> A few words of explanation from my side.
>
> Summary: Facilitate transparent plugging-in of per-backend
> pre-processing logic to the org exporter.
>
> Jambunathan K.
>
This patch (0135cb9c) breaks Wes Hardaker's generic export (in contrib).
Since the backend is nil, the following line causes org-export to try to
require org-nil:
(require (intern (concat "org-" backend-name)) nil)
--8<---------------cut here---------------start------------->8---
Debugger entered--Lisp error: (file-error "Cannot open load file" "org-nil")
require(org-nil nil)
--8<---------------cut here---------------end--------------->8---
I ask because even though org-export-generic.el is a contributed
package, an option to call it is hard-coded into org-export:
--8<---------------cut here---------------start------------->8---
\[g] export using Wes Hardaker's generic exporter
--8<---------------cut here---------------end--------------->8---
Best,
Matt
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [Accepted] org-export-preprocess-string: Use backend var
2011-03-19 13:29 ` Matt Lundin
@ 2011-03-19 20:33 ` Matt Lundin
0 siblings, 0 replies; 7+ messages in thread
From: Matt Lundin @ 2011-03-19 20:33 UTC (permalink / raw)
To: emacs-orgmode
Matt Lundin <mdl@imapmail.org> writes:
> Jambunathan K <kjambunathan@gmail.com> writes:
> This patch (0135cb9c) breaks Wes Hardaker's generic export (in contrib).
>
> Since the backend is nil, the following line causes org-export to try to
> require org-nil:
>
> (require (intern (concat "org-" backend-name)) nil)
>
> Debugger entered--Lisp error: (file-error "Cannot open load file" "org-nil")
> require(org-nil nil)
>
> I ask because even though org-export-generic.el is a contributed
> package, an option to call it is hard-coded into org-export:
>
> \[g] export using Wes Hardaker's generic exporter
I missed Nick's earlier patch to fix this. Everything is working
properly now. Sorry for the noise.
Best,
Matt
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] org-export-preprocess-string: Use backend var
2011-02-19 17:00 [PATCH] org-export-preprocess-string: Use backend var Jambunathan K
2011-02-28 11:20 ` [Accepted] " Bastien Guerry
@ 2011-02-28 11:22 ` Bastien
1 sibling, 0 replies; 7+ messages in thread
From: Bastien @ 2011-02-28 11:22 UTC (permalink / raw)
To: emacs-orgmode
Hi Jambunathan,
I applied this patch, thanks!
PS: Please always send some words of explanation for the patch you send,
it give me a good reason to read/review it, even for trivial patches.
--
Bastien
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2011-03-19 20:33 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-02-19 17:00 [PATCH] org-export-preprocess-string: Use backend var Jambunathan K
2011-02-28 11:20 ` [Accepted] " 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
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).