From mboxrd@z Thu Jan 1 00:00:00 1970 From: Josiah Schwab Subject: Re: Changing capture frame/window behavior depending on source Date: Mon, 16 Dec 2013 16:56:45 -0800 Message-ID: <87sitsjnw2.fsf@gmail.com> References: <87wqjhus0v.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:58879) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vsixw-0005lV-Fy for emacs-orgmode@gnu.org; Mon, 16 Dec 2013 19:56:53 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Vsixt-0005ES-4t for emacs-orgmode@gnu.org; Mon, 16 Dec 2013 19:56:52 -0500 Received: from mail-yh0-x22b.google.com ([2607:f8b0:4002:c01::22b]:59291) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vsixt-0005EH-0C for emacs-orgmode@gnu.org; Mon, 16 Dec 2013 19:56:49 -0500 Received: by mail-yh0-f43.google.com with SMTP id a41so4397731yho.2 for ; Mon, 16 Dec 2013 16:56:48 -0800 (PST) Received: from localhost ([2607:f140:400:b003:ad4:cff:fe0d:9f44]) by mx.google.com with ESMTPSA id m29sm21862203yho.14.2013.12.16.16.56.47 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 16 Dec 2013 16:56:47 -0800 (PST) In-reply-to: <87wqjhus0v.fsf@gmail.com> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-org list Josiah Schwab writes: > When I invoke the capture from my bookmark, I also want capture to be > the only window in the frame. I can make all captures act that way by > setting (add-hook 'org-capture-mode-hook 'delete-other-windows) > > But when I tried to have this part be source dependent with > > (defun jws/org-capture-initialize () > (if (jws/org-protocol-capture-p) 'delete-other-windows)) > > (add-hook 'org-capture-mode-hook 'jws/org-capture-initialize) > > it still gave me a frame with two windows, for reasons I don't > understand. I stepped through the code with edebug and confirmed that > jws/org-protocol-capture-p was evaluating to true. Just to follow up, in case someone searches for this thread, (defun jws/org-capture-initialize () (if (jws/org-protocol-capture-p) (delete-other-windows))) works fine. It helps to actually evaluate the function... Josiah