summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJambunathan K <kjambunathan@gmail.com>2012-02-12 16:39:07 +0530
committerJambunathan K <kjambunathan@gmail.com>2012-02-12 16:39:07 +0530
commit21ccc6def67cf50bee2c4fc204e4b89752bbba23 (patch)
treea16e8335b6635127fbd004806ad36eee66dd4a14
parentc04b68a73ca77b4029839ae4836273a2ac4fb962 (diff)
downloadorg-mode-21ccc6def67cf50bee2c4fc204e4b89752bbba23.tar.gz
Simplify definition of `org-export-odt-convert-processes'
* lisp/org-odt.el (org-export-odt-convert-processes): Re-define (org-export-odt-convert-capabilities): Fix an accidental regression. * lisp/org-lparse.el (org-lparse-do-convert): Related change.
-rw-r--r--lisp/org-lparse.el25
-rw-r--r--lisp/org-odt.el27
2 files changed, 21 insertions, 31 deletions
diff --git a/lisp/org-lparse.el b/lisp/org-lparse.el
index 51fcc05..b1f224c 100644
--- a/lisp/org-lparse.el
+++ b/lisp/org-lparse.el
@@ -484,24 +484,17 @@ This is a helper routine for interactive use."
(error "Cannot convert from %s format to %s format?"
in-fmt out-fmt)))
(convert-process (car how))
- (program (car convert-process))
- (dummy (and (or program (error "Converter not configured"))
- (or (executable-find program)
- (error "Cannot find converter %s" program))))
(out-file (concat (file-name-sans-extension in-file) "."
(nth 1 (or (cdr how) out-fmt))))
(out-dir (file-name-directory in-file))
- (arglist (mapcar (lambda (arg)
- (format-spec
- arg `((?i . ,(shell-quote-argument in-file))
- (?I . ,(browse-url-file-url in-file))
- (?f . ,out-fmt)
- (?o . ,out-file)
- (?O . ,(browse-url-file-url out-file))
- (?d . , (shell-quote-argument out-dir))
- (?D . ,(browse-url-file-url out-dir)))))
- convert-process))
- (cmd (mapconcat 'identity arglist " ")))
+ (cmd (format-spec convert-process
+ `((?i . ,(shell-quote-argument in-file))
+ (?I . ,(browse-url-file-url in-file))
+ (?f . ,out-fmt)
+ (?o . ,out-file)
+ (?O . ,(browse-url-file-url out-file))
+ (?d . , (shell-quote-argument out-dir))
+ (?D . ,(browse-url-file-url out-dir))))))
(when (file-exists-p out-file)
(delete-file out-file))
@@ -511,7 +504,7 @@ This is a helper routine for interactive use."
(cond
((file-exists-p out-file)
- (message "Exported to %s using %s" out-file program)
+ (message "Exported to %s" out-file)
(when prefix-arg
(message "Opening %s..." out-file)
(org-open-file out-file))
diff --git a/lisp/org-odt.el b/lisp/org-odt.el
index 1fb5a35..f4c859a 100644
--- a/lisp/org-odt.el
+++ b/lisp/org-odt.el
@@ -2413,24 +2413,20 @@ visually."
(defcustom org-export-odt-convert-processes
'(("LibreOffice"
- ("soffice" "--headless" "--convert-to %f" "--outdir %d" "%i"))
+ "soffice --headless --convert-to %f --outdir %d %i")
("BasicODConverter"
- ("soffice" "--headless"
- "\"macro:///BasicODConverter.Main.Convert(%I,%f,%O)\""))
+ "soffice --headless \"macro:///BasicODConverter.Main.Convert(%I,%f,%O)\"")
("unoconv"
- ("unoconv" "-f" "%f" "-o" "%d" "%i")))
+ "unoconv -f %f -o %d %i"))
"Specify a list of document converters and their usage.
The converters in this list are offered as choices while
customizing `org-export-odt-convert-process'.
-This variable is an alist where each element is of the
-form (CONVERTER-NAME CONVERTER-PROCESS). CONVERTER-NAME is name
-of the converter. CONVERTER-PROCESS specifies the command-line
-syntax of the converter and is of the form (CONVERTER-PROGRAM
-ARG1 ARG2 ...). CONVERTER-PROGRAM is the name of the executable.
-ARG1, ARG2 etc are command line options that are passed to
-CONVERTER-PROGRAM. Format specifiers can be used in the ARGs and
-they are interpreted as below:
+This variable is a list where each element is of the
+form (CONVERTER-NAME CONVERTER-CMD). CONVERTER-NAME is the name
+of the converter. CONVERTER-CMD is the shell command for the
+converter and can contain format specifiers. These format
+specifiers are interpreted as below:
%i input file name in full
%I input file name as a URL
@@ -2446,8 +2442,7 @@ they are interpreted as below:
(const :tag "None" nil)
(alist :tag "Converters"
:key-type (string :tag "Converter Name")
- :value-type (group (cons (string :tag "Executable")
- (repeat (string :tag "Command line args")))))))
+ :value-type (group (string :tag "Command line")))))
(defcustom org-export-odt-convert-process "LibreOffice"
"Use this converter to convert from \"odt\" format to other formats.
@@ -2470,6 +2465,7 @@ from `org-export-odt-convert-processes'."
(("pdf" "pdf") ("odt" "odt") ("rtf" "rtf") ("ott" "ott") ("doc" "doc")
("docx" "docx") ("html" "html")))
("Web"
+ ("html")
(("pdf" "pdf") ("odt" "odt") ("html" "html")))
("Spreadsheet"
("ods" "ots" "xls" "csv" "xlsx")
@@ -2517,7 +2513,8 @@ configuration."
:type
'(choice
(const :tag "None" nil)
- (alist :key-type (string :tag "Document Class")
+ (alist :tag "Capabilities"
+ :key-type (string :tag "Document Class")
:value-type
(group (repeat :tag "Input formats" (string :tag "Input format"))
(alist :tag "Output formats"