From: Bernt Hansen <bernt@norang.ca>
To: Zachary Young <zacharysyoung@gmail.com>
Cc: emacs-orgmode@gnu.org
Subject: Re: Make a time-stamp non-interactively
Date: Wed, 14 Apr 2010 22:26:20 -0400 [thread overview]
Message-ID: <87d3y1h2nn.fsf@gollum.intra.norang.ca> (raw)
In-Reply-To: <s2t91dc62521004141856s45a09332seaf34ef20c650eea@mail.gmail.com> (Zachary Young's message of "Wed\, 14 Apr 2010 18\:56\:10 -0700")
Zachary Young <zacharysyoung@gmail.com> writes:
> Hi all,
>
> I'm still new to elisp, so forgive me if I am missing something obvious...
>
> I would like to make an orgmode active time-stamp from within a custom function I am writing. I have
> looked at `org-time-stamp' but do not see a way to call this in a *non-interactive* fashion from my
> code. Inside `org-time-stamp' I was looking for a "core time-stamp function" that the interactive
> functions would call... but could not make one out. Is there a function already defined that when
> called will make a time-stamp with default values?
>
> If not, can someone point out the lines of code inside `org-time-stamp' that I can duplicate in my
> own code?
>
> I would prefer not to have to make a macro.
>
> Thank you,
> Zachary
Hi Zachary,
You probably want something like org-insert-time-stamp.
I use this to insert inactive timestamps in buffers like this:
(defun bh/insert-inactive-timestamp ()
(interactive)
(org-insert-time-stamp nil t t nil nil nil))
If you change the third parameter from t to nil it gives you active
timestamps.
See the docstring for more details.
HTH,
Bernt
next prev parent reply other threads:[~2010-04-15 2:26 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-04-15 1:56 Make a time-stamp non-interactively Zachary Young
2010-04-15 2:19 ` Zachary Young
2010-04-15 2:26 ` Bernt Hansen [this message]
2010-04-15 16:33 ` Zachary Young
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=87d3y1h2nn.fsf@gollum.intra.norang.ca \
--to=bernt@norang.ca \
--cc=emacs-orgmode@gnu.org \
--cc=zacharysyoung@gmail.com \
/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).