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

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

Re: If arg, open in new frame


From: Rusi
Subject: Re: If arg, open in new frame
Date: Wed, 10 Sep 2014 20:28:09 -0700 (PDT)
User-agent: G2/1.0

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))))



reply via email to

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