diff options
author | Nicolas Goaziou <mail@nicolasgoaziou.fr> | 2017-10-24 13:55:38 +0200 |
---|---|---|
committer | Nicolas Goaziou <mail@nicolasgoaziou.fr> | 2017-10-24 13:55:38 +0200 |
commit | 5c91976b4958117e8b746de818df34cb7a540a87 (patch) | |
tree | b288d7cdda7fd7a7fc94e8692833e94b7fc24afc | |
parent | 3aa4d44ba8e5a4d02fbc2ebcf3dc73b796a8780a (diff) | |
download | org-mode-5c91976b4958117e8b746de818df34cb7a540a87.tar.gz |
ox-texinfo: Remove TABs from output
* lisp/ox-texinfo.el (org-texinfo--untabify): New function.
(texinfo): Use new function as a final output filter.
See (info "(texinfo) Conventions").
-rw-r--r-- | lisp/ox-texinfo.el | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/lisp/ox-texinfo.el b/lisp/ox-texinfo.el index e6aa3e5..c67675e 100644 --- a/lisp/ox-texinfo.el +++ b/lisp/ox-texinfo.el @@ -83,7 +83,8 @@ :filters-alist '((:filter-headline . org-texinfo--filter-section-blank-lines) (:filter-parse-tree . org-texinfo--normalize-headlines) - (:filter-section . org-texinfo--filter-section-blank-lines)) + (:filter-section . org-texinfo--filter-section-blank-lines) + (:filter-final-output . org-texinfo--untabify)) :menu-entry '(?i "Export to Texinfo" ((?t "As TEXI file" org-texinfo-export-to-texinfo) @@ -405,6 +406,10 @@ If two strings share the same prefix (e.g. \"ISO-8859-1\" and ;;; Internal Functions +(defun org-texinfo--untabify (s _backend _info) + "Remove TAB characters in string S." + (replace-regexp-in-string "\t" (make-string tab-width ?\s) s)) + (defun org-texinfo--filter-section-blank-lines (headline _backend _info) "Filter controlling number of blank lines after a section." (replace-regexp-in-string "\n\\(?:\n[ \t]*\\)*\\'" "\n\n" headline)) |