emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* agenda view help - viewing all time entries for a tag
@ 2018-10-26 12:55 Jeff Filipovits
  2019-01-12 23:19 ` Kyle Meyer
  0 siblings, 1 reply; 2+ messages in thread
From: Jeff Filipovits @ 2018-10-26 12:55 UTC (permalink / raw)
  To: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 1474 bytes --]

Say I have a calendar file which is in the following format:

* description of deadline    :client1:
DEADLINE: <2018-10-28 Tue>

* a meeting :client1:
<2018-11-1 Thu 10:00>

 I would like to be able to view all headlines and time entries associated
with a particular tag, and to have that information visible in an agenda
buffer, and for the entries to appear in chronological order along with the
associated dates

If I do C-c a m [tag], the dates do not appear

Seems the best I can do to get dates associated with the headline and
appear in chronological order is C-c a a, then filter by tag, then M-x
org-agenda-year-view. This is ugly and slow. Say I filter for :client1: and
put into year view, it looks something like:

Tuesday 30 October 2018
   Deadline: description of deadline :client1:
Wednesday 31 October 2018 *[unnecessary date with no entry -- why is this
here?]*
Thursday 1 November 2018
   10:00....... a meeting :client1:

Is there something obvious I am missing? I just want something like the
above command, but without all of the dates shown that fall between time
entries. This way I can get a view of all deadlines associated with a
client, where those deadlines may exist months or even a year+ in advance
(i.e., I don't want to be limited to a year view).

Hope this makes sense. I am an orgmode newb. Was very excited at first but
the learning curve is really starting to hit me lately. It seems like this
should be relatively easy to accomplish.

[-- Attachment #2: Type: text/html, Size: 1995 bytes --]

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

* Re: agenda view help - viewing all time entries for a tag
  2018-10-26 12:55 agenda view help - viewing all time entries for a tag Jeff Filipovits
@ 2019-01-12 23:19 ` Kyle Meyer
  0 siblings, 0 replies; 2+ messages in thread
From: Kyle Meyer @ 2019-01-12 23:19 UTC (permalink / raw)
  To: Jeff Filipovits, emacs-orgmode

[sorry for the slow response]

Jeff Filipovits <jrfilipovits@gmail.com> writes:

> Say I have a calendar file which is in the following format:
>
> * description of deadline    :client1:
> DEADLINE: <2018-10-28 Tue>
>
> * a meeting :client1:
> <2018-11-1 Thu 10:00>
>
>  I would like to be able to view all headlines and time entries associated
> with a particular tag, and to have that information visible in an agenda
> buffer, and for the entries to appear in chronological order along with the
> associated dates
>
> [...]
> 
> It seems like this should be relatively easy to accomplish.

Hmm, I might be missing something obvious, but here’s the best I can
come up with.

First, specify that you want the tag search to sort based on timestamp,
earliest first:

  (add-to-list 'org-agenda-sorting-strategy '(tags timestamp-up))

Then make a custom function that when called on a heading returns the
first timestamp:

  (defun my/org-get-first-timestamp ()
    (save-excursion
      (or (and (re-search-forward org-ts-regexp
                                  (save-excursion (outline-next-heading)
                                                  (point))
                                  t)
               (match-string 1))
          "")))

(Org might already have a function that would do that, but that seems to
work.)

Now use that function in the agenda prefix for tag searches:

  (add-to-list 'org-agenda-prefix-format '(tags . "%-21(my/org-get-first-timestamp) "))

With the example you gave---but changing 2018-11-1 to 2018-11-01 to make
a valid timestamp---‘C-c a m client1’ gives me:

  Headlines with TAGS match: client1
  Press ‘C-u r’ to search again
  2018-10-28 Tue        description of deadline                                          :client1:
  2018-11-01 Thu 10:00  a meeting                                                        :client1:

-- 
Kyle

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

end of thread, other threads:[~2019-01-12 23:34 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-10-26 12:55 agenda view help - viewing all time entries for a tag Jeff Filipovits
2019-01-12 23:19 ` Kyle Meyer

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