From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jon Miller Subject: save-excursion not saving when I call org-capture-goto-last-stored Date: Sat, 4 Feb 2012 22:01:32 -0500 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Return-path: Received: from eggs.gnu.org ([140.186.70.92]:44738) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RtsMZ-0007Fn-Tg for emacs-orgmode@gnu.org; Sat, 04 Feb 2012 22:02:03 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RtsMV-0000rX-5v for emacs-orgmode@gnu.org; Sat, 04 Feb 2012 22:01:59 -0500 Received: from mail-we0-f169.google.com ([74.125.82.169]:61135) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RtsMU-0000o8-Oj for emacs-orgmode@gnu.org; Sat, 04 Feb 2012 22:01:54 -0500 Received: by wera13 with SMTP id a13so4611370wer.0 for ; Sat, 04 Feb 2012 19:01:52 -0800 (PST) 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: orgmode I'm currently trying to write a function to do some post-capture updates to an entry. My intention is to add it to org-capture-after-finalize-hook. First step is navigating to the captured item but I'd like to return to the current buffer I was in before. I'm still a novice with elisp, so I could use a pointer here. Here is a simplified example: M-: (save-excursion (org-capture-goto-last-stored)) Is there a better way to navigate to the last capture and then return to my current buffer? Thanks, Jon Miller ;; My current full version: (defun jsm/org-project-properties () "Takes the current heading title, denoting the project, and sets the :EXPORT_TITLE: and :CATEGORY: properties to the same." (interactive) (save-excursion (org-capture-goto-last-stored) ; Aka C-u C-u org-capture (let ((project-title (org-get-heading t t))) (org-set-property "EXPORT_TITLE" project-title) (org-set-property "CATEGORY" project-title))))