emacs-orgmode
[Top][All Lists]
Advanced

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

[Accepted] [Orgmode] Re: Clean capture from command line?


From: Carsten Dominik
Subject: [Accepted] [Orgmode] Re: Clean capture from command line?
Date: Sat, 27 Nov 2010 07:56:06 +0100 (CET)

Patch 390 (http://patchwork.newartisans.com/patch/390/) is now "Accepted".

Maintainer comment: No comment

This relates to the following submission:

http://mid.gmane.org/%3C874obebkqi.fsf%40ufl.edu%3E

Here is the original message containing the patch:

> Content-Type: text/plain; charset="utf-8"
> MIME-Version: 1.0
> Content-Transfer-Encoding: 7bit
> Subject: [Orgmode] Re: Clean capture from command line?
> Date: Thu, 18 Nov 2010 22:32:53 -0000
> From: Allen S. Rout <address@hidden>
> X-Patchwork-Id: 390
> Message-Id: <address@hidden>
> To: address@hidden
> 
> Friedrich Delgado <address@hidden> writes:
> 
> > 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);
> > `----
> 
> Woot, one step. 
> 
> Then I also did a quick filter.
> 
> ---
> use URI::Escape qw/ uri_escape uri_escape_utf8 /;
> use Cwd qw/getcwd abs_path/;
> 
> print uri_escape_utf8(<>);
> ---
> 
> At that point, I could do: 
> 
> ---
> 
> emacsclient  -c 
> org-protocol://capture:/I/file:`~/bin/uriescapepwd`/`~/bin/uriescapepwd`/`/usr/bin/zenity
>  --entry --text="New TODO" |~/bin/uriescape`
> 
> ----
> 
> The 'I' selects template, in which I'm using :immediate-finish.  That's
> one.
> 
> For the 'Close the client frame' purpose, I applied the attached patch,
> and then I could, in my own myorg.el file:
> 
> -----
> 
> ( defun asr-org-capture-finalize ()
>   "If we set the correct property in the capture template, then delete frame."
>   ( if (org-capture-get :asr-delete-frame-on-finalize)
>      (delete-frame)
>   )
> )
> 
> 
> (add-hook 'org-capture-after-finalize-hook 'asr-org-capture-finalize )
> 
> -----
> 
> 
> which lets me define a capture template with property
> 
> :asr-delete-frame-on-finalize 1
> 
> and then use that template.
> 
> Thanks, Eric and Friedrich... 
> 
> 
> - Allen S. Rout
> 
> >From 2086fe4be30d5383b9db4d5db91da6b03357c128 Mon Sep 17 00:00:00 2001
> From: Allen S. Rout <address@hidden>
> Date: Wed, 17 Nov 2010 12:52:02 -0500
> Subject: [PATCH 3/3] Add post-finalize hook
> 
> ---
>  lisp/org-capture.el |    8 ++++++++
>  1 files changed, 8 insertions(+), 0 deletions(-)
> 
> diff --git a/lisp/org-capture.el b/lisp/org-capture.el
> index 2abe5c7..5d2f8d3 100644
> --- a/lisp/org-capture.el
> +++ b/lisp/org-capture.el
> @@ -313,6 +313,12 @@ The remember buffer is still current when this hook 
> runs."
>    :group 'org-capture
>    :type 'hook)
>  
> +(defcustom org-capture-after-finalize-hook nil
> +  "Hook that is run right after a capture process is finalized.
> +  Suitable for window cleanup"
> +  :group 'org-capture
> +  :type 'hook)
> +
>  ;;; The property list for keeping information about the capture process
>  
>  (defvar org-capture-plist nil
> @@ -548,6 +554,8 @@ bypassed."
>  
>        ;; Restore the window configuration before capture
>        (set-window-configuration return-wconf))
> +
> +    (run-hooks 'org-capture-after-finalize-hook)
>      (when abort-note
>        (cond
>         ((equal abort-note 'clean)
> -- 
> 1.7.0.4
> 
> 



reply via email to

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