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

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

Re: If clause depending on name of the day


From: Pascal J. Bourguignon
Subject: Re: If clause depending on name of the day
Date: Tue, 03 Apr 2012 21:50:04 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.4 (gnu/linux)

"Sven Bretfeld" <address@hidden> writes:

> Is it possible to have an if-condition that looks for the current day?
> So that the then-expression does something different on Tuesday than on
> Friday? 
>
> This is not working:
>
>  (if (string-equal 'current-time-string ".*Tue.*")
>     (delete-other-windows)
>   (split-window-horizontally))

What Lars said.
Otherwise  you would have wanted:

   (require 'cl)

   (search "Tue" (current-time-string)) ; search a substring

or:

   (string-match "Tue" (current-time-string)) ; search a regexp.


> p.s. unnecessary to mention that I have only a weak knowledge of elisp.

          An Introduction to Programming in Emacs Lisp
          http://www.gnu.org/software/emacs/emacs-lisp-intro/
          (for non-programmers)

          Emacs Lisp Manual
          http://www.gnu.org/software/emacs/manual/elisp.html

-- 
__Pascal Bourguignon__                     http://www.informatimago.com/
A bad day in () is better than a good day in {}.


reply via email to

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