From mboxrd@z Thu Jan 1 00:00:00 1970 From: Brad Knotwell Subject: reliably using org-capture with table-line Date: Mon, 9 Apr 2018 18:03:28 +0000 (UTC) Message-ID: <1778945075.862984.1523297008764@mail.yahoo.com> References: <1778945075.862984.1523297008764.ref@mail.yahoo.com> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_862983_1606019922.1523297008761" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:39099) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f5b8i-00016A-3c for emacs-orgmode@gnu.org; Mon, 09 Apr 2018 14:03:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1f5b8e-0002yA-UA for emacs-orgmode@gnu.org; Mon, 09 Apr 2018 14:03:36 -0400 Received: from sonic316-20.consmr.mail.ne1.yahoo.com ([66.163.187.146]:37504) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1f5b8e-0002xO-NJ for emacs-orgmode@gnu.org; Mon, 09 Apr 2018 14:03:32 -0400 List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: "Emacs-orgmode" To: emacs-orgmode@gnu.org ------=_Part_862983_1606019922.1523297008761 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable 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.=C2=A0 There is some pattern of usag= e that breaks it and (despite numerous trials) I can't find the magic that = makes it work reliably.=C2=A0 I have a definition like the following (useca= se:=C2=A0 add a row every time off request is approved): ("Tp" "PTO" table-line (file "~/notes/pto.org")=C2=A0 =C2=A0 "| %(read-stri= ng \"Who: \") | %(org-read-date nil nil nil \"Start:\") | %(org-read-date n= il nil nil \"End:\") |"=C2=A0 =C2=A0 :kill-buffer t) I'm trying to create a table like the following: | *Who*=C2=A0 =C2=A0|=C2=A0 =C2=A0 *Start* |=C2=A0 =C2=A0 =C2=A0 *End* ||--= -------+------------+------------||=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0|=C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 |=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 || Larry=C2=A0 =C2=A0 | 2018-04-12 | 2018-04-16 || Curly=C2=A0 =C2= =A0 | 2018-04-09 | 2018-04-13 || Moe | 2018-04-13 | 2018-04-20 | It sort of works.=C2=A0 If I start without a table, it'll create the first = row (sans headers) fine.=C2=A0 Likewise, I can add a rows to the table and = that seems to be stable.=C2=A0 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 a= s a new single-row table which indicates org-capture.el:org-capture-place-t= able-line couldn't find the first table in the file.=C2=A0 Furthermore, whe= n I save the capture, I'll get an error message "Capture process aborted, b= ut 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:=C2=A0 how do others reliably= use this feature? Thx. --Brad ------=_Part_862983_1606019922.1523297008761 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Good day all--
I just found the capture feature and I've set it up for a coupl= e of things but I'm having trouble with table-line.  There is some pat= tern 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 foll= owing (usecase:  add a row every time off request is approved):
<= div>
("Tp" "PTO" table-line (file "~/notes/pto.org= ")
    "| %(read-string \"Who: \") | %(org-read-date ni= l 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*= |
|---------+------------+------------|
|   =      |            |  &nb= sp;         |
| 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 t= he first row (sans headers) fine.  Likewise, I can add a rows to the t= able 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-captur= e-place-table-line couldn't find the first table in the file.  Further= more, when I save the capture, I'll get an error message "Capture process a= borted, but target buffer could not be cleaned up correctly."
Finally, I've read the documentation for :table-line-pos numero= us times and still don't know what it does.

Since = the second table it added to the file, I can workaround this by hand-mergin= g the two tables occasionally.

Now that I've descr= ibed all this, my question:  how do others reliably use this feature?<= /div>

Thx.

--B= rad
------=_Part_862983_1606019922.1523297008761--