emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Make a time-stamp non-interactively
@ 2010-04-15  1:56 Zachary Young
  2010-04-15  2:19 ` Zachary Young
  2010-04-15  2:26 ` Bernt Hansen
  0 siblings, 2 replies; 4+ messages in thread
From: Zachary Young @ 2010-04-15  1:56 UTC (permalink / raw)
  To: emacs-orgmode


[-- Attachment #1.1: Type: text/plain, Size: 708 bytes --]

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

[-- Attachment #1.2: Type: text/html, Size: 869 bytes --]

[-- Attachment #2: Type: text/plain, Size: 201 bytes --]

_______________________________________________
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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Make a time-stamp non-interactively
  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
  1 sibling, 0 replies; 4+ messages in thread
From: Zachary Young @ 2010-04-15  2:19 UTC (permalink / raw)
  To: emacs-orgmode


[-- Attachment #1.1: Type: text/plain, Size: 1082 bytes --]

Hi all,

Sorry, I did some more digging right after I sent this, and found the
following in org-remember.el:

(ct (or org-overriding-default-time (org-current-time)))
(format-time-string (car org-time-stamp-formats) ct)

So, there it is.

Thank you,
Zachary

On Wed, Apr 14, 2010 at 6:56 PM, Zachary Young <zacharysyoung@gmail.com>wrote:

> 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
>

[-- Attachment #1.2: Type: text/html, Size: 1570 bytes --]

[-- Attachment #2: Type: text/plain, Size: 201 bytes --]

_______________________________________________
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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Make a time-stamp non-interactively
  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
  2010-04-15 16:33   ` Zachary Young
  1 sibling, 1 reply; 4+ messages in thread
From: Bernt Hansen @ 2010-04-15  2:26 UTC (permalink / raw)
  To: Zachary Young; +Cc: emacs-orgmode

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Make a time-stamp non-interactively
  2010-04-15  2:26 ` Bernt Hansen
@ 2010-04-15 16:33   ` Zachary Young
  0 siblings, 0 replies; 4+ messages in thread
From: Zachary Young @ 2010-04-15 16:33 UTC (permalink / raw)
  To: Bernt Hansen; +Cc: emacs-orgmode


[-- Attachment #1.1: Type: text/plain, Size: 1548 bytes --]

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 <bernt@norang.ca> wrote:

> 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
>

[-- Attachment #1.2: Type: text/html, Size: 2185 bytes --]

[-- Attachment #2: Type: text/plain, Size: 201 bytes --]

_______________________________________________
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

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2010-04-15 16:37 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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
2010-04-15 16:33   ` Zachary Young

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).