emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* suggestion: automatically recording entry creation date
@ 2009-10-31  2:13 Ilya Shlyakhter
  2009-10-31  4:57 ` Bernt Hansen
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Ilya Shlyakhter @ 2009-10-31  2:13 UTC (permalink / raw)
  To: emacs-orgmode

A frequently-needed task is to find recently created entries.  Right
now I do this by manually pasting a date into each entry,
and using the timeline agenda.
Maybe, there are better ways?  E.g. have the option to automatically
record a property, "Creation-date", when an entry is created.
There would be much clutter if every entry had a :PROPERTIES: line.
But maybe there could be an option to hide the :PROPERTIES:
lines completely, unless it contained some user-defined properties.

Or, creation date could be stored as a text property, to avoid
clutter, for long-running emacs sessions.   But it would be lost when
the file is closed.
Maybe at file-closing time it could be converted to a normal property
in the :PROPERTIES: drawer.

Or maybe there are other options?

ilya

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

* Re: suggestion: automatically recording entry creation date
  2009-10-31  2:13 suggestion: automatically recording entry creation date Ilya Shlyakhter
@ 2009-10-31  4:57 ` Bernt Hansen
  2009-11-03  0:01 ` Adam Spiers
  2009-11-21 20:01 ` Jason Dunsmore
  2 siblings, 0 replies; 7+ messages in thread
From: Bernt Hansen @ 2009-10-31  4:57 UTC (permalink / raw)
  To: Ilya Shlyakhter; +Cc: emacs-orgmode

Ilya Shlyakhter <ilya_shl@alum.mit.edu> writes:

> A frequently-needed task is to find recently created entries.  Right
> now I do this by manually pasting a date into each entry,
> and using the timeline agenda.
> Maybe, there are better ways?  E.g. have the option to automatically
> record a property, "Creation-date", when an entry is created.
> There would be much clutter if every entry had a :PROPERTIES: line.
> But maybe there could be an option to hide the :PROPERTIES:
> lines completely, unless it contained some user-defined properties.
>
> Or, creation date could be stored as a text property, to avoid
> clutter, for long-running emacs sessions.   But it would be lost when
> the file is closed.
> Maybe at file-closing time it could be converted to a normal property
> in the :PROPERTIES: drawer.
>
> Or maybe there are other options?

I have a hook that adds creation date to a task as follows

(defun bh/insert-inactive-timestamp ()
  (interactive)
  (save-excursion
    (insert "\n")
    (org-cycle)
    (org-insert-time-stamp nil t t nil nil nil)))

(add-hook 'org-insert-heading-hook 'bh/insert-inactive-timestamp)

which makes new entries look like this when hitting 'S-RET New Entry'

* TODO New entry
  [2009-10-31 Sat 00:56]

This is an inactive timestamp which you can display on the agenda with [
or ].

HTH,
Bernt

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

* Re: suggestion: automatically recording entry creation date
  2009-10-31  2:13 suggestion: automatically recording entry creation date Ilya Shlyakhter
  2009-10-31  4:57 ` Bernt Hansen
@ 2009-11-03  0:01 ` Adam Spiers
  2009-11-03 12:24   ` Tim O'Callaghan
  2009-11-04 12:59   ` Adam Spiers
  2009-11-21 20:01 ` Jason Dunsmore
  2 siblings, 2 replies; 7+ messages in thread
From: Adam Spiers @ 2009-11-03  0:01 UTC (permalink / raw)
  To: emacs-orgmode

Ilya Shlyakhter (ilya_shl@alum.mit.edu) wrote:
> A frequently-needed task is to find recently created entries.  Right
> now I do this by manually pasting a date into each entry,
> and using the timeline agenda.
> Maybe, there are better ways?  E.g. have the option to automatically
> record a property, "Creation-date", when an entry is created.
> There would be much clutter if every entry had a :PROPERTIES: line.
> But maybe there could be an option to hide the :PROPERTIES:
> lines completely, unless it contained some user-defined properties.
> 
> Or, creation date could be stored as a text property, to avoid
> clutter, for long-running emacs sessions.   But it would be lost when
> the file is closed.
> Maybe at file-closing time it could be converted to a normal property
> in the :PROPERTIES: drawer.
> 
> Or maybe there are other options?

This would be useful to me too.  It would be valuable not just for
finding recently created ones, but for sorting any generated list of
entries by creation date.  This would for example make it easier to
ensure that entries don't get stale with age.

Bernt's approach is nice, but I agree that a completely clutter-free
solution (i.e. :PROPERTIES: drawers completely hidden by default)
would be extremely nice.

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

* Re: suggestion: automatically recording entry creation date
  2009-11-03  0:01 ` Adam Spiers
@ 2009-11-03 12:24   ` Tim O'Callaghan
  2009-11-04 12:59   ` Adam Spiers
  1 sibling, 0 replies; 7+ messages in thread
From: Tim O'Callaghan @ 2009-11-03 12:24 UTC (permalink / raw)
  To: emacs-orgmode

2009/11/3 Adam Spiers <orgmode@adamspiers.org>:
> Ilya Shlyakhter (ilya_shl@alum.mit.edu) wrote:
>> A frequently-needed task is to find recently created entries.  Right
>> now I do this by manually pasting a date into each entry,
>> and using the timeline agenda.
>> Maybe, there are better ways?  E.g. have the option to automatically
>> record a property, "Creation-date", when an entry is created.
>> There would be much clutter if every entry had a :PROPERTIES: line.
>> But maybe there could be an option to hide the :PROPERTIES:
>> lines completely, unless it contained some user-defined properties.
>>
>> Or, creation date could be stored as a text property, to avoid
>> clutter, for long-running emacs sessions.   But it would be lost when
>> the file is closed.
>> Maybe at file-closing time it could be converted to a normal property
>> in the :PROPERTIES: drawer.
>>
>> Or maybe there are other options?
>
> This would be useful to me too.  It would be valuable not just for
> finding recently created ones, but for sorting any generated list of
> entries by creation date.  This would for example make it easier to
> ensure that entries don't get stale with age.
>
> Bernt's approach is nice, but I agree that a completely clutter-free
> solution (i.e. :PROPERTIES: drawers completely hidden by default)
> would be extremely nice.
>

