From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jere McDevitt Subject: Error when saving remember entries in non org-mode file types. Date: Tue, 16 Jun 2009 19:25:45 -0400 Message-ID: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0388158401==" Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MGi2J-0005qo-Ip for emacs-orgmode@gnu.org; Tue, 16 Jun 2009 19:25:51 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MGi2F-0005qD-8J for emacs-orgmode@gnu.org; Tue, 16 Jun 2009 19:25:51 -0400 Received: from [199.232.76.173] (port=34087 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MGi2E-0005qA-U3 for emacs-orgmode@gnu.org; Tue, 16 Jun 2009 19:25:46 -0400 Received: from mail-fx0-f206.google.com ([209.85.220.206]:64199) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MGi2E-0004SH-FE for emacs-orgmode@gnu.org; Tue, 16 Jun 2009 19:25:46 -0400 Received: by fxm2 with SMTP id 2so265252fxm.42 for ; Tue, 16 Jun 2009 16:25:45 -0700 (PDT) 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: emacs-orgmode@gnu.org --===============0388158401== Content-Type: multipart/alternative; boundary=0016e6dd8e74751ab4046c7f7eab --0016e6dd8e74751ab4046c7f7eab Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit 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: ((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 --0016e6dd8e74751ab4046c7f7eab Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Org-mode version: 6.27a

I configured org-remember-templates to use a= file named "project.todo" to hold todo entries for me.=A0
(setq org-remember-templates
=A0=A0=A0=A0=A0=A0=A0 ("Project&quo= t; ?p "* TODO %?\n %u"=A0 "~/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 erro= r condition that I tracked down in the org-remember.el file to line 887 in = the org-remember-handler function:

=A0((not (org-mode-p))
=A0=A0=A0 =A0=A0=A0 (if (eq heading 'top)=
=A0=A0=A0 =A0=A0=A0 =A0=A0=A0 (goto-char (point-min))
=A0=A0=A0 =A0= =A0=A0 =A0 (goto-char (point-max))
=A0=A0=A0 =A0=A0=A0 =A0 (or (bolp) (n= ewline)))
=A0=A0=A0 =A0=A0=A0 (insert text-before-node-creation)=A0=A0= =A0
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 .......


The error is that text-before-node-creation apparently is a nil and the insert routine is generating an error because of it.=A0 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:

=A0 (unless (looking-at org-outline-regexp)
=A0=A0=A0 ;; add a headl= ine
=A0=A0=A0 (setq text-before-node-creation (buffer-string))

Be= cause 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
--0016e6dd8e74751ab4046c7f7eab-- --===============0388158401== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ 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 --===============0388158401==--