Column view: Protect vertical bars in fields when capturing column view

Capturing column view creates an Org-mode table, where the field
values cannot have vertical bars.  These are now protected.
This commit is contained in:
Carsten Dominik 2009-06-18 17:25:03 +02:00
parent 23735614c5
commit 164678d549
4 changed files with 27 additions and 9 deletions

View File

@ -1,5 +1,13 @@
2009-06-18 Carsten Dominik <carsten.dominik@gmail.com>
* org-colview.el (org-columns-capture-view): Protect vertical bars
in column values.
* org-colview-xemacs.el (org-columns-capture-view): Protect
vertical bars in column values.
* org.el (org-quote-vert): New function.
* org-latex.el (org-export-latex-verbatim-wrap): New option.
* org-exp.el (org-export-format-source-code-or-example): Use

View File

@ -1282,11 +1282,13 @@ of fields."
(goto-char (match-beginning 0))
(setq row nil)
(loop for i from 0 to (1- n) do
(push (or (get-char-property (point)
'org-columns-value-modified)
(get-char-property (point) 'org-columns-value)
"")
row)
(push
(org-quote-vert
(or (get-char-property (point)
'org-columns-value-modified)
(get-char-property (point) 'org-columns-value)
""))
row)
(org-columns-forward-char))
(setq row (nreverse row))
(unless (and skip-empty-rows

View File

@ -1092,10 +1092,12 @@ of fields."
(get-char-property (match-beginning 0) 'org-columns-key))
(setq row nil)
(loop for i from 0 to (1- n) do
(push (or (get-char-property (+ (match-beginning 0) i) 'org-columns-value-modified)
(get-char-property (+ (match-beginning 0) i) 'org-columns-value)
"")
row))
(push
(org-quote-vert
(or (get-char-property (+ (match-beginning 0) i) 'org-columns-value-modified)
(get-char-property (+ (match-beginning 0) i) 'org-columns-value)
""))
row))
(setq row (nreverse row))
(unless (and skip-empty-rows
(eq 1 (length (delete "" (delete-dups (copy-sequence row))))))

View File

@ -15365,6 +15365,12 @@ and end of string."
list)))
(nreverse list)))
(defun org-quote-vert (s)
"Replace \"|\" with \"\\vert\"."
(while (string-match "|" s)
(setq s (replace-match "\\vert" t t s)))
s)
(defun org-uuidgen-p (s)
"Is S an ID created by UUIDGEN?"
(string-match "\\`[0-9a-f]\\{8\\}-[0-9a-f]\\{4\\}-[0-9a-f]\\{4\\}-[0-9a-f]\\{4\\}-[0-9a-f]\\{12\\}\\'" (downcase s)))