emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Friedrich Delgado <friedel@nomaden.org>
To: emacs-orgmode@gnu.org
Subject: Re: Clean capture from command line?
Date: Wed, 17 Nov 2010 00:35:31 +0100	[thread overview]
Message-ID: <20101116233531.GA7642@taupan.ath.cx> (raw)
In-Reply-To: <8739r0gb2c.fsf@ucl.ac.uk>

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 <f9>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 <f9>t to org-remember
  bindkey -s "\e[20~t" 'emacsclient org-protocol://remember://file:`uriescapepwd.pl`\n'
`----

(I'm old school.)

or even
,----
  # bind <f9>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 <friedel@nomaden.org>
                             TauPan on Ircnet and Freenode ;)

  reply	other threads:[~2010-11-16 23:35 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-16 20:43 Clean capture from command line? Allen S. Rout
2010-11-16 22:26 ` Eric S Fraga
2010-11-16 23:35   ` Friedrich Delgado [this message]
2010-11-18 17:32     ` Allen S. Rout
2010-11-27  6:56       ` [Accepted] " Carsten Dominik
2010-11-17 18:24 ` tycho garen
2010-11-17 19:11   ` Eric S Fraga
2010-11-18  2:18     ` Matt Lundin
2010-11-18  7:20       ` Eric S Fraga

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20101116233531.GA7642@taupan.ath.cx \
    --to=friedel@nomaden.org \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).