From mboxrd@z Thu Jan 1 00:00:00 1970 From: Alan Schmitt Subject: Re: run a function during capture Date: Tue, 24 Jan 2017 09:43:06 +0100 Message-ID: References: <87vat57ghi.fsf@gmail.com> Mime-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:55610) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cVwhL-0003et-6H for emacs-orgmode@gnu.org; Tue, 24 Jan 2017 03:43:31 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cVwhF-0006d6-8q for emacs-orgmode@gnu.org; Tue, 24 Jan 2017 03:43:27 -0500 Received: from mail2-relais-roc.national.inria.fr ([192.134.164.83]:7705) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1cVwhE-0006d0-Sq for emacs-orgmode@gnu.org; Tue, 24 Jan 2017 03:43:21 -0500 In-Reply-To: <87vat57ghi.fsf@gmail.com> (Nick Dokos's message of "Mon, 23 Jan 2017 13:56:09 -0500") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: "Emacs-orgmode" To: Nick Dokos Cc: emacs-orgmode@gnu.org --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 2017-01-23 13:56, Nick Dokos writes: > Alan Schmitt writes: > >> ... >> - I added a hook to org-capture-after-finalize-hook > ^^^^^ >> #+begin_src emacs-lisp >> (defun as/do-org-board-dl-hook () >> (when (equal (buffer-name) (concat "CAPTURE-" as/org-board-capture-f= ile)) >> (org-board-archive))) >> >> (add-hook 'org-capture-before-finalize-hook 'as/do-org-board-dl-hook) > ^^^^^^ >> #+end_src >> >> (Note: I mistakenly said that the "prepare" hook worked, but that would > ^^^^^^^ >> download the file even when cancelling, which was wrong) > > Make up your mind, will you? :-) As you can guess, I was testing as I was editing the message. As always, the code is the truth=E2=84=A2. For the record, here is what I discovered: =2D the prepare hook is run even when cancelling =2D the before hook is run with the buffer widened, but the point is still in the same position as when confirming pointer =2D when the after hook is run, I did not get access to the captured data (I may have done it wrong, but since the before hook worked, I did not look further) Best, Alan =2D-=20 OpenPGP Key ID : 040D0A3B4ED2E5C7 Monthly Athmospheric CO=E2=82=82, Mauna Loa Obs. 2016-12: 404.48, 2015-12: = 401.85 --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEcBAEBCgAGBQJYhxOaAAoJEAQNCjtO0uXHPXcH/3tA013VkQfJHzB0XyA3cGpu P9ld02L+SR1Gw867sXLzWaL+m+bhFE2XrvJTCkV5bybUB2CJWZZ9mhW79Me4eFD9 s30I0pIXkHImoSuaw65+ODQuYxXOcMhElbA/hBGvOAPfz50KWYwm49cpzim63OhD wxSYd8/asD75/WZGxwve9qVKt288SNKOijCo014aOPVadp7JP8rhVQ6WRv9K9xS/ XbwkvQOv0voqzRe0m2Hcj97KwGIcqiTm9XEAtzh7xqYHzUFYEIV2H6qxIlOTNzg3 D65byYLrLIU8d0iO0N27hPShmpCibIJo3BQKUdhphfebXIZ0zdM98KkGWZwTRQ4= =hfGI -----END PGP SIGNATURE----- --=-=-=--