emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: James TD Smith <ahktenzero@mohorovi.cc>
To: Carsten Dominik <carsten.dominik@gmail.com>
Cc: org-mode Mailinglist <emacs-orgmode@gnu.org>,
	"Ryan C. Thompson" <rct@thompsonclan.org>
Subject: Re: Setting org-remember-store-without-prompt specifically for certain templates?
Date: Sun, 25 Oct 2009 17:10:50 +0000	[thread overview]
Message-ID: <20091025171050.GX72276@yog-sothoth.mohorovi.cc> (raw)
In-Reply-To: <E4F52D56-3EEC-4CEA-88E5-DACCCF5CC905@gmail.com>

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.

--
|-<James TD Smith>-<email/ahktenzero@mohorovi.cc>-|

      reply	other threads:[~2009-10-25 17:11 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-10-21 18:15 Setting org-remember-store-without-prompt specifically for certain templates? Ryan C. Thompson
2009-10-22  5:49 ` Darlan Cavalcante Moreira
2009-10-22  5:53   ` Ryan C. Thompson
2009-10-24 12:15     ` Carsten Dominik
2009-10-24 21:00       ` Ryan C. Thompson
2009-10-25  8:11         ` Carsten Dominik
2009-10-25 10:31           ` Ryan C. Thompson
2009-10-25 10:50             ` Carsten Dominik
2009-10-25 17:10               ` James TD Smith [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20091025171050.GX72276@yog-sothoth.mohorovi.cc \
    --to=ahktenzero@mohorovi.cc \
    --cc=carsten.dominik@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=rct@thompsonclan.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).