From mboxrd@z Thu Jan 1 00:00:00 1970 From: Bastien Subject: Re: Capture templates with "function" type Date: Tue, 05 Nov 2013 18:25:15 +0100 Message-ID: <87ppqe69s4.fsf@bzg.ath.cx> References: Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:60031) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VdkNY-00083b-M5 for emacs-orgmode@gnu.org; Tue, 05 Nov 2013 12:25:30 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VdkNT-0007NC-52 for emacs-orgmode@gnu.org; Tue, 05 Nov 2013 12:25:24 -0500 Received: from mail-wi0-x22f.google.com ([2a00:1450:400c:c05::22f]:33678) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VdkNS-0007Mt-UJ for emacs-orgmode@gnu.org; Tue, 05 Nov 2013 12:25:19 -0500 Received: by mail-wi0-f175.google.com with SMTP id hm4so2477520wib.2 for ; Tue, 05 Nov 2013 09:25:18 -0800 (PST) In-Reply-To: (Brett Viren's message of "Sat, 26 Oct 2013 17:18:17 -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: Brett Viren Cc: emacs-orgmode@gnu.org Hi Brett, Brett Viren writes: > (defun bv-daily-log-file () > (find-file (concat "~/org/web/notes/" > (format-time-string "%Y-%m-%d") ".org")) > (goto-char (point-max)) > (newline 2) > ) You may try this (not tested myself): (defun bv-daily-log-file () (save-window-excursion (find-file (concat "~/org/web/notes/" (format-time-string "%Y-%m-%d") ".org")) (goto-char (point-max)) (newline 2))) The trick is to use `save-window-excursion'. -- Bastien