mirror of
https://git.savannah.gnu.org/git/emacs/org-mode.git
synced 2025-01-14 16:51:15 +00:00
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)
|
||||
(org-ascii-export-to-ascii a s v b '(:ascii-charset utf-8))))))
|
||||
: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))
|
||||
: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
|
||||
a communication channel.
|
||||
|
||||
This function only applies to `ascii' back-end. See
|
||||
`org-ascii-paragraph-spacing' for information."
|
||||
See `org-ascii-paragraph-spacing' for information."
|
||||
(when (wholenump org-ascii-paragraph-spacing)
|
||||
(org-element-map tree 'paragraph
|
||||
(lambda (p)
|
||||
@ -1802,6 +1802,18 @@ This function only applies to `ascii' back-end. See
|
||||
p :post-blank org-ascii-paragraph-spacing)))))
|
||||
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
|
||||
|
Loading…
Reference in New Issue
Block a user