From mboxrd@z Thu Jan 1 00:00:00 1970 From: Lawrence Bottorff Subject: Re: Insert PROPERTIES drawer after heading creation Date: Wed, 11 Mar 2020 13:56:11 -0500 Message-ID: References: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="000000000000e7eb5505a098ca8f" Return-path: Received: from eggs.gnu.org ([2001:470:142:3::10]:52051) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jC6Wo-0003HP-Gr for emacs-orgmode@gnu.org; Wed, 11 Mar 2020 14:56:27 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jC6Wn-0005P7-E6 for emacs-orgmode@gnu.org; Wed, 11 Mar 2020 14:56:26 -0400 Received: from mail-lf1-x135.google.com ([2a00:1450:4864:20::135]:42691) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jC6Wn-0005My-44 for emacs-orgmode@gnu.org; Wed, 11 Mar 2020 14:56:25 -0400 Received: by mail-lf1-x135.google.com with SMTP id t21so2630060lfe.9 for ; Wed, 11 Mar 2020 11:56:25 -0700 (PDT) In-Reply-To: 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-mx.org@gnu.org Sender: "Emacs-orgmode" To: Diego Zamboni Cc: emacs-orgmode Mailinglist --000000000000e7eb5505a098ca8f Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable I read that too, but couldn't fathom what they meant. Still, I'm not sure what they mean by "prefix argument." And why does (shell-command "uuidgen" t) produces two outputs? For other readers, this is what they look like in *scratch* (shell-command "uuidgen" t) 2827 b5da7e0a-84c0-4db8-91f3-871b681f3022 (org-id-uuid) "0bb7a4e1-9fc2-4428-b8de-a2d9ef5c56ab" Also, does anyone know how I could have done this by "advise"-ing a function in org-mode tempo templates? I could never figure out what function was actually handling the <...-TAB. On Wed, Mar 11, 2020 at 10:37 AM Diego Zamboni wrote: > > On Wed, Mar 11, 2020 at 2:14 PM Lawrence Bottorff > wrote: > >> Yes, thanks. That substring was a bad copy. Any insight why the >> (shell-command "uuidgen" t) wasn't working? >> > > I hadn't looked at it yet, but the documentation for =3Dshell-command=3D = gives > the answer: > > Execute string COMMAND in inferior shell; display output, if any. > With prefix argument, *insert the COMMAND=E2=80=99s output at point*. > > > So this function does not return a string that can be concatenated with > others, it actually inserts the output in the buffer, so it's not > guaranteed it will land where you need it. > > To have the output of the command returned as a string, I think you shoul= d > use =3Dshell-command-to-string=3D. > > --Diego > > --000000000000e7eb5505a098ca8f Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
I read that too, but couldn't fathom what they meant. = Still, I'm not sure what they mean by "prefix argument." And = why does (shell-command "uuidgen" t) produces two outputs? For ot= her readers, this is what they look like in *scratch*

(shell-command= "uuidgen" t)
2827
b5da7e0a-84c0-4db8-91f3-871b681f3022
=
(org-id-uuid)
"0bb7a4e1-9fc2-4428-b8de-a2d9ef5c56ab"
<= br>Also, does anyone know how I could have done this by "advise"-= ing a function in org-mode tempo templates? I could never figure out what f= unction was actually handling the <...-TAB.

On Wed, Mar 11, 202= 0 at 10:37 AM Diego Zamboni <diego= @zzamboni.org> wrote:

= On Wed, Mar 11, 2020 at 2:14 PM Lawrence Bottorff <borgauf@gmail.com> wrote:
Yes, th= anks. That substring was a bad copy. Any insight why the (shell-command &qu= ot;uuidgen" t) wasn't working?

I hadn't looked at it yet, but the documentation for =3Dshell-comman= d=3D gives the answer:

Execute string COMMAND in inferior shell; displ= ay output, if any.
With prefix argument, insert the COMMAND=E2=80=99s o= utput at point.

So this= function does not return a string that can be concatenated with others, it= actually inserts the output in the buffer, so it's not guaranteed it w= ill land where you need it.

To have the output of = the command returned as a string, I think you should use =3Dshell-command-t= o-string=3D.

--Diego

--000000000000e7eb5505a098ca8f--