emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Dan Griswold <dgriswol@rochester.rr.com>
To: emacs-orgmode@gnu.org
Subject: Re: how to change the set of agenda org files between custom agenda commands
Date: Wed, 24 Sep 2008 22:54:49 -0400	[thread overview]
Message-ID: <87vdwlc4ue.fsf@cantor.griswold.home> (raw)
In-Reply-To: 48DAB052.1080102@diplan.de

Rainer Stengele <rainer.stengele@diplan.de> writes:

> Dan, thank you. I somehow does and doesn't.
> After using the command I get the "private" entries.
> After using another command analogous to this it seems I cannot reset
> the org-agenda-files variable. Looks like it only adds files to it?
> I played around a lot but could not get it to function as wanted.
>
> Anyway, the syntax is quite complex.
> I wonder if some more examples for changing agenda files when
> executing custom commands would be helpful.
> Anyone else who wants to see Agenden at home from different sets of
> agenda files?
>
> Rainer

Rainer,

I came across the variable org-finalize-agenda-hook, which is "run
just before displaying an agenda buffer."

So, maybe something like this in your configuration will work:

(defun rs-reset-agenda-files ()
  "Set org-agenda-files to my default values"
  (interactive)
  (setq org-agenda-files ; the following are examples, of course
	(quote
	 ("~/org/PUBLIK/work1.org"
	  "~/org/PUBLIK/work2.org"
	  "~/org/PUBLIK/work3.org"))))

(add-hook 'org-finalize-agenda-hook 'rs-reset-agenda-files)


What I think might then happen is that, after you run agenda custom
command kP, the variable org-agenda-files will be reset to the default
value.

Maybe?

Dan


-- 
--------------
Dan Griswold
Rochester, NY
--------------

  reply	other threads:[~2008-09-25  2:55 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-09-23 15:37 how to change the set of agenda org files between custom agenda commands Rainer Stengele
2008-09-23 23:16 ` Dan Griswold
2008-09-24 21:25   ` Rainer Stengele
2008-09-25  2:54     ` Dan Griswold [this message]
2008-09-25  3:32     ` Carsten Dominik
2008-09-25 12:00       ` Rainer Stengele

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=87vdwlc4ue.fsf@cantor.griswold.home \
    --to=dgriswol@rochester.rr.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).