From mboxrd@z Thu Jan 1 00:00:00 1970 From: Brett Viren Subject: Capture templates with "function" type Date: Sat, 26 Oct 2013 17:18:17 -0400 Message-ID: Mime-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha1; protocol="application/pgp-signature" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:36423) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VaBFz-00060D-V3 for emacs-orgmode@gnu.org; Sat, 26 Oct 2013 17:18:52 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VaBFt-00029b-Hh for emacs-orgmode@gnu.org; Sat, 26 Oct 2013 17:18:51 -0400 Received: from smtpgw.bnl.gov ([2620:10a:0:3::30]:59551 helo=iron4.sec.bnl.local) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VaBFt-00027v-Cr for emacs-orgmode@gnu.org; Sat, 26 Oct 2013 17:18:45 -0400 Received: from bviren by lycastus.phy.bnl.gov with local (Exim 4.80) (envelope-from ) id 1VaBFX-0008Rt-Bz for emacs-orgmode@gnu.org; Sat, 26 Oct 2013 17:18:23 -0400 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-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Hi, I'm trying to set up a capture template of type "function" in order to produce a daily log file named after today's date. It mostly works. However, after doing the C-cC-c to close the capture buffer the window is left holding the daily log file which the capture just updated instead of going back to whatever buffer I was in when I initiated the capture. This returning-to-previous-buffer behavior is what I see when I use the file+headline capture type. Can someone say how I might get this behavior for the "function" capture type as well? Here is my setup: (defun bv-daily-log-file () (find-file (concat "~/org/web/notes/"=20 (format-time-string "%Y-%m-%d") ".org")) (goto-char (point-max)) (newline 2) ) (setq org-capture-templates=20 (quote=20 ( ("n" "Note" entry (function bv-daily-log-file) "\* %U %^{title}\n %a\n\n%?" :empty-lines 1) ))) Thanks, =2DBrett. --=-=-= Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (GNU/Linux) iEYEARECAAYFAlJsMZoACgkQEixH2Z0dKCzm+QCeKCxEwG+pjJKCyDEnh5J4ZB3q KoAAn2pzPeoK1YUAt8IoDs4iE2TOgPHA =k3rR -----END PGP SIGNATURE----- --=-=-=--