From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Rusi Newsgroups: gmane.emacs.help Subject: Re: Possible to conditionally bind variable? Date: Thu, 11 Sep 2014 20:59:30 -0700 (PDT) Message-ID: References: <87lhpq8l8y.fsf@gmail.com> <87oaum5oql.fsf@geodiff-mac3.ulb.ac.be> <4297420c-f2f5-4675-bcc5-58742a253ef1@googlegroups.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 X-Trace: ger.gmane.org 1410494429 14380 80.91.229.3 (12 Sep 2014 04:00:29 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 12 Sep 2014 04:00:29 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Sep 12 06:00:22 2014 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 1XSI22-00087p-C7 for geh-help-gnu-emacs@m.gmane.org; Fri, 12 Sep 2014 06:00:22 +0200 Original-Received: from localhost ([::1]:42404 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XSI21-0004cd-OA for geh-help-gnu-emacs@m.gmane.org; Fri, 12 Sep 2014 00:00:21 -0400 X-Received: by 10.66.187.193 with SMTP id fu1mr2932740pac.45.1410494371637; Thu, 11 Sep 2014 20:59:31 -0700 (PDT) X-Received: by 10.50.134.3 with SMTP id pg3mr200241igb.4.1410494371536; Thu, 11 Sep 2014 20:59:31 -0700 (PDT) Original-Path: usenet.stanford.edu!r10no525601igi.0!news-out.google.com!ef6ni3693igb.0!nntp.google.com!h18no55779igc.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Original-Newsgroups: gnu.emacs.help In-Reply-To: <4297420c-f2f5-4675-bcc5-58742a253ef1@googlegroups.com> Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=59.95.9.169; posting-account=mBpa7woAAAAGLEWUUKpmbxm-Quu5D8ui Original-NNTP-Posting-Host: 59.95.9.169 User-Agent: G2/1.0 Injection-Date: Fri, 12 Sep 2014 03:59:31 +0000 Original-Xref: usenet.stanford.edu gnu.emacs.help:207568 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:99843 Archived-At: On Friday, September 12, 2014 9:25:46 AM UTC+5:30, Rusi wrote: > On Thursday, September 11, 2014 6:04:33 PM UTC+5:30, Stefan Monnier wrote: > > (defun go-or-make-agenda (&optional new-frame) > > (interactive "P") > > (let ((buffer "\*Org Agenda\*") > > (some-other-buffer "*scratch*")) > > (funcall (if new-frame 'switch-to-buffer-other-frame 'switch-to-buffer) > > (if (get-buffer buffer) buffer some-other-buffer)))) > Seeing this beautiful code, cant help making the remark: > This is called functional programming; guys like Stefan do it > guys like talk about it. that should have been "guys like me talk about it." :-)