Browse Source

export back-ends: Preserve subsequent blank lines when ignoring comments

* lisp/ox-latex.el (org-latex-property-drawer): Remove function.
* contrib/lisp/ox-groff.el (org-groff-property-drawer): Remove
  function.

This changes ensures that:

  paragraph
  # comment

  another paragraph

will be exported as:

  paragraph

  another paragraph

and not as:

  paragraph
  another paragraph

It only applies on back-end where empty lines are meaningful (e.g. not
html).
Nicolas Goaziou 12 years ago
parent
commit
61bf4a5c3f
6 changed files with 15 additions and 26 deletions
  1. 3 11
      contrib/lisp/ox-groff.el
  2. 2 0
      lisp/ox-ascii.el
  3. 3 12
      lisp/ox-latex.el
  4. 3 3
      lisp/ox-man.el
  5. 2 0
      lisp/ox-md.el
  6. 2 0
      lisp/ox-org.el

+ 3 - 11
contrib/lisp/ox-groff.el

@@ -49,6 +49,8 @@
    (center-block . org-groff-center-block)
    (clock . org-groff-clock)
    (code . org-groff-code)
+   (comment . (lambda (&rest args) ""))
+   (comment-block . (lambda (&rest args) ""))
    (drawer . org-groff-drawer)
    (dynamic-block . org-groff-dynamic-block)
    (entity . org-groff-entity)
@@ -71,7 +73,7 @@
    (plain-list . org-groff-plain-list)
    (plain-text . org-groff-plain-text)
    (planning . org-groff-planning)
-   (property-drawer . org-groff-property-drawer)
+   (property-drawer . (lambda (&rest args) ""))
    (quote-block . org-groff-quote-block)
    (quote-section . org-groff-quote-section)
    (radio-target . org-groff-radio-target)
@@ -1426,16 +1428,6 @@ information."
     "")
    ""))
 
-;;; Property Drawer
-
-(defun org-groff-property-drawer (property-drawer contents info)
-  "Transcode a PROPERTY-DRAWER element from Org to Groff.
-CONTENTS is nil.  INFO is a plist holding contextual
-information."
-  ;; The property drawer isn't exported but we want separating blank
-  ;; lines nonetheless.
-  "")
-
 ;;; Quote Block
 
 (defun org-groff-quote-block (quote-block contents info)

+ 2 - 0
lisp/ox-ascii.el

@@ -59,6 +59,8 @@
    (center-block . org-ascii-center-block)
    (clock . org-ascii-clock)
    (code . org-ascii-code)
+   (comment . (lambda (&rest args) ""))
+   (comment-block . (lambda (&rest args) ""))
    (drawer . org-ascii-drawer)
    (dynamic-block . org-ascii-dynamic-block)
    (entity . org-ascii-entity)

+ 3 - 12
lisp/ox-latex.el

@@ -113,6 +113,8 @@
    (center-block . org-latex-center-block)
    (clock . org-latex-clock)
    (code . org-latex-code)
+   (comment . (lambda (&rest args) ""))
+   (comment-block . (lambda (&rest args) ""))
    (drawer . org-latex-drawer)
    (dynamic-block . org-latex-dynamic-block)
    (entity . org-latex-entity)
@@ -137,7 +139,7 @@
    (plain-list . org-latex-plain-list)
    (plain-text . org-latex-plain-text)
    (planning . org-latex-planning)
-   (property-drawer . org-latex-property-drawer)
+   (property-drawer . (lambda (&rest args) ""))
    (quote-block . org-latex-quote-block)
    (quote-section . org-latex-quote-section)
    (radio-target . org-latex-radio-target)
@@ -2014,17 +2016,6 @@ information."
    "\\\\"))
 
 
-;;;; Property Drawer
-
-(defun org-latex-property-drawer (property-drawer contents info)
-  "Transcode a PROPERTY-DRAWER element from Org to LaTeX.
-CONTENTS is nil.  INFO is a plist holding contextual
-information."
-  ;; The property drawer isn't exported but we want separating blank
-  ;; lines nonetheless.
-  "")
-
-
 ;;;; Quote Block
 
 (defun org-latex-quote-block (quote-block contents info)

+ 3 - 3
lisp/ox-man.el

@@ -54,8 +54,8 @@
    (center-block . org-man-center-block)
    (clock . org-man-clock)
    (code . org-man-code)
-   (comment . org-man-comment)
-   (comment-block . org-man-comment-block)
+   (comment . (lambda (&rest args) ""))
+   (comment-block . (lambda (&rest args) ""))
    (drawer . org-man-drawer)
    (dynamic-block . org-man-dynamic-block)
    (entity . org-man-entity)
@@ -79,7 +79,7 @@
    (plain-list . org-man-plain-list)
    (plain-text . org-man-plain-text)
    (planning . org-man-planning)
-   (property-drawer . org-man-property-drawer)
+   (property-drawer . (lambda (&rest args) ""))
    (quote-block . org-man-quote-block)
    (quote-section . org-man-quote-section)
    (radio-target . org-man-radio-target)

+ 2 - 0
lisp/ox-md.el

@@ -68,6 +68,8 @@ This variable can be set to either `atx' or `setext'."
 	       (org-open-file (org-md-export-to-markdown nil s v)))))))
   :translate-alist ((bold . org-md-bold)
 		    (code . org-md-verbatim)
+		    (comment . (lambda (&rest args) ""))
+		    (comment-block . (lambda (&rest args) ""))
 		    (example-block . org-md-example-block)
 		    (fixed-width . org-md-example-block)
 		    (footnote-definition . ignore)

+ 2 - 0
lisp/ox-org.el

@@ -33,6 +33,8 @@
    (center-block . org-org-identity)
    (clock . org-org-identity)
    (code . org-org-identity)
+   (comment . (lambda (&rest args) ""))
+   (comment-block . (lambda (&rest args) ""))
    (diary-sexp . org-org-identity)
    (drawer . org-org-identity)
    (dynamic-block . org-org-identity)