help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Switching sets of variables


From: Stephen Berman
Subject: Re: Switching sets of variables
Date: Thu, 04 Mar 2010 10:47:48 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.93 (gnu/linux)

On Thu, 04 Mar 2010 08:19:12 +0100 Andreas Röhler 
<andreas.roehler@easy-emacs.de> wrote:

> Sven Bretfeld wrote:
>> Hi to all
>> 
>> I want to have two sets of different values for the same variables and
>> switch between these sets.
>> 
>> For example:
>> 
>> ,----First set: org-mode settings for my private context
>> |
>> |   (defvar org-gtd-file "~/private.org")
>> |   (setq org-todo-keywords '((type "NEXT" "WAITING" "APPT" "DONE")))
>> |   (setq org-tag-alist '(("OFFICE" . ?o)
>> |                      ("HOME" . ?h)
>> |                      ("READING" . ?r)
>> |                      ("SHOPPING" . ?s)))
>> `----
>> 
>> ,----Second set: org-mode settings for office organization
>> | 
>> |   (defvar org-gtd-file "~/institute.org")
>> |   (setq org-todo-keywords '((type "PRESENT" "HOLIDAY" "DELEGATED" "DONE")))
>> |   (setq org-tag-alist '(("ANNE" . ?a)
>> |                      ("MARY" . ?m)
>> |                      ("JOE" . ?j)
>> |                      ("FRED" . ?f)))
>> | 
>> `----
>> 
>> I want to have a function that switches between these sets. How could
>> that be done?
>> 
>> Thanks for help,
>> 
>> Sven
>> 
>> 
>> 
>
>
> Maybe define a variable, indicating the state
>
> (defvar privat-org nil
>   "If privat-org settings are active, otherwise institute-settings.")

Or just use org-gtd-file, since you already have it, e.g.:

(setq org-todo-keywords
      (cond ((string= org-gtd-file (expand-file-name "~/private.org"))
             '((type "NEXT" "WAITING" "APPT" "DONE")))
            ((string= org-gtd-file (expand-file-name "~/institute.org"))
             '((type "PRESENT" "HOLIDAY" "DELEGATED" "DONE")))))

Steve Berman





reply via email to

[Prev in Thread] Current Thread [Next in Thread]