From mboxrd@z Thu Jan 1 00:00:00 1970 From: Zachary Young Subject: Re: Make a time-stamp non-interactively Date: Thu, 15 Apr 2010 09:33:01 -0700 Message-ID: References: <87d3y1h2nn.fsf@gollum.intra.norang.ca> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0236053088==" Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1O2S45-00073X-Ic for emacs-orgmode@gnu.org; Thu, 15 Apr 2010 12:37:18 -0400 Received: from [140.186.70.92] (port=50651 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1O2S1F-000696-Hx for emacs-orgmode@gnu.org; Thu, 15 Apr 2010 12:37:16 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1O2Rzy-0002JG-DI for emacs-orgmode@gnu.org; Thu, 15 Apr 2010 12:33:05 -0400 Received: from mail-qy0-f185.google.com ([209.85.221.185]:39394) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1O2Rzy-0002J7-7r for emacs-orgmode@gnu.org; Thu, 15 Apr 2010 12:33:02 -0400 Received: by qyk15 with SMTP id 15so1741983qyk.10 for ; Thu, 15 Apr 2010 09:33:01 -0700 (PDT) In-Reply-To: <87d3y1h2nn.fsf@gollum.intra.norang.ca> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Bernt Hansen Cc: emacs-orgmode@gnu.org --===============0236053088== Content-Type: multipart/alternative; boundary=0016362842fa5b32140484490c63 --0016362842fa5b32140484490c63 Content-Type: text/plain; charset=UTF-8 Hi Brent, Thank you very much for pointing that function out. I am still learning how to use apropos and just found about `C-u apropos' which shows that function when `apropos' did not. Anyway, much easier than my hack. Thank you, Zachary On Wed, Apr 14, 2010 at 7:26 PM, Bernt Hansen wrote: > Zachary Young 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 > --0016362842fa5b32140484490c63 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Hi Brent,

Thank you very much for pointing that function= out. I am still learning how to use apropos and just found about `C-u apro= pos' which shows that function when `apropos' did not.

Anyway, much easier than my hack.

T= hank you,
Zachary

On Wed, Apr 1= 4, 2010 at 7:26 PM, Bernt Hansen <bernt@norang.ca> wrote:
Zachary Y= oung <zacharysyoung@gmail.com= > writes:

> Hi all,
>
> I'm still new to elisp, so forgive me if I am missing something ob= vious...
>
> 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 functio= n 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 ()
=C2=A0(interactive)
=C2=A0(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

--0016362842fa5b32140484490c63-- --===============0236053088== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Emacs-orgmode mailing list Please use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode --===============0236053088==--