emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* reliably using org-capture with table-line
       [not found] <1778945075.862984.1523297008764.ref@mail.yahoo.com>
@ 2018-04-09 18:03 ` Brad Knotwell
  0 siblings, 0 replies; only message in thread
From: Brad Knotwell @ 2018-04-09 18:03 UTC (permalink / raw)
  To: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 1743 bytes --]

Good day all--

I just found the capture feature and I've set it up for a couple of things but I'm having trouble with table-line.  There is some pattern of usage that breaks it and (despite numerous trials) I can't find the magic that makes it work reliably.  I have a definition like the following (usecase:  add a row every time off request is approved):
("Tp" "PTO" table-line (file "~/notes/pto.org")    "| %(read-string \"Who: \") | %(org-read-date nil nil nil \"Start:\") | %(org-read-date nil nil nil \"End:\") |"    :kill-buffer t)
I'm trying to create a table like the following:

| *Who*   |    *Start* |      *End* ||---------+------------+------------||         |            |            || Larry    | 2018-04-12 | 2018-04-16 || Curly    | 2018-04-09 | 2018-04-13 || Moe | 2018-04-13 | 2018-04-20 |
It sort of works.  If I start without a table, it'll create the first row (sans headers) fine.  Likewise, I can add a rows to the table and that seems to be stable.  However, if I edit the file in some way, it's likely (not always as far as I can tell) that the next entry is written as a new single-row table which indicates org-capture.el:org-capture-place-table-line couldn't find the first table in the file.  Furthermore, when I save the capture, I'll get an error message "Capture process aborted, but target buffer could not be cleaned up correctly."
Finally, I've read the documentation for :table-line-pos numerous times and still don't know what it does.
Since the second table it added to the file, I can workaround this by hand-merging the two tables occasionally.
Now that I've described all this, my question:  how do others reliably use this feature?

Thx.
--Brad

[-- Attachment #2: Type: text/html, Size: 2427 bytes --]

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2018-04-09 18:03 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <1778945075.862984.1523297008764.ref@mail.yahoo.com>
2018-04-09 18:03 ` reliably using org-capture with table-line Brad Knotwell

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).