diff options
author | Nicolas Goaziou <mail@nicolasgoaziou.fr> | 2014-08-11 13:44:13 +0200 |
---|---|---|
committer | Nicolas Goaziou <mail@nicolasgoaziou.fr> | 2014-08-11 14:56:01 +0200 |
commit | dcf5510053bb14c38654c90de0257bae7faa1cb8 (patch) | |
tree | f3718642067e97dc6a5498f2689d2ff54ebf9e18 | |
parent | d17cd9962f80a1faa134f5ccc758dc7961c27215 (diff) | |
download | org-mode-dcf5510053bb14c38654c90de0257bae7faa1cb8.tar.gz |
ox-texinfo: Tiny refactoring
* lisp/ox-texinfo.el (org-texinfo-info-process): Fix docstring.
(org-texinfo-compile): Do not check for impossible cases (e.g., if the
previous variable contains a function).
-rw-r--r-- | lisp/ox-texinfo.el | 43 |
1 files changed, 17 insertions, 26 deletions
diff --git a/lisp/ox-texinfo.el b/lisp/ox-texinfo.el index cecc529..5f4fbad 100644 --- a/lisp/ox-texinfo.el +++ b/lisp/ox-texinfo.el @@ -357,12 +357,11 @@ in order to mimic default behavior: ;;;; Compilation -(defcustom org-texinfo-info-process - '("makeinfo %f") +(defcustom org-texinfo-info-process '("makeinfo %f") "Commands to process a Texinfo file to an INFO file. This is list of strings, each of them will be given to the shell as a command. %f in the command will be replaced by the full -file name, %b by the file base name \(i.e without extension) and +file name, %b by the file base name (i.e without extension) and %o by the base directory of the file." :group 'org-export-texinfo :type '(repeat :tag "Shell command sequence" @@ -1557,29 +1556,21 @@ Return INFO file name or an error if it couldn't be produced." errors) (message (format "Processing Texinfo file %s..." file)) (save-window-excursion - (cond - ;; A function is provided: Apply it. - ((functionp org-texinfo-info-process) - (funcall org-texinfo-info-process (shell-quote-argument file))) - ;; A list is provided: Replace %b, %f and %o with appropriate - ;; values in each command before applying it. Output is - ;; redirected to "*Org INFO Texinfo Output*" buffer. - ((consp org-texinfo-info-process) - (let ((outbuf (get-buffer-create "*Org INFO Texinfo Output*"))) - (mapc - (lambda (command) - (shell-command - (replace-regexp-in-string - "%b" (shell-quote-argument base-name) - (replace-regexp-in-string - "%f" (shell-quote-argument full-name) - (replace-regexp-in-string - "%o" (shell-quote-argument out-dir) command t t) t t) t t) - outbuf)) - org-texinfo-info-process) - ;; Collect standard errors from output buffer. - (setq errors (org-texinfo-collect-errors outbuf)))) - (t (error "No valid command to process to Info"))) + ;; Replace %b, %f and %o with appropriate values in each command + ;; before applying it. Output is redirected to "*Org INFO + ;; Texinfo Output*" buffer. + (let ((outbuf (get-buffer-create "*Org INFO Texinfo Output*"))) + (dolist (command org-texinfo-info-process) + (shell-command + (replace-regexp-in-string + "%b" (shell-quote-argument base-name) + (replace-regexp-in-string + "%f" (shell-quote-argument full-name) + (replace-regexp-in-string + "%o" (shell-quote-argument out-dir) command t t) t t) t t) + outbuf)) + ;; Collect standard errors from output buffer. + (setq errors (org-texinfo-collect-errors outbuf))) (let ((infofile (concat out-dir base-name ".info"))) ;; Check for process failure. Provide collected errors if ;; possible. |