all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Andreas Röhler" <andreas.roehler@easy-emacs.de>
To: help-gnu-emacs@gnu.org
Subject: Re: Switching sets of variables
Date: Thu, 04 Mar 2010 08:19:12 +0100	[thread overview]
Message-ID: <4B8F5EF0.9010901@easy-emacs.de> (raw)
In-Reply-To: <877hptq6p1.fsf@gmx.ch>

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

then some function setting the vars with setq as you have shown.

(defun my-toggle-var-sets ()
  (interactive)
  (if privat-org
      (my-institute-settings)
    (my-private-settings)))

Both forms should set `privat-org' respectivly.

Andreas

--
https://code.launchpad.net/~a-roehler/python-mode
https://code.launchpad.net/s-x-emacs-werkstatt/





  reply	other threads:[~2010-03-04  7:19 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-04  0:19 Switching sets of variables Sven Bretfeld
2010-03-04  7:19 ` Andreas Röhler [this message]
2010-03-04  9:47   ` Stephen Berman
2010-03-05  0:45     ` Sven Bretfeld
     [not found] <mailman.2244.1267661988.14305.help-gnu-emacs@gnu.org>
2010-03-04  1:11 ` Barry Margolin
2010-05-04 18:59   ` Drew Adams

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

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

  git send-email \
    --in-reply-to=4B8F5EF0.9010901@easy-emacs.de \
    --to=andreas.roehler@easy-emacs.de \
    --cc=help-gnu-emacs@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 external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.