From 8858e1ffef8f73b30919321a1f1c14e7e71b6805 Mon Sep 17 00:00:00 2001 From: Nicolas Goaziou Date: Sat, 16 Feb 2013 18:44:22 +0100 Subject: [PATCH] ox-publish: Fix index generation * lisp/ox.el (org-export-install-filters): Properly install filters send through ext-plist mechanism. * lisp/ox-publish.el (org-publish-org-to): Small refactoring. * lisp/ox-html.el (org-html-keyword): Remove INDEX keyword handling. ox-publish.el takes care of it already. --- lisp/ox-html.el | 10 ---------- lisp/ox-publish.el | 4 ++-- lisp/ox.el | 16 +++++++++++++--- 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/lisp/ox-html.el b/lisp/ox-html.el index e1b50f4d2..69115bc30 100644 --- a/lisp/ox-html.el +++ b/lisp/ox-html.el @@ -1986,7 +1986,6 @@ CONTENTS is nil. INFO is a plist holding contextual information." (value (org-element-property :value keyword))) (cond ((string= key "HTML") value) - ((string= key "INDEX") (format "\\index{%s}" value)) ;; Invisible targets. ((string= key "TARGET") nil) ((string= key "TOC") @@ -2908,15 +2907,6 @@ Return output file name." ;;;; org-html-with-timestamp ;;;; org-html-html-helper-timestamp -;;;; org-export-as-html-and-open -;;;; org-export-as-html-batch -;;;; org-export-as-html-to-buffer -;;;; org-replace-region-by-html -;;;; org-export-region-as-html -;;;; org-export-as-html - -;;;; (org-export-directory :html opt-plist) -;;;; (plist-get opt-plist :html-extension) ;;;; org-html-toplevel-hlevel ;;;; org-html-special-string-regexps ;;;; org-html-inline-images diff --git a/lisp/ox-publish.el b/lisp/ox-publish.el index 8918d8e2d..0dda6498c 100644 --- a/lisp/ox-publish.el +++ b/lisp/ox-publish.el @@ -569,8 +569,8 @@ Return output file name." ;; we want to keep it up-to-date in cache anyway. (org-combine-plists plist `(:filter-parse-tree - (org-publish-collect-index - ,@(plist-get plist :filter-parse-tree))))))) + ,(cons 'org-publish-collect-index + (plist-get plist :filter-parse-tree))))))) ;; Remove opened buffer in the process. (unless visitingp (kill-buffer work-buffer))))) diff --git a/lisp/ox.el b/lisp/ox.el index eafcd4045..22b48fb57 100644 --- a/lisp/ox.el +++ b/lisp/ox.el @@ -2622,13 +2622,23 @@ specified filters, if any, are called first." INFO is a plist containing the current communication channel. Return the updated communication channel." (let (plist) - ;; Install user defined filters with `org-export-filters-alist'. + ;; Install user-defined filters with `org-export-filters-alist' + ;; and filters already in INFO (through ext-plist mechanism). (mapc (lambda (p) - (setq plist (plist-put plist (car p) (eval (cdr p))))) + (let* ((prop (car p)) + (info-value (plist-get info prop)) + (default-value (symbol-value (cdr p)))) + (setq plist + (plist-put plist prop + ;; Filters in INFO will be called + ;; before those user provided. + (append (if (listp info-value) info-value + (list info-value)) + default-value))))) org-export-filters-alist) ;; Prepend back-end specific filters to that list. (mapc (lambda (p) - ;; Single values get consed, lists are prepended. + ;; Single values get consed, lists are appended. (let ((key (car p)) (value (cdr p))) (when value (setq plist