emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Diego Zamboni <diego@zzamboni.org>
To: Lawrence Bottorff <borgauf@gmail.com>
Cc: emacs-orgmode Mailinglist <emacs-orgmode@gnu.org>
Subject: Re: Insert PROPERTIES drawer after heading creation
Date: Wed, 11 Mar 2020 21:32:30 +0100	[thread overview]
Message-ID: <CAGY83Ec=iR5eB5TbVSZAaJCSqMAJ7gdkE5a2nGtQ_WB5pdTo0A@mail.gmail.com> (raw)
In-Reply-To: <CAFAhFSUKFtgMwfhF4x_5pmUOvvJkSwWxcwfzVhfijEhJvp3TcA@mail.gmail.com>

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

Hi Lawrence,

On Wed, Mar 11, 2020 at 7:56 PM Lawrence Bottorff <borgauf@gmail.com> wrote:

> I read that too, but couldn't fathom what they meant. Still, I'm not sure
> what they mean by "prefix argument."
>

The prefix argument in this case is not so important as the OUTPUT-BUFFER
argument, which you were passing as =t=:

"If OUTPUT-BUFFER is not a buffer and not nil, insert the output in current
buffer after point leaving mark after it."

which is why the output is inserted in the buffer.

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
>

The first number is the return value of shell-command, which is (I think)
the position in the buffer at which the pointer was when the function was
evaluated (or something like this). Here's the output from two consecutive
executions in my *scratch* buffer:

(shell-command "uuidgen" t)
173
5E69575E-2807-40BB-B1FE-10058D3C0666

(shell-command "uuidgen" t)
243
A7FD662E-A752-4E02-B4E0-A3E48CC7E7AB

The "173" happens to appear at point position 173 in the buffer, and same
for the 243 (you can verify this with "C-u C-x =").

Hope this helps!

--Diego

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

      reply	other threads:[~2020-03-11 20:32 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-11  4:39 Insert PROPERTIES drawer after heading creation Lawrence Bottorff
     [not found] ` <CAGY83EdJyQeFWu3zjZtnXos_10WExAzJi7wOS7rxk84W7MonqA@mail.gmail.com>
2020-03-11 13:14   ` Lawrence Bottorff
2020-03-11 15:37     ` Diego Zamboni
2020-03-11 18:56       ` Lawrence Bottorff
2020-03-11 20:32         ` Diego Zamboni [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAGY83Ec=iR5eB5TbVSZAaJCSqMAJ7gdkE5a2nGtQ_WB5pdTo0A@mail.gmail.com' \
    --to=diego@zzamboni.org \
    --cc=borgauf@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).