emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Query for tags, and bring results into headline?
@ 2011-05-12 14:29 Nathan Neff
  2011-05-16 17:07 ` Matt Lundin
  0 siblings, 1 reply; 6+ messages in thread
From: Nathan Neff @ 2011-05-12 14:29 UTC (permalink / raw)
  To: emacs-orgmode

I keep a lot of headlines tagged "question" that I
want to review before a daily meeting.

Currently I keep questions tagged with "question", and can
easily do an agenda search for them.  No problem.

Before a daily meeting, I create a daily meeting headline
like this:

* Daily Mtg 05/11/2011

Then, I do an agenda search for questions.

What I'm looking for is a way to query for
headlines tagged "question", and bring the results of that query into
the Daily Mtg 05/11/2011 headline -- preferably with
links to the questions to easily jump to them.

This way, I have a record that I asked certain questions,
and I can easily stay within my Daily Mtg headine, and not jump
to / from agenda and back to the daily mtg headline, which tends
to break my concentration.

Essentially, it would be a clock report, with links, except
it would not need to filter by any time/clocking information.

<Edit> I just found that I can copy the results of the agenda
into my headline, and simply surround the headings with [[ and ]], which
turns them into links.  This will work for the time being.

I suspect that another answer is a dynamic block.  Anyone
else doing something similar?

Thanks,
--Nate

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

* Re: Query for tags, and bring results into headline?
  2011-05-12 14:29 Query for tags, and bring results into headline? Nathan Neff
@ 2011-05-16 17:07 ` Matt Lundin
  2011-05-16 17:08   ` Matt Lundin
  0 siblings, 1 reply; 6+ messages in thread
From: Matt Lundin @ 2011-05-16 17:07 UTC (permalink / raw)
  To: Nathan Neff; +Cc: emacs-orgmode

Nathan Neff <nathan.neff@gmail.com> writes:

> I keep a lot of headlines tagged "question" that I
> want to review before a daily meeting.
>
> Currently I keep questions tagged with "question", and can
> easily do an agenda search for them.  No problem.
>
> Before a daily meeting, I create a daily meeting headline
> like this:
>
> * Daily Mtg 05/11/2011
>
> Then, I do an agenda search for questions.
>
> What I'm looking for is a way to query for
> headlines tagged "question", and bring the results of that query into
> the Daily Mtg 05/11/2011 headline -- preferably with
> links to the questions to easily jump to them.
>
> This way, I have a record that I asked certain questions,
> and I can easily stay within my Daily Mtg headine, and not jump
> to / from agenda and back to the daily mtg headline, which tends
> to break my concentration.
>
> Essentially, it would be a clock report, with links, except
> it would not need to filter by any time/clocking information.
>
> <Edit> I just found that I can copy the results of the agenda
> into my headline, and simply surround the headings with [[ and ]], which
> turns them into links.  This will work for the time being.
>
> I suspect that another answer is a dynamic block.  Anyone
> else doing something similar?

Here's one implementation:

--8<---------------cut here---------------start------------->8---
(defun org-dblock-write:insert-links (params)
  "Dblock function to insert links to headlines that match
tags/properties search string specified by :match."
  (let ((match (plist-get params :match))
	links)
    (unless match
      (error "Must specify :match parameter"))
    (org-map-entries 
     (lambda ()
       (let ((heading (nth 4 (org-heading-components))))
	 (add-to-list 'links
		      (format "- [[file:%s::*%s][%s]]\n"
			      (abbreviate-file-name
			       (buffer-file-name))
			      heading heading))))
     match 'agenda)
    (apply #'insert links)))
--8<---------------cut here---------------end--------------->8---

You could then create a dblock by typing C-c C-c on the following

#+begin: insert-links :match questions
#+end:

This would still need to be refined, as there are problems when a
headline contains a link, but it's meant to provide a quick proof of
concept.

Best,
Matt

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

* Re: Query for tags, and bring results into headline?
  2011-05-16 17:07 ` Matt Lundin
@ 2011-05-16 17:08   ` Matt Lundin
  2011-05-18 15:22     ` Nathan Neff
  0 siblings, 1 reply; 6+ messages in thread
From: Matt Lundin @ 2011-05-16 17:08 UTC (permalink / raw)
  To: Nathan Neff; +Cc: emacs-orgmode

Matt Lundin <mdl@imapmail.org> writes:

> You could then create a dblock by typing C-c C-c on the following
>
> #+begin: insert-links :match questions
> #+end:

Correction: this should be:

--8<---------------cut here---------------start------------->8---
#+begin: insert-links :match "questions"
#+end:
--8<---------------cut here---------------end--------------->8---

