From mboxrd@z Thu Jan 1 00:00:00 1970 From: James TD Smith Subject: Re: Setting org-remember-store-without-prompt specifically for certain templates? Date: Sun, 25 Oct 2009 17:10:50 +0000 Message-ID: <20091025171050.GX72276@yog-sothoth.mohorovi.cc> References: <4ADF4FBB.3070404@thompsonclan.org> <4adff270.100bca0a.327d.5f22@mx.google.com> <4ADFF344.4020102@thompsonclan.org> <8EF1E435-2FE9-4159-8E04-0CB806957587@gmail.com> <4AE36AE6.90905@thompsonclan.org> <642A5598-2B64-49BA-BE80-96E5714698B6@gmail.com> <4AE4291D.40103@thompsonclan.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1N26cP-0000Sc-0K for emacs-orgmode@gnu.org; Sun, 25 Oct 2009 13:11:01 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1N26cK-0000QL-JL for emacs-orgmode@gnu.org; Sun, 25 Oct 2009 13:11:00 -0400 Received: from [199.232.76.173] (port=56945 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1N26cK-0000QI-DC for emacs-orgmode@gnu.org; Sun, 25 Oct 2009 13:10:56 -0400 Received: from 81-86-40-42.dsl.pipex.com ([81.86.40.42]:50575 helo=yog-sothoth.mohorovi.cc) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1N26cJ-0001u6-F7 for emacs-orgmode@gnu.org; Sun, 25 Oct 2009 13:10:55 -0400 Content-Disposition: inline In-Reply-To: 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: Carsten Dominik Cc: org-mode Mailinglist , "Ryan C. Thompson" Hi Ryan and Carsten, On 2009-10-25 11:50:05(+0100), Carsten Dominik wrote: > On Oct 25, 2009, at 11:31 AM, Ryan C. Thompson wrote: > > My original idea for a per-template solution was to create a > > function to set buffer-local values of the appropriate variables in > > the rememebr buffer, and have that function return an empty string, > > and then put it inside a %(sexp) in the template itself. Should this > > work? Would buffer-local values take precedence when I press C-c C-c > > after finishing my note? > > > > My first few attempts were unsuccessful, but I'm not sure I got the > > code right. I suppose I should try manually setting buffer-local > > values and observing the effects. > > Well, yes you should try, it might work, something like this: > > %(progn (org-set-local 'org-remember-store-without-prompt nil) "") That isn't going to work. When org-remember-mode is turned on in the org-remember-apply-template , all local variables get cleared (there's a kill-all-local-variables in remember-mode), and embedded elisp is processed before this. Try adding this to your emacs: --8<---------------cut here---------------start------------->8--- (defun org-no-store-without-prompt () (org-set-local 'org-remember-store-without-prompt nil) (remove-hook 'post-command-hook 'org-no-store-without-prompt)) --8<---------------cut here---------------end--------------->8--- And putting %(progn (add-hook 'post-command-hook 'org-no-store-without-prompt) "") in your template. -- |---|