From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric S Fraga Subject: Re: Clean capture from command line? Date: Wed, 17 Nov 2010 19:11:32 +0000 Message-ID: <87lj4r934r.fsf@ucl.ac.uk> References: <87eialkniq.fsf@ufl.edu> <20101117182453.GC16104@arendt.linode.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from [140.186.70.92] (port=49133 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PInQ6-0006IY-Jh for emacs-orgmode@gnu.org; Wed, 17 Nov 2010 14:11:53 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PInQ1-0000eo-TQ for emacs-orgmode@gnu.org; Wed, 17 Nov 2010 14:11:50 -0500 Received: from vscane-a2.ucl.ac.uk ([144.82.108.42]:61778) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PInQ1-0000eX-O3 for emacs-orgmode@gnu.org; Wed, 17 Nov 2010 14:11:45 -0500 In-Reply-To: <20101117182453.GC16104@arendt.linode.com> (tycho garen's message of "Wed, 17 Nov 2010 13:24:53 -0500") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: tycho garen Cc: emacs-orgmode@gnu.org tycho garen writes: >> One of the things I'd like to be able to do is capture a new TODO from a >> command line. e.g. > > I use the following code that I got from Jack Moffit > (http://www.metajack.im), that does more or less what you're looking > for, I think. Add the following block to your org configs. > > ;;;;;;;;;;;;;;;;;;;;;;;;;;;;; > > (defadvice capture-finalize (after delete-capture-frame activate) > "Advise capture-finalize to close the frame if it is the capture frame" > (if (equal "capture" (frame-parameter nil 'name)) > (delete-frame))) > > (defadvice capture-destroy (after delete-capture-frame activate) > "Advise capture-destroy to close the frame if it is the rememeber frame" > (if (equal "capture" (frame-parameter nil 'name)) > (delete-frame))) > > (defun make-capture-frame () > "Create a new frame and run org-capture." > (interactive) > (make-frame '((name . "capture"))) > (select-frame-by-name "capture") > (delete-other-windows) > (org-capture) > ) > > > ;;;;;;;;;;;;;;;;;;;;;;;;;;;;; > > Then call emacs as follows: > > emacsclient -n -e '(make-capture-frame)' Doesn't work for me, for some strange reason. I think you may have forgotten to say that the advices have to be activated? If so, I assume this would be done by: --8<---------------cut here---------------start------------->8--- (ad-activate 'capture-finalize) (ad-activate 'capture-destroy) --8<---------------cut here---------------end--------------->8--- But, in any case, this doesn't seem to make any difference in my case. The capture process itself works. I get my menu of templates just fine. Org captures the information when it should, i.e. if I finish normally (C-c C-c), and ignores it if I abort (C-c C-k). In either case, the frame, named "capture", remains. Hitting my "delete-frame" button (the Windows menu key to the right of my spacebar -- had to use these keys for something) works just fine so the problem is not with the delete frame function. Any suggestions? There's no error of any form that I can see. -- : Eric S Fraga (GnuPG: 0xC89193D8FFFCF67D) in Emacs 23.2.1 : using Org-mode version 7.3 (release_7.3.86.gb3d6f)