Browse Source

Export: Remove table rows that only contain width and alignment markers

The width and alignment in table columns can be set with a cookie like
"<10>" or "<r>" or "<r10>".  In order to keep Org from exporting such
lines, the first column of a line can contain only "/".  However, for
convenience, this commit implements a special case:  If the entire row
contains only sch markers, the line will automatically be discarded
during export.
Carsten Dominik 15 years ago
parent
commit
f88f4fc4fb
2 changed files with 3 additions and 3 deletions
  1. 1 1
      doc/org.texi
  2. 2 2
      lisp/org-exp.el

+ 1 - 1
doc/org.texi

@@ -2595,7 +2595,7 @@ All lines that should be recalculated should be marked with @samp{#}
 or @samp{*}.
 @item /
 Do not export this line.  Useful for lines that contain the narrowing
-@samp{<N>} markers.
+@samp{<N>} markers or column group markers.
 @end table
 
 Finally, just to whet your appetite for what can be done with the

+ 2 - 2
lisp/org-exp.el

@@ -1840,8 +1840,8 @@ When it is nil, all comments will be removed."
   (while (re-search-forward "^[ \t]*|" nil t)
     (beginning-of-line 1)
     (if (or (looking-at "[ \t]*| *[!_^] *|")
-	    (and (looking-at ".*?| *<[0-9]+> *|")
-		 (not (looking-at ".*?| *[^ <|]"))))
+	    (and (looking-at "[ \t]*|\\( *\\(<[0-9]+>\\|<[rl]>\\|<[rl][0-9]+>\\)? *|\\)+[ \t]*$")
+		 (not (looking-at ".*?| *[^ <|\n]"))))
 	(delete-region (max (point-min) (1- (point-at-bol)))
 		       (point-at-eol))
       (end-of-line 1))))