I have a :CREATED: LOGBOOK property set up in all of my remember templates:

("Task" ?t
         "* TODO %?\n:LOGBOOK:\n:CREATED:%U:\n:END:\n"
         "~/org/0_inbox.org" "TASKS")

Tim.

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

* Re: suggestion: automatically recording entry creation date
  2009-11-03  0:01 ` Adam Spiers
  2009-11-03 12:24   ` Tim O'Callaghan
@ 2009-11-04 12:59   ` Adam Spiers
  2009-11-20 20:21     ` Paul Holcomb
  1 sibling, 1 reply; 7+ messages in thread
From: Adam Spiers @ 2009-11-04 12:59 UTC (permalink / raw)
  To: emacs-orgmode

On Tue, Nov 03, 2009 at 12:01:42AM +0000, Adam Spiers wrote:
> This would be useful to me too.  It would be valuable not just for
> finding recently created ones, but for sorting any generated list of
> entries by creation date.  This would for example make it easier to
> ensure that entries don't get stale with age.

Doh - I just found contrib/lisp/org-expiry.el :-)

> Bernt's approach is nice, but I agree that a completely clutter-free
> solution (i.e. :PROPERTIES: drawers completely hidden by default)
> would be extremely nice.

I suspect this might be tricky to implement :-/

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

* Re: suggestion: automatically recording entry creation date
  2009-11-04 12:59   ` Adam Spiers
@ 2009-11-20 20:21     ` Paul Holcomb
  0 siblings, 0 replies; 7+ messages in thread
From: Paul Holcomb @ 2009-11-20 20:21 UTC (permalink / raw)
  To: emacs-orgmode

On Wed, Nov 04, 2009 at 12:59:19PM +0000, Adam Spiers wrote:
> > Bernt's approach is nice, but I agree that a completely clutter-free
> > solution (i.e. :PROPERTIES: drawers completely hidden by default)
> > would be extremely nice.
> 
> I suspect this might be tricky to implement :-/

 I ended up combining Bernt's and Tim's approaches.  The below adds a
 CREATED timestamp in both remember items and buffer-added items.

--
;; added "created" type
(setq org-log-note-headings
  '((done .  "CLOSING NOTE %t")
    (state . "State %-12s from %-12S %t")
    (note .  "Note taken on %t")
    (reschedule .  "Rescheduled from %S on %t")
    (redeadline .  "New deadline from %S on %t")
    (created .  "CREATED %t")
    (clock-out . "")))

;; for TODOs created in the buffer
(defun pah/insert-creation-date ()
  "Insert CREATED timestamp into logbook"
  (org-add-log-setup 'created nil nil 'findpos
		         'time))
(add-hook 'org-insert-heading-hook 'pah/insert-creation-date)

;; for remember
(setq org-remember-templates (quote (("todo" ?t "* TODO %?\n  :LOGBOOK:\n  - CREATED:%U\n  :END:\n" nil bottom  nil)
--			     

 Is there a way to get this function to work with remember as well?  I
 tried adding to org-remember-before-finalize-hook, but the marker is
 in a weird state at that point.

-- 
Paul Holcomb                               *pholcomb    \@      cpoint  net*
GPG key fingerprint          2B62 05AE EE74 845A 705F  D716 28C4 FE1C 088F CFAC

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

* Re: suggestion: automatically recording entry creation date
  2009-10-31  2:13 suggestion: automatically recording entry creation date Ilya Shlyakhter
  2009-10-31  4:57 ` Bernt Hansen
  2009-11-03  0:01 ` Adam Spiers
@ 2009-11-21 20:01 ` Jason Dunsmore
  2 siblings, 0 replies; 7+ messages in thread
From: Jason Dunsmore @ 2009-11-21 20:01 UTC (permalink / raw)
  To: Ilya Shlyakhter; +Cc: emacs-orgmode

Ilya Shlyakhter <ilya_shl@alum.mit.edu> writes:

> A frequently-needed task is to find recently created entries.  Right
> now I do this by manually pasting a date into each entry,
> and using the timeline agenda.
> Maybe, there are better ways?  E.g. have the option to automatically
> record a property, "Creation-date", when an entry is created.
> There would be much clutter if every entry had a :PROPERTIES: line.
> But maybe there could be an option to hide the :PROPERTIES:
> lines completely, unless it contained some user-defined properties.
>
> Or, creation date could be stored as a text property, to avoid
> clutter, for long-running emacs sessions.   But it would be lost when
> the file is closed.
> Maybe at file-closing time it could be converted to a normal property
> in the :PROPERTIES: drawer.
>
> Or maybe there are other options?

If you keep your org files in a git repo, you can use "git blame <file>"
to see when an entry was created.

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

end of thread, other threads:[~2009-11-21 20:01 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-10-31  2:13 suggestion: automatically recording entry creation date Ilya Shlyakhter
2009-10-31  4:57 ` Bernt Hansen
2009-11-03  0:01 ` Adam Spiers
2009-11-03 12:24   ` Tim O'Callaghan
2009-11-04 12:59   ` Adam Spiers
2009-11-20 20:21     ` Paul Holcomb
2009-11-21 20:01 ` Jason Dunsmore

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