From mboxrd@z Thu Jan 1 00:00:00 1970 From: asr@ufl.edu (Allen S. Rout) Subject: Re: Clean capture from command line? Date: Thu, 18 Nov 2010 12:32:53 -0500 Message-ID: <874obebkqi.fsf@ufl.edu> References: <87eialkniq.fsf@ufl.edu> <8739r0gb2c.fsf@ucl.ac.uk> <20101116233531.GA7642@taupan.ath.cx> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: Received: from [140.186.70.92] (port=51653 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PJ8Kj-0005jq-An for emacs-orgmode@gnu.org; Thu, 18 Nov 2010 12:31:42 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PJ8Kh-0004GA-Ul for emacs-orgmode@gnu.org; Thu, 18 Nov 2010 12:31:41 -0500 Received: from lo.gmane.org ([80.91.229.12]:58973) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PJ8Kh-0004Ft-Ht for emacs-orgmode@gnu.org; Thu, 18 Nov 2010 12:31:39 -0500 Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1PJ8Kf-00013z-Q7 for emacs-orgmode@gnu.org; Thu, 18 Nov 2010 18:31:37 +0100 Received: from n128-227-87-239.xlate.ufl.edu ([128.227.87.239]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 18 Nov 2010 18:31:37 +0100 Received: from asr by n128-227-87-239.xlate.ufl.edu with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 18 Nov 2010 18:31:37 +0100 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 --=-=-= Friedrich Delgado 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 --=-=-= Content-Type: text/x-diff Content-Disposition: attachment; filename=Add-post-finalize-hook.patch Content-Description: Add post-finalize hook >From 2086fe4be30d5383b9db4d5db91da6b03357c128 Mon Sep 17 00:00:00 2001 From: Allen S. Rout 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 --=-=-= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ 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 --=-=-=--