Column view: Skip COMMENT and ARCHIVE trees when capturing
Proposal by Giovanni Ridolfi.
This commit is contained in:
parent
164678d549
commit
9d59bc0d29
|
@ -2,9 +2,11 @@
|
|||
|
||||
* org-colview.el (org-columns-capture-view): Protect vertical bars
|
||||
in column values.
|
||||
(org-columns-capture-view): Exclude comment and archived trees.
|
||||
|
||||
* org-colview-xemacs.el (org-columns-capture-view): Protect
|
||||
vertical bars in column values.
|
||||
(org-columns-capture-view): Exclude comment and archived trees.
|
||||
|
||||
* org.el (org-quote-vert): New function.
|
||||
|
||||
|
|
|
@ -1269,10 +1269,13 @@ of fields."
|
|||
(if (featurep 'xemacs)
|
||||
(save-excursion
|
||||
(let* ((title (mapcar 'cadr org-columns-current-fmt-compiled))
|
||||
(re-comment (concat "\\*+[ \t]+" org-comment-string "\\>"))
|
||||
(re-archive (concat ".*:" org-archive-tag ":"))
|
||||
(n (length title)) row tbl)
|
||||
(goto-char (point-min))
|
||||
|
||||
(while (re-search-forward "^\\(\\*+\\) " nil t)
|
||||
(catch 'next
|
||||
(when (and (or (null maxlevel)
|
||||
(>= maxlevel
|
||||
(if org-odd-levels-only
|
||||
|
@ -1280,6 +1283,12 @@ of fields."
|
|||
(length (match-string 1)))))
|
||||
(get-char-property (match-beginning 0) 'org-columns-key))
|
||||
(goto-char (match-beginning 0))
|
||||
(when (save-excursion
|
||||
(goto-char (point-at-bol))
|
||||
(or (looking-at re-comment)
|
||||
(looking-at re-archive)))
|
||||
(org-end-of-subtree t)
|
||||
(throw 'next t))
|
||||
(setq row nil)
|
||||
(loop for i from 0 to (1- n) do
|
||||
(push
|
||||
|
@ -1293,7 +1302,7 @@ of fields."
|
|||
(setq row (nreverse row))
|
||||
(unless (and skip-empty-rows
|
||||
(eq 1 (length (delete "" (delete-dups (copy-sequence row))))))
|
||||
(push row tbl))))
|
||||
(push row tbl)))))
|
||||
(append (list title 'hline) (nreverse tbl))))
|
||||
(save-excursion
|
||||
(let* ((title (mapcar 'cadr org-columns-current-fmt-compiled))
|
||||
|
|
|
@ -1081,15 +1081,24 @@ containing the title row and all other rows. Each row is a list
|
|||
of fields."
|
||||
(save-excursion
|
||||
(let* ((title (mapcar 'cadr org-columns-current-fmt-compiled))
|
||||
(re-comment (concat "\\*+[ \t]+" org-comment-string "\\>"))
|
||||
(re-archive (concat ".*:" org-archive-tag ":"))
|
||||
(n (length title)) row tbl)
|
||||
(goto-char (point-min))
|
||||
(while (re-search-forward "^\\(\\*+\\) " nil t)
|
||||
(catch 'next
|
||||
(when (and (or (null maxlevel)
|
||||
(>= maxlevel
|
||||
(if org-odd-levels-only
|
||||
(/ (1+ (length (match-string 1))) 2)
|
||||
(length (match-string 1)))))
|
||||
(get-char-property (match-beginning 0) 'org-columns-key))
|
||||
(when (save-excursion
|
||||
(goto-char (point-at-bol))
|
||||
(or (looking-at re-comment)
|
||||
(looking-at re-archive)))
|
||||
(org-end-of-subtree t)
|
||||
(throw 'next t))
|
||||
(setq row nil)
|
||||
(loop for i from 0 to (1- n) do
|
||||
(push
|
||||
|
@ -1101,7 +1110,7 @@ of fields."
|
|||
(setq row (nreverse row))
|
||||
(unless (and skip-empty-rows
|
||||
(eq 1 (length (delete "" (delete-dups (copy-sequence row))))))
|
||||
(push row tbl))))
|
||||
(push row tbl)))))
|
||||
(append (list title 'hline) (nreverse tbl)))))
|
||||
|
||||
(defun org-dblock-write:columnview (params)
|
||||
|
|
Loading…
Reference in New Issue