emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Brady Trainor <algebrat@uw.edu>
To: emacs-orgmode@gnu.org
Subject: My first union in an agenda block
Date: Tue, 22 Apr 2014 15:39:43 -0700	[thread overview]
Message-ID: <lj6r3f$mbs$1@ger.gmane.org> (raw)

I struggled to get union of cases in an agenda block. I was able to work 
from examples by Bernt Hansen at




and make the following small example, which may be useful to folks just 
getting into Org-mode and Emacs, and want to be aware of how you can 
combine cases into your agenda block. (Union as opposed to intersection, 
OR vs AND.)

It should be straightforward to make various cases, or even finally get 
familiar with the agenda filtering commands at


#+BEGIN_SRC emacs-lisp
(defun appts-nil-not-appt-next-headline ()
   (let ((next-headline (save-excursion (outline-next-heading))))
     (if (or ;; (string= "circus-act" (org-get-org-file))
             (string= "circus-act" (org-get-category))
             (member "appt" (org-get-tags-at))
             (member "plans" (org-get-tags-at))
             (member "social" (org-get-tags-at)))

(You may need this so that function org-add-agenda-custom-commands does 
not create error.)
#+BEGIN_SRC emacs-lisp
(require 'org-agenda)

#+BEGIN_SRC emacs-lisp
  '("c" "calendar"
    agenda ""
    ((org-agenda-skip-function 'appts-nil-not-appt-next-headline)

Please let me know if you see any changes I should make in my strategy 
or code. (I've not made it a priority, but I think I shouldn't have the 
three occurrences of `(member "<a tag>" (org-get-tags-at))'.)

Also, no telling when I'll get the chance to understand the examples at



                 reply	other threads:[~2014-04-22 22:40 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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:

  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='lj6r3f$mbs$1@ger.gmane.org' \
    --to=algebrat@uw.edu \
    --cc=emacs-orgmode@gnu.org \
    --subject='Re: My first union in an agenda block' \


* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Code repositories for project(s) associated with this inbox:


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