From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Pascal J. Bourguignon" Newsgroups: gmane.emacs.help Subject: Re: If clause depending on name of the day Date: Tue, 03 Apr 2012 21:50:04 +0200 Organization: Informatimago Message-ID: <87fwcklhn7.fsf@kuiper.lan.informatimago.com> References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: dough.gmane.org 1333482920 21713 80.91.229.3 (3 Apr 2012 19:55:20 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Tue, 3 Apr 2012 19:55:20 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue Apr 03 21:55:17 2012 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1SF9ov-00028k-6u for geh-help-gnu-emacs@m.gmane.org; Tue, 03 Apr 2012 21:55:13 +0200 Original-Received: from localhost ([::1]:40936 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SF9ou-0003FF-JK for geh-help-gnu-emacs@m.gmane.org; Tue, 03 Apr 2012 15:55:12 -0400 Original-Path: usenet.stanford.edu!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 36 Original-X-Trace: individual.net eHFIFhdQJ04ADTUNWrsnEgMygk+qEc+soYgul3r2jAsNeu8vp6 Cancel-Lock: sha1:ZGMxODZjZjgwMzk3MTY5ZjExOTc1NDY1ZDFhYWUyN2UxN2JhMDA2NQ== sha1:6fMRJ2DYt3C2Cf3IyMLmN67hRY8= Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwAQMAAABtzGvEAAAABlBMVEUAAAD///+l2Z/dAAAA oElEQVR4nK3OsRHCMAwF0O8YQufUNIQRGIAja9CxSA55AxZgFO4coMgYrEDDQZWPIlNAjwq9 033pbOBPtbXuB6PKNBn5gZkhGa86Z4x2wE67O+06WxGD/HCOGR0deY3f9Ijwwt7rNGNf6Oac l/GuZTF1wFGKiYYHKSFAkjIo1b6sCYS1sVmFhhhahKQssRjRT90ITWUk6vvK3RsPGs+M1RuR mV+hO/VvFAAAAABJRU5ErkJggg== X-Accept-Language: fr, es, en User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.4 (gnu/linux) Original-Xref: usenet.stanford.edu gnu.emacs.help:191885 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:84299 Archived-At: "Sven Bretfeld" 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 {}.