emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Nathan Neff <nathan.neff@gmail.com>
To: emacs-orgmode <emacs-orgmode@gnu.org>
Subject: Create links to agenda commands
Date: Thu, 23 Aug 2012 21:46:19 -0500	[thread overview]
Message-ID: <CAC=HedBd7E6JrcTeLuJZc6PuVmp5nz=-Kc+TmYhGRDCnc=u2=Q@mail.gmail.com> (raw)

I just found out how to create links to execute custom agenda commands
and wanted to share it with the list for those that didn't know about
this feature.

Basically, I have a bunch of custom agenda commands that I *want* to
run periodically and it would be great to be able to create a link that I can
click on, instead of remembering to press a sequence of characters
(I'm just lazy that way).

For example:

* todo Check "waiting" tasks
  - Cilck Here to see Waiting Tasks

---------------------------
Here's how I did it:

First, here's an example of two custom views that I have defined for my agenda.

(setq org-agenda-custom-commands
  (quote (
    ("w" "Tasks waiting on something" todo "waiting"
((org-use-tag-inheritance nil)))
    ("p" "Projects" tags "project")
)))

To run these views, I need to run org-agenda, then press "w" or "p", but I want
to create a *Link* to run these commands that I can click on.

So in some .org file, I have these links:

* Links to these common agenda Views                                :project:

- [[elisp:(org-agenda nil "w")][Show Waiting Tasks]]
- [[elisp:(org-agenda nil "p")][Show Projects]]


That's it!  Just create the links like above, and then click on them
and Emacs will ask you if you want to run the elisp, and when you say
"Yes", then the
appropriate custom agenda views will be shown.

Try it out with a heading like this in one of your org-agenda-files

* Project 1                                                         :project:
** todo task 1
** todo task 2

I think it's a really cool feature and wanted to show it to others who
didn't know about it.

--Nate

             reply	other threads:[~2012-08-24  2:46 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-24  2:46 Nathan Neff [this message]
2012-08-24 11:55 ` Create links to agenda commands Bastien
2012-08-24 14:41 ` Suvayu Ali
2012-08-24 14:54   ` Bastien
2012-08-24 15:20     ` Suvayu Ali
2012-08-24 15:39       ` Bastien

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAC=HedBd7E6JrcTeLuJZc6PuVmp5nz=-Kc+TmYhGRDCnc=u2=Q@mail.gmail.com' \
    --to=nathan.neff@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).