From mboxrd@z Thu Jan 1 00:00:00 1970 From: Friedrich Delgado Subject: Re: Clean capture from command line? Date: Wed, 17 Nov 2010 00:35:31 +0100 Message-ID: <20101116233531.GA7642@taupan.ath.cx> References: <87eialkniq.fsf@ufl.edu> <8739r0gb2c.fsf@ucl.ac.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from [140.186.70.92] (port=37784 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PIV3n-0003pz-JE for emacs-orgmode@gnu.org; Tue, 16 Nov 2010 18:35:36 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PIV3m-0004LU-62 for emacs-orgmode@gnu.org; Tue, 16 Nov 2010 18:35:35 -0500 Received: from dudelab.org ([212.12.33.202]:20706 helo=mail.dudelab.org) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PIV3l-0004LO-UY for emacs-orgmode@gnu.org; Tue, 16 Nov 2010 18:35:34 -0500 Received: from abrasax.taupan.ath.cx (p5DE8BF71.dip.t-dialin.net [93.232.191.113]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "Friedrich Delgado Friedrichs", Issuer "User CA" (not verified)) by mail.dudelab.org (Postfix) with ESMTP id 1D998228149 for ; Wed, 17 Nov 2010 00:35:32 +0100 (CET) Content-Disposition: inline In-Reply-To: <8739r0gb2c.fsf@ucl.ac.uk> 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: emacs-orgmode@gnu.org I use zsh and I already use this: ,----[ ~/bin/uriescapepwd.pl ] #!/usr/bin/perl -w use URI::Escape qw/ uri_escape uri_escape_utf8 /; use Cwd qw/getcwd abs_path/; $pwd = abs_path(getcwd); print uri_escape_utf8($pwd); `---- ,----[ .zshrc snippet ] # bind n to org-store-link bindkey -s "\e[20~n" 'emacsclient org-protocol://store-link://file:`uriescapepwd.pl`\n' `---- (I stole this from somewhere, can't remember where, possibly this list.) it should be easy to just do ,---- # bind t to org-remember bindkey -s "\e[20~t" 'emacsclient org-protocol://remember://file:`uriescapepwd.pl`\n' `---- (I'm old school.) or even ,---- # bind t to org-remember bindkey -s "\e[20~t" 'emacsclient org-protocol://capture://file:`uriescapepwd.pl`\n' `---- I didn't test this, since I very rarely even use the first binding. I'm pretty sure this must be possible with bash and other shells as well. Of course this leaves you in the emacsclient again, so you probably want to follow Eric's hints on top of that. Eric S Fraga schrieb: > asr@ufl.edu (Allen S. Rout) writes: > > One of the things I'd like to be able to do is capture a new TODO from a > > command line. e.g. > > > > shell$ capture "Fred wants a new database VM, 60G" > > > > and maybe eventually something obnoxious with e.g. zenity, so that a key > > chord popped up a text dialog which would just seamlessly get fed to > > org-capture. Basically, I want to make the notation and just keep > > sailing. Of course, I've got the relevant org files open in an emacs on > > another desktop: miles and miles away. :) The obvious solution > > > > shell$ emacsclient -c -e "(org-capture)" > > > > (and maybe a '-t', to keep it in the tty) > > > > has a problem: when I finish the capture, I'm left with the session, and > > worse, when I try to close the emacsclient, (C-x #) it tells me "No > > server buffers remain to edit", and I have to M-x delete-frame. > > Harshing my buzz, definitely. > > I tried the following: > > : $ emacsclient -t -e "(progn (org-capture) (delete-frame))" > > which /sort of/ works: it brings up capture, allows me to type in > various bits of the capture template (like headline and tags, if > requested) but then quits immediately (and deletes the frame) when org > is supposed to give me a chance to add to the entry I have created. > > So this is a halfway point to a solution to your problem maybe? > ---Zitatende--- -- Friedrich Delgado TauPan on Ircnet and Freenode ;)