Best,
Matt

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

* Re: Query for tags, and bring results into headline?
  2011-05-16 17:08   ` Matt Lundin
@ 2011-05-18 15:22     ` Nathan Neff
  2011-05-18 17:37       ` Matt Lundin
  0 siblings, 1 reply; 6+ messages in thread
From: Nathan Neff @ 2011-05-18 15:22 UTC (permalink / raw)
  To: Matt Lundin; +Cc: emacs-orgmode

Thanks Matt!

If it's not too much trouble for you, may I ask how I would filter
out DONE, etc questions?

On Mon, May 16, 2011 at 12:08 PM, Matt Lundin <mdl@imapmail.org> wrote:
> Matt Lundin <mdl@imapmail.org> writes:
>
>> You could then create a dblock by typing C-c C-c on the following
>>
>> #+begin: insert-links :match questions
>> #+end:
>
> Correction: this should be:
>
> --8<---------------cut here---------------start------------->8---
> #+begin: insert-links :match "questions"
> #+end:
> --8<---------------cut here---------------end--------------->8---
>
> Best,
> Matt
>

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

* Re: Query for tags, and bring results into headline?
  2011-05-18 15:22     ` Nathan Neff
@ 2011-05-18 17:37       ` Matt Lundin
  2011-06-16  0:02         ` Nathan Neff
  0 siblings, 1 reply; 6+ messages in thread
From: Matt Lundin @ 2011-05-18 17:37 UTC (permalink / raw)
  To: Nathan Neff; +Cc: emacs-orgmode

Nathan Neff <nathan.neff@gmail.com> writes:

> Thanks Matt!
>
> If it's not too much trouble for you, may I ask how I would filter
> out DONE, etc questions?
>

Sure, no problem at all! 

#+begin: insert-links :match "questions/-DONE"

Or, if you want to filter out all inactive todos:

#+begin: insert-links :match "questions/!"

Best,
Matt

> On Mon, May 16, 2011 at 12:08 PM, Matt Lundin <mdl@imapmail.org> wrote:
>> Matt Lundin <mdl@imapmail.org> writes:
>>
>>> You could then create a dblock by typing C-c C-c on the following
>>>
>>> #+begin: insert-links :match questions
>>> #+end:
>>
>> Correction: this should be:
>>
>> --8<---------------cut here---------------start------------->8---
>> #+begin: insert-links :match "questions"
>> #+end:
>> --8<---------------cut here---------------end--------------->8---
>>
>> Best,
>> Matt
>>

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

* Re: Query for tags, and bring results into headline?
  2011-05-18 17:37       ` Matt Lundin
@ 2011-06-16  0:02         ` Nathan Neff
  0 siblings, 0 replies; 6+ messages in thread
From: Nathan Neff @ 2011-06-16  0:02 UTC (permalink / raw)
  To: Matt Lundin; +Cc: emacs-orgmode

On Wed, May 18, 2011 at 12:37 PM, Matt Lundin <mdl@imapmail.org> wrote:
> Nathan Neff <nathan.neff@gmail.com> writes:
>
>> Thanks Matt!
>>
>> If it's not too much trouble for you, may I ask how I would filter
>> out DONE, etc questions?
>>
>
> Sure, no problem at all!
>
> #+begin: insert-links :match "questions/-DONE"
>
> Or, if you want to filter out all inactive todos:
>
> #+begin: insert-links :match "questions/!"

This is cool.

Thanks!

--Nate

>
> Best,
> Matt
>
>> On Mon, May 16, 2011 at 12:08 PM, Matt Lundin <mdl@imapmail.org> wrote:
>>> Matt Lundin <mdl@imapmail.org> writes:
>>>
>>>> You could then create a dblock by typing C-c C-c on the following
>>>>
>>>> #+begin: insert-links :match questions
>>>> #+end:
>>>
>>> Correction: this should be:
>>>
>>> --8<---------------cut here---------------start------------->8---
>>> #+begin: insert-links :match "questions"
>>> #+end:
>>> --8<---------------cut here---------------end--------------->8---
>>>
>>> Best,
>>> Matt
>>>
>

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

end of thread, other threads:[~2011-06-16  0:02 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-05-12 14:29 Query for tags, and bring results into headline? Nathan Neff
2011-05-16 17:07 ` Matt Lundin
2011-05-16 17:08   ` Matt Lundin
2011-05-18 15:22     ` Nathan Neff
2011-05-18 17:37       ` Matt Lundin
2011-06-16  0:02         ` Nathan Neff

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