emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: tycho garen <garen@tychoish.com>
To: emacs-orgmode@gnu.org
Subject: Re: Clean capture from command line?
Date: Wed, 17 Nov 2010 13:24:53 -0500	[thread overview]
Message-ID: <20101117182453.GC16104@arendt.linode.com> (raw)
In-Reply-To: <87eialkniq.fsf@ufl.edu>


[-- Attachment #1.1: Type: text/plain, Size: 1449 bytes --]

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

Even better than calling from the command line in my experience is
triggering directly from your window manager, or something like
quicksliver if you use OS X... 

I hope this is a start.... 

-- 
tycho(ish) @
 garen@tychoish.com
  http://www.tychoish.com/
  http://www.cyborginstitute.com/
  "don't get it right, get it written" -- james thurber

[-- Attachment #1.2: Type: application/pgp-signature, Size: 198 bytes --]

[-- Attachment #2: Type: text/plain, Size: 201 bytes --]

_______________________________________________
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode

  parent reply	other threads:[~2010-11-17 18:25 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
2010-11-18 17:32     ` Allen S. Rout
2010-11-27  6:56       ` [Accepted] " Carsten Dominik
2010-11-17 18:24 ` tycho garen [this message]
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=20101117182453.GC16104@arendt.linode.com \
    --to=garen@tychoish.com \
    --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).