emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Orgmode] Clean capture from command line?


From: tycho garen
Subject: Re: [Orgmode] Clean capture from command line?
Date: Wed, 17 Nov 2010 13:24:53 -0500
User-agent: Mutt/1.5.19 (2009-01-05)

> 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) @
 address@hidden
  http://www.tychoish.com/
  http://www.cyborginstitute.com/
  "don't get it right, get it written" -- james thurber

Attachment: pgp7BSgBHo5pt.pgp
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]