forked from mirrors/org-mode
ox-ascii: Ignore empty lines between comments
* lisp/ox-ascii.el (ascii): Add new filter. (org-ascii-filter-comment-spacing): New function.
This commit is contained in:
parent
3a0e559ad9
commit
3b3b6fa836
|
@ -127,7 +127,8 @@
|
||||||
(lambda (a s v b)
|
(lambda (a s v b)
|
||||||
(org-ascii-export-to-ascii a s v b '(:ascii-charset utf-8))))))
|
(org-ascii-export-to-ascii a s v b '(:ascii-charset utf-8))))))
|
||||||
:filters-alist ((:filter-headline . org-ascii-filter-headline-blank-lines)
|
:filters-alist ((:filter-headline . org-ascii-filter-headline-blank-lines)
|
||||||
(:filter-parse-tree . org-ascii-filter-paragraph-spacing)
|
(:filter-parse-tree org-ascii-filter-paragraph-spacing
|
||||||
|
org-ascii-filter-comment-spacing)
|
||||||
(:filter-section . org-ascii-filter-headline-blank-lines))
|
(:filter-section . org-ascii-filter-headline-blank-lines))
|
||||||
:options-alist ((:ascii-charset nil nil org-ascii-charset)))
|
:options-alist ((:ascii-charset nil nil org-ascii-charset)))
|
||||||
|
|
||||||
|
@ -1791,8 +1792,7 @@ TREE is the parse tree. BACK-END is the symbol specifying
|
||||||
back-end used for export. INFO is a plist used as
|
back-end used for export. INFO is a plist used as
|
||||||
a communication channel.
|
a communication channel.
|
||||||
|
|
||||||
This function only applies to `ascii' back-end. See
|
See `org-ascii-paragraph-spacing' for information."
|
||||||
`org-ascii-paragraph-spacing' for information."
|
|
||||||
(when (wholenump org-ascii-paragraph-spacing)
|
(when (wholenump org-ascii-paragraph-spacing)
|
||||||
(org-element-map tree 'paragraph
|
(org-element-map tree 'paragraph
|
||||||
(lambda (p)
|
(lambda (p)
|
||||||
|
@ -1802,6 +1802,18 @@ This function only applies to `ascii' back-end. See
|
||||||
p :post-blank org-ascii-paragraph-spacing)))))
|
p :post-blank org-ascii-paragraph-spacing)))))
|
||||||
tree)
|
tree)
|
||||||
|
|
||||||
|
(defun org-ascii-filter-comment-spacing (tree backend info)
|
||||||
|
"Filter removing blank lines between comments.
|
||||||
|
TREE is the parse tree. BACK-END is the symbol specifying
|
||||||
|
back-end used for export. INFO is a plist used as
|
||||||
|
a communication channel."
|
||||||
|
(org-element-map tree '(comment comment-block)
|
||||||
|
(lambda (c)
|
||||||
|
(when (memq (org-element-type (org-export-get-next-element c info))
|
||||||
|
'(comment comment-block))
|
||||||
|
(org-element-put-property c :post-blank 0))))
|
||||||
|
tree)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
;;; End-user functions
|
;;; End-user functions
|
||||||
|
|
Loading…
Reference in New Issue