From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Lennart Borgman Newsgroups: gmane.emacs.help Subject: Re: How to see that a variable holds t Date: Sun, 3 Jan 2010 21:32:37 +0100 Message-ID: References: <87fx6ncdvc.fsf@Traian.DecebalComp> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1262550812 1185 80.91.229.12 (3 Jan 2010 20:33:32 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 3 Jan 2010 20:33:32 +0000 (UTC) Cc: help-gnu-emacs@gnu.org To: Cecil Westerhof Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sun Jan 03 21:33:24 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.50) id 1NRX8c-00076P-CT for geh-help-gnu-emacs@m.gmane.org; Sun, 03 Jan 2010 21:33:22 +0100 Original-Received: from localhost ([127.0.0.1]:33569 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NRX8c-0005ML-SB for geh-help-gnu-emacs@m.gmane.org; Sun, 03 Jan 2010 15:33:22 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NRX8G-0005Lx-1P for help-gnu-emacs@gnu.org; Sun, 03 Jan 2010 15:33:00 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NRX8E-0005Lb-M6 for help-gnu-emacs@gnu.org; Sun, 03 Jan 2010 15:32:59 -0500 Original-Received: from [199.232.76.173] (port=48896 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NRX8E-0005LY-Gu for help-gnu-emacs@gnu.org; Sun, 03 Jan 2010 15:32:58 -0500 Original-Received: from fg-out-1718.google.com ([72.14.220.153]:50542) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NRX8E-0008Js-GF for help-gnu-emacs@gnu.org; Sun, 03 Jan 2010 15:32:58 -0500 Original-Received: by fg-out-1718.google.com with SMTP id 16so1337750fgg.12 for ; Sun, 03 Jan 2010 12:32:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:cc:content-type :content-transfer-encoding; bh=+YNp8GAvHQYJxlmg/n/PQD6ZOEY2+hnkb97vpAfp47c=; b=dyVgQJ9kIRmk1i3L7UY9qzY7mrP42IUX7ohezvs1mKlSsH7Aa4deaDShbIkdOgfTo1 uRxEjtlLFveHVVw0bdpb1FbY0vL4R3Es7Rc719iDNqjvc10qGgNazWsBFSZN7EiBKyct 1pWC4gTfGYfuDr6rK3fp8VQ1uNq5s3sOZ1jFU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type:content-transfer-encoding; b=FPTqyH/ODtlFNTseL+K4m+5MbSWf0pcsrlt8AIRQcuxDxG+beh3F2VR1T1sIUEZKDs lr8ZWIVOzTfu5uVV8mkoYUgpEMqh5v6JuD2I4LyUIwOe4EiiX5ZPvJYMpreZB3L7RCNj 44Fh7t1U0Kp2FGxfNCgJ5SgmYAMR+PFx1aEo8= Original-Received: by 10.239.129.141 with SMTP id 13mr1547867hbf.118.1262550777165; Sun, 03 Jan 2010 12:32:57 -0800 (PST) In-Reply-To: <87fx6ncdvc.fsf@Traian.DecebalComp> X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) 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:71035 Archived-At: On Sun, Jan 3, 2010 at 6:11 PM, Cecil Westerhof wrote: > At the moment I have the following function: > =C2=A0 =C2=A0(defun switch-gnus-idle-daemon-do-log () > =C2=A0 =C2=A0 =C2=A0(interactive) > =C2=A0 =C2=A0 =C2=A0(setq gnus-idle-daemon-do-log > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(case gnus-idle-daemon-do-log > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(10 =C2=A0 =C2=A0 =C2=A0 = =C2=A0t) > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(otherwise 10))) > =C2=A0 =C2=A0 =C2=A0(message "gnus-idle-daemon-do-log: %s" gnus-idle-daem= on-do-log)) > > I know that it looks like overkill a case for switching to two values, > but I expect that in the future there will be more values. > > What I really would like is; > =C2=A0 =C2=A0(defun switch-gnus-idle-daemon-do-log () > =C2=A0 =C2=A0 =C2=A0(interactive) > =C2=A0 =C2=A0 =C2=A0(setq gnus-idle-daemon-do-log > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(case gnus-idle-daemon-do-log > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(t =C2=A0 =C2=A0 =C2=A0 = =C2=A0 10) > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(otherwise t))) > =C2=A0 =C2=A0 =C2=A0(message "gnus-idle-daemon-do-log: %s" gnus-idle-daem= on-do-log)) > > Because I would like the default to be t and not 10. (For when the value > is not one of the defined values.) But when I do this, it is always set > to 10, because the case does not make a difference between t and 10. How > do I solve this? Doesn't this work: (let ((T t)) (case T ((eq T t) (message "was t!")) (t (message "T=3D%S" T))))