From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jere McDevitt Subject: Error saving remember item in non org-mode buffer Date: Tue, 16 Jun 2009 15:22:52 -0400 Message-ID: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0903892749==" Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MGeFI-0001fX-7I for emacs-orgmode@gnu.org; Tue, 16 Jun 2009 15:23:00 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MGeFD-0001aV-Bd for emacs-orgmode@gnu.org; Tue, 16 Jun 2009 15:22:59 -0400 Received: from [199.232.76.173] (port=38086 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MGeFC-0001aL-Vr for emacs-orgmode@gnu.org; Tue, 16 Jun 2009 15:22:55 -0400 Received: from mail-ew0-f210.google.com ([209.85.219.210]:42523) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MGeFC-0001Cb-IL for emacs-orgmode@gnu.org; Tue, 16 Jun 2009 15:22:54 -0400 Received: by ewy6 with SMTP id 6so549994ewy.42 for ; Tue, 16 Jun 2009 12:22:52 -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 --===============0903892749== Content-Type: multipart/alternative; boundary=0016e64c1e8edbba47046c7c193c --0016e64c1e8edbba47046c7c193c 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 org-remember-handler: ((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 the problem. Jere --0016e64c1e8edbba47046c7c193c 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 i= t was loaded to be written to by the org-remember-handler, it came up by de= fault in fundamental-mode, not org-mode.

This generates an error con= dition that I tracked down in the org-remember.el file to line 887 in org-r= emember-handler:

=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 earli= er in the handler at around line 845 but only if the text being inserted do= es 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-crea= tion.

The simple work around was to add .todo files to the auto-mode-alist (o= r I could have changed the template), but I thought I would post a note abo= ut the problem.

Jere
--0016e64c1e8edbba47046c7c193c-- --===============0903892749== 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 --===============0903892749==--