From mboxrd@z Thu Jan 1 00:00:00 1970 From: Carsten Dominik Subject: Re: Error when saving remember entries in non org-mode file types. Date: Thu, 18 Jun 2009 10:21:09 +0200 Message-ID: <9FDCE454-F2EA-4B52-9887-BBF3D0751B8E@gmail.com> References: Mime-Version: 1.0 (Apple Message framework v935.3) Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MHCsK-0005un-JH for emacs-orgmode@gnu.org; Thu, 18 Jun 2009 04:21:36 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MHCsF-0005rI-U7 for emacs-orgmode@gnu.org; Thu, 18 Jun 2009 04:21:36 -0400 Received: from [199.232.76.173] (port=51486 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MHCsF-0005r7-Ml for emacs-orgmode@gnu.org; Thu, 18 Jun 2009 04:21:31 -0400 Received: from mail-ew0-f210.google.com ([209.85.219.210]:45770) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MHCsF-0002kw-9t for emacs-orgmode@gnu.org; Thu, 18 Jun 2009 04:21:31 -0400 Received: by mail-ew0-f210.google.com with SMTP id 6so1196813ewy.42 for ; Thu, 18 Jun 2009 01:21:30 -0700 (PDT) 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: Jere McDevitt Cc: emacs-orgmode@gnu.org On Jun 17, 2009, at 1:25 AM, Jere McDevitt wrote: > Org-mode version: 6.27a > > I configured org-remember-templates to use a file named > "project.todo" to hold todo entries for me. > > (setq org-remember-templates > ("Project" ?p "* TODO %?\n %u" "~/org/project.todo" bottom ))) > > I hadn't added the .todo extension to the auto-mode-alist so when it > was loaded to be written to by the org-remember-handler, it came up > by default in fundamental-mode, not org-mode. > > This generates an error condition that I tracked down in the org- > remember.el file to line 887 in the org-remember-handler function: Yes, target files for remember templates must be in Org-mode. That does make sense normally, because your TODO tasks are Org nodes. I would simply recommend to actually use a .org extension. I you don't want to do that, instead of adding to auto-mode-alist, you can start the file with # -*- mode: org -*- HTH - Carsten > > ((not (org-mode-p)) > (if (eq heading 'top) > (goto-char (point-min)) > (goto-char (point-max)) > (or (bolp) (newline))) > (insert text-before-node-creation) > ....... > > > The error is that text-before-node-creation apparently is a nil and > the insert routine is generating an error because of it. This > variable is set earlier in the handler at around line 845 but only > if the text being inserted does not look like an org-outline-regexp: > > (unless (looking-at org-outline-regexp) > ;; add a headline > (setq text-before-node-creation (buffer-string)) > > Because my template actually does look like an org-outline-regexp > (it starts with "* TODO"), that variable is never set and because > the buffer is not in org-mode, this code is triggered using the text- > buffer-node-creation. > > The simple work around was to add .todo files to the auto-mode-alist > (or I could have changed the template), but I thought I would post a > note about it. > > Jere _______________________________________________ > Emacs-orgmode mailing list > Remember: use `Reply All' to send replies to the list. > Emacs-orgmode@gnu.org > http://lists.gnu.org/mailman/listinfo/emacs-orgmode