all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* How to see that a variable holds t
@ 2010-01-03 17:11 Cecil Westerhof
  2010-01-03 19:25 ` Andreas Politz
                   ` (3 more replies)
  0 siblings, 4 replies; 13+ messages in thread
From: Cecil Westerhof @ 2010-01-03 17:11 UTC (permalink / raw)
  To: help-gnu-emacs

At the moment I have the following function:
    (defun switch-gnus-idle-daemon-do-log ()
      (interactive)
      (setq gnus-idle-daemon-do-log
            (case gnus-idle-daemon-do-log
              (10        t)
              (otherwise 10)))
      (message "gnus-idle-daemon-do-log: %s" gnus-idle-daemon-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;
    (defun switch-gnus-idle-daemon-do-log ()
      (interactive)
      (setq gnus-idle-daemon-do-log
            (case gnus-idle-daemon-do-log
              (t         10)
              (otherwise t)))
      (message "gnus-idle-daemon-do-log: %s" gnus-idle-daemon-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?

-- 
Cecil Westerhof
Senior Software Engineer
LinkedIn: http://www.linkedin.com/in/cecilwesterhof


^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2010-01-06 20:09 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-01-03 17:11 How to see that a variable holds t Cecil Westerhof
2010-01-03 19:25 ` Andreas Politz
2010-01-03 20:32 ` Lennart Borgman
2010-01-03 21:46 ` Tim X
     [not found] ` <87wrzysjty.fsf@hubble.informatimago.com>
2010-01-04  9:29   ` Cecil Westerhof
2010-01-04 16:44     ` Pascal J. Bourguignon
2010-01-04 17:11       ` Cecil Westerhof
2010-01-06 13:29   ` Cecil Westerhof
2010-01-06 18:12     ` Stefan Monnier
2010-01-06 18:30       ` Cecil Westerhof
2010-01-06 20:09         ` Pascal J. Bourguignon
2010-01-06 18:51     ` Pascal J. Bourguignon
2010-01-06 19:13       ` Cecil Westerhof

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.