emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[O] reliably using org-capture with table-line


From: Brad Knotwell
Subject: [O] reliably using org-capture with table-line
Date: Mon, 9 Apr 2018 18:03:28 +0000 (UTC)

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

reply via email to

[Prev in Thread] Current Thread [Next in Thread]