diff options
author | Carsten Dominik <carsten.dominik@gmail.com> | 2010-06-07 05:31:44 +0200 |
---|---|---|
committer | Carsten Dominik <carsten.dominik@gmail.com> | 2010-06-07 05:53:12 +0200 |
commit | 79b84116692a06af2f847d92d85fc98650b7e604 (patch) | |
tree | ac20d150ee628b26929dbfddd4e322246b731847 | |
parent | 28babd4dffde5949b2b668b0c9e2867d2ad55a70 (diff) | |
download | org-mode-79b84116692a06af2f847d92d85fc98650b7e604.tar.gz |
Fix bug with protected examples that look like table lines
* lisp/org-exp.el (org-export-remove-special-table-lines): Only fix table
lines that are not protected text.
Giovanni Moretti writes:
> I'm working up a presentation on orgmode for a local club and needed
> to prefix it with a brief emacs overview, and so included this:
>
> #+BEGIN_EXAMPLE
> ctrl-P (previous line)
> |
> |
> Ctrl-A <<< Ctrl-B <---- o ----> Ctrl-F >>> Ctrl-E
> Col 1 back char ! fwd char EOL
> !
> ctrl-N (next line)
> #+END_EXAMPLE
>
> : ctrl-P (previous line)
> : |
> : |
> : Ctrl-A <<< Ctrl-B <---- o ----> Ctrl-F >>> Ctrl-E
> : Col 1 back char | fwd char EOL
> : |
> : ctrl-N (next line)
>
> I'm using Orgmode v6.36c and when exporting to HTML (and LaTex
> Beamer), the two lines containing the single vertical bar immediately
> below the "ctrl-P" line in the #+EXAMPLE block vanish, whereas using
> the alternate colon at the beginning of the line notation, the
> rendering is as expected.
>
> Interestingly, enabling the +n option (#+BEGIN_EXAMPLE +n) causes the
> missing lines (lines 2 & 3) to reappear.
-rw-r--r-- | lisp/org-exp.el | 33 |
1 files changed, 17 insertions, 16 deletions
diff --git a/lisp/org-exp.el b/lisp/org-exp.el index 3003cf8..483d047 100644 --- a/lisp/org-exp.el +++ b/lisp/org-exp.el @@ -1668,22 +1668,23 @@ When it is nil, all comments will be removed." "Remove tables lines that are used for internal purposes." (goto-char (point-min)) (while (re-search-forward "^[ \t]*|" nil t) - (beginning-of-line 1) - (if (or (looking-at "[ \t]*| *[!_^] *|") - (not - (memq - nil - (mapcar - (lambda (f) - (or (= (length f) 0) - (string-match - "\\`<\\([0-9]\\|[rl]\\|[rl][0-9]+\\)>\\'" f))) - (org-split-string ;; FIXME, can't we do this without splitting??? - (buffer-substring (point-at-bol) (point-at-eol)) - "[ \t]*|[ \t]*"))))) - (delete-region (max (point-min) (1- (point-at-bol))) - (point-at-eol)) - (end-of-line 1)))) + (org-if-unprotected-at (1- (point)) + (beginning-of-line 1) + (if (or (looking-at "[ \t]*| *[!_^] *|") + (not + (memq + nil + (mapcar + (lambda (f) + (or (= (length f) 0) + (string-match + "\\`<\\([0-9]\\|[rl]\\|[rl][0-9]+\\)>\\'" f))) + (org-split-string ;; FIXME, can't we do without splitting??? + (buffer-substring (point-at-bol) (point-at-eol)) + "[ \t]*|[ \t]*"))))) + (delete-region (max (point-min) (1- (point-at-bol))) + (point-at-eol)) + (end-of-line 1))))) (defun org-export-protect-sub-super (s) (save-match-data |