emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* how do I search state change dates?
@ 2019-01-01 19:16 Christopher W. Ryan
  2019-01-02 14:59 ` Eric S Fraga
  2019-01-02 19:24 ` Michael Welle
  0 siblings, 2 replies; 5+ messages in thread
From: Christopher W. Ryan @ 2019-01-01 19:16 UTC (permalink / raw)
  To: Org-mode mailing list

I try to keep track of books I want to read, and when I eventually read
them.  I use TODO keyword for books I intend to read, and I change the
state to READING and then DONE, as appropriate. Each state change gets a
date/time stamp.

My preamble is:

#+TODO: TODO(t!) READING(r!) POSTPONED(p!) RESTARTED(s!) | DONE(d!)
NA(n!) ABANDONED(a!)


An entry for a book not yet read might look like this:

** TODO America: the Farewell Tour
   :PROPERTIES:
   :AUTHORLNAME: Hedges
   :AUTHORFNAME: Chris
   :ISBN: 9781501152672
   :DATEADDED: <2018-10-10 Wed>
   :END:

An entry for a book I've read might look like this:

** DONE Northland
   - State "DONE"       from "READING"    [2018-10-21 Sun 22:45]
   - State "READING"    from "TODO"       [2018-10-08 Mon 22:09]
   :PROPERTIES:
   :AUTHORLNAME: Fox
   :AUTHORFNAME: Porter
   :ISBN: 9780393248852
   :DATEADDED: <2018-10-07 Sun>
   :END:


How can I retrieve all the entries for the books I've read in 2018? In
other words, all those that changed state to DONE in 2018?

Thanks.

--Chris Ryan

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

* Re: how do I search state change dates?
  2019-01-01 19:16 how do I search state change dates? Christopher W. Ryan
@ 2019-01-02 14:59 ` Eric S Fraga
  2019-01-02 19:24 ` Michael Welle
  1 sibling, 0 replies; 5+ messages in thread
From: Eric S Fraga @ 2019-01-02 14:59 UTC (permalink / raw)
  To: Christopher W. Ryan; +Cc: Org-mode mailing list

On Tuesday,  1 Jan 2019 at 14:16, Christopher W. Ryan wrote:
> I try to keep track of books I want to read, and when I eventually read
> them.  I use TODO keyword for books I intend to read, and I change the
> state to READING and then DONE, as appropriate. Each state change gets a
> date/time stamp.

[...]

> How can I retrieve all the entries for the books I've read in 2018? In
> other words, all those that changed state to DONE in 2018?

Well, a start would be to use the agenda view on that file and ask for a
full log view (v L in the default dispatcher).

Alternatively, remember that org files are simply text so you could use
"M-x occur RET" on your file with a suitable pattern.  This seems to
work for me:

- State "DONE".*\[2018

Of course, if your book entries are intermixed with other entries in the
same file, you may need to be a bit more creating (e.g. include
"READING" in your pattern).

-- 
Eric S Fraga via Emacs 27.0.50, Org release_9.1.14-1035-gfeb442

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

* Re: how do I search state change dates?
  2019-01-01 19:16 how do I search state change dates? Christopher W. Ryan
  2019-01-02 14:59 ` Eric S Fraga
@ 2019-01-02 19:24 ` Michael Welle
  2019-01-12 23:43   ` Christopher W. Ryan
  1 sibling, 1 reply; 5+ messages in thread
From: Michael Welle @ 2019-01-02 19:24 UTC (permalink / raw)
  To: emacs-orgmode

Hello,

"Christopher W. Ryan" <cryan@binghamton.edu> writes:

> I try to keep track of books I want to read, and when I eventually read
> them.  I use TODO keyword for books I intend to read, and I change the
> state to READING and then DONE, as appropriate. Each state change gets a
> date/time stamp.
at [0] you will find a bit of code (org-task-dump-logs.el) that
retrieves all the log data for a given task. Maybe that is helpful if
you extend it with a loop that iterates over all tasks of a file.

Regards
hmw

[0] https://www.c0t0d0s0.de/otdl/otdl.html

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

* Re: how do I search state change dates?
  2019-01-02 19:24 ` Michael Welle
@ 2019-01-12 23:43   ` Christopher W. Ryan
  2019-01-13  6:02     ` Michael Welle
  0 siblings, 1 reply; 5+ messages in thread
From: Christopher W. Ryan @ 2019-01-12 23:43 UTC (permalink / raw)
  To: Michael Welle, emacs-orgmode

This looks promising. However, the example at the link you referenced
seems to have its state changes inside a LOGBOOK property drawer. My
state changes are not inside a drawer. See excerpt below.  To change the
state, say from TODO to READING, I use C-c C-t and then can choose one
of my pre-specified states.  Should I put my state changes in a LOGBOOK
drawer? If so, how does that work?

** DONE Responsible Men		 :fiction:BUlibrary:
   - State "DONE"       from "READING"    [2018-11-18 Sun 23:17]
   - State "READING"    from "TODO"       [2018-11-04 Sun 23:17]
   :PROPERTIES:
   :AUTHORLNAME: Schwarzschild
   :AUTHORFNAME: Edward
   :ISBN: 156512409X
   :END:

Thanks.

--Chris Ryan

Michael Welle wrote:
> Hello,
> 
> "Christopher W. Ryan" <cryan@binghamton.edu> writes:
> 
>> I try to keep track of books I want to read, and when I eventually read
>> them.  I use TODO keyword for books I intend to read, and I change the
>> state to READING and then DONE, as appropriate. Each state change gets a
>> date/time stamp.
> at [0] you will find a bit of code (org-task-dump-logs.el) that
> retrieves all the log data for a given task. Maybe that is helpful if
> you extend it with a loop that iterates over all tasks of a file.
> 
> Regards
> hmw
> 
> [0] https://www.c0t0d0s0.de/otdl/otdl.html
> 

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

* Re: how do I search state change dates?
  2019-01-12 23:43   ` Christopher W. Ryan
@ 2019-01-13  6:02     ` Michael Welle
  0 siblings, 0 replies; 5+ messages in thread
From: Michael Welle @ 2019-01-13  6:02 UTC (permalink / raw)
  To: emacs-orgmode

Hello,

"Christopher W. Ryan" <cryan@binghamton.edu> writes:

> This looks promising. However, the example at the link you referenced
> seems to have its state changes inside a LOGBOOK property drawer. My
> state changes are not inside a drawer. See excerpt below.
the shown code should be able to deal with both situations, but it's not
much tested without drawers. It's just...


> To change the
> state, say from TODO to READING, I use C-c C-t and then can choose one
> of my pre-specified states.  Should I put my state changes in a LOGBOOK
> drawer? If so, how does that work?
... that using drawers is my personal preference. I think it looks
cleaner. I have tasks with pages full of state data. It's nice to be
able to fold the drawer and hide the data. The behaviour can be changed
by setting the variable org-log-into-drawer.

Regards
hmw

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

end of thread, other threads:[~2019-01-13  6:02 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-01-01 19:16 how do I search state change dates? Christopher W. Ryan
2019-01-02 14:59 ` Eric S Fraga
2019-01-02 19:24 ` Michael Welle
2019-01-12 23:43   ` Christopher W. Ryan
2019-01-13  6:02     ` Michael Welle

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