From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stephen Berman Newsgroups: gmane.emacs.help Subject: Re: Switching sets of variables Date: Thu, 04 Mar 2010 10:47:48 +0100 Message-ID: <87aauoo1tn.fsf@escher.home> References: <877hptq6p1.fsf@gmx.ch> <4B8F5EF0.9010901@easy-emacs.de> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: dough.gmane.org 1267696563 32277 80.91.229.12 (4 Mar 2010 09:56:03 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 4 Mar 2010 09:56:03 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Mar 04 10:55:58 2010 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Nn7mY-0003tQ-Pe for geh-help-gnu-emacs@m.gmane.org; Thu, 04 Mar 2010 10:55:51 +0100 Original-Received: from localhost ([127.0.0.1]:50034 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Nn7iR-0002qI-8L for geh-help-gnu-emacs@m.gmane.org; Thu, 04 Mar 2010 04:51:35 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Nn7f4-0008Tg-1F for help-gnu-emacs@gnu.org; Thu, 04 Mar 2010 04:48:06 -0500 Original-Received: from [140.186.70.92] (port=48124 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Nn7f2-0008TC-UU for help-gnu-emacs@gnu.org; Thu, 04 Mar 2010 04:48:05 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1Nn7f2-0000It-1M for help-gnu-emacs@gnu.org; Thu, 04 Mar 2010 04:48:05 -0500 Original-Received: from lo.gmane.org ([80.91.229.12]:45643) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Nn7f1-0000IW-PI for help-gnu-emacs@gnu.org; Thu, 04 Mar 2010 04:48:03 -0500 Original-Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1Nn7ez-0008Rk-U6 for help-gnu-emacs@gnu.org; Thu, 04 Mar 2010 10:48:01 +0100 Original-Received: from i59f54a9a.versanet.de ([89.245.74.154]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 04 Mar 2010 10:48:01 +0100 Original-Received: from stephen.berman by i59f54a9a.versanet.de with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 04 Mar 2010 10:48:01 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 56 Original-X-Complaints-To: usenet@dough.gmane.org X-Gmane-NNTP-Posting-Host: i59f54a9a.versanet.de User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.93 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:72358 Archived-At: On Thu, 04 Mar 2010 08:19:12 +0100 Andreas Röhler 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