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: If arg, open in new frame Date: Wed, 10 Sep 2014 20:28:09 -0700 (PDT) Message-ID: References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 X-Trace: ger.gmane.org 1410406225 20964 80.91.229.3 (11 Sep 2014 03:30:25 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 11 Sep 2014 03:30:25 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Sep 11 05:30:19 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 1XRv5O-00059L-AM for geh-help-gnu-emacs@m.gmane.org; Thu, 11 Sep 2014 05:30:18 +0200 Original-Received: from localhost ([::1]:59847 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XRv5N-0000hO-Rn for geh-help-gnu-emacs@m.gmane.org; Wed, 10 Sep 2014 23:30:17 -0400 X-Received: by 10.66.121.129 with SMTP id lk1mr12800404pab.16.1410406090063; Wed, 10 Sep 2014 20:28:10 -0700 (PDT) X-Received: by 10.50.134.3 with SMTP id pg3mr82506igb.4.1410406089962; Wed, 10 Sep 2014 20:28:09 -0700 (PDT) Original-Path: usenet.stanford.edu!h15no144028igd.0!news-out.google.com!ef6ni1747igb.0!nntp.google.com!h15no144019igd.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Original-Newsgroups: gnu.emacs.help In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=59.95.15.76; posting-account=mBpa7woAAAAGLEWUUKpmbxm-Quu5D8ui Original-NNTP-Posting-Host: 59.95.15.76 User-Agent: G2/1.0 Injection-Date: Thu, 11 Sep 2014 03:28:09 +0000 Original-Xref: usenet.stanford.edu gnu.emacs.help:207524 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:99799 Archived-At: On Wednesday, September 10, 2014 5:32:30 PM UTC+5:30, Tory S. Anderson wrote: > So, that half answered my question: thanks for showing me how to use optional args. My function is now: > (defun go-or-make-agenda (&optional new-frame) (interactive "P") > (let ((buffer "\*Org Agenda\*")) > (if (get-buffer buffer) > (switch-to-buffer buffer) > (org-agenda-list)))) Does this help? (defun go-or-make-agenda (&optional new-frame) (interactive "P") (let ((buffer "\*Org Agenda\*")) (if (get-buffer buffer) (if new-frame (switch-to-buffer-other-frame buffer) (switch-to-buffer buffer)) (org-agenda-list))))