From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jere McDevitt Subject: Re: Error saving remember item in non org-mode buffer Date: Fri, 19 Jun 2009 20:07:19 -0400 Message-ID: References: <87fxdwvbzy.fsf@kassiopeya.MSHEIMNETZ> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1876385362==" Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MHo7C-0006FX-19 for emacs-orgmode@gnu.org; Fri, 19 Jun 2009 20:07:26 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MHo77-0006Eo-FE for emacs-orgmode@gnu.org; Fri, 19 Jun 2009 20:07:25 -0400 Received: from [199.232.76.173] (port=32979 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MHo77-0006El-D0 for emacs-orgmode@gnu.org; Fri, 19 Jun 2009 20:07:21 -0400 Received: from mail-ew0-f210.google.com ([209.85.219.210]:44695) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MHo76-0001qy-OW for emacs-orgmode@gnu.org; Fri, 19 Jun 2009 20:07:21 -0400 Received: by ewy6 with SMTP id 6so2806795ewy.42 for ; Fri, 19 Jun 2009 17:07:19 -0700 (PDT) In-Reply-To: <87fxdwvbzy.fsf@kassiopeya.MSHEIMNETZ> 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: Sebastian Rose Cc: emacs-orgmode@gnu.org --===============1876385362== Content-Type: multipart/alternative; boundary=0016e6db61caa1acd8046cbc6ce2 --0016e6db61caa1acd8046cbc6ce2 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Oh, I'm familiar with the file variables and all, thanks for the tip. Since the org-remember code is written to support files that are not in org-mode as targets of remember items, it just seemed to me it shouldn't then switch back to assuming it was an org mode file simply because the text being inserted resembles a particular type of regexp. (gotta remember to hit reply-all) On Fri, Jun 19, 2009 at 4:55 AM, Sebastian Rose wrote: > As Carsten posted yesterday: > > > > http://www.gnu.org/software/emacs/manual/html_node/emacs/Specifying-File-Variables.html > > > First line of project.todo: > > > -*- mode: org-mode; -*- > > > Sebastian > > > Jere McDevitt writes: > > 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 > > _______________________________________________ > > 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 > > -- > Sebastian Rose, EMMA STIL - mediendesign, Niemeyerstr.6, 30449 Hannover > Tel.: +49 (0)511 - 36 58 472 > Fax: +49 (0)1805 - 233633 - 11044 > mobil: +49 (0)173 - 83 93 417 > Email: s.rose@emma-stil.de, sebastian_rose@gmx.de > Http: www.emma-stil.de > --0016e6db61caa1acd8046cbc6ce2 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Oh, I'm familiar with the file variables and all, thanks for the tip.
Since the org-remember code is written to support files that are not in org-mode as targets of remember items, it just seemed to me it shouldn't then switch back to assuming it was an org mode file simply because the text being inserted resembles a particular type of regexp.
<= br>(gotta remember to hit reply-all)

On F= ri, Jun 19, 2009 at 4:55 AM, Sebastian Rose <sebastian_rose@gmx.de> wrot= e:
As Carsten posted= yesterday:


http://www.gnu.org/software/emac= s/manual/html_node/emacs/Specifying-File-Variables.html


First line of project.todo:


=A0-*- mode: org-mode; -*-


=A0Sebastian


Jere McDevitt <jere.mcdevitt@= gmail.com> writes:
> 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
> =A0 =A0 =A0 =A0 ("Project" ?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 def= ault
> in fundamental-mode, not org-mode.
>
> This generates an error condition that I tracked down in the org-remem= ber.el
> file to line 887 in org-remember-handler:
>
> =A0((not (org-mode-p))
> =A0 =A0 =A0 =A0 (if (eq heading 'top)
> =A0 =A0 =A0 =A0 =A0 =A0 (goto-char (point-min))
> =A0 =A0 =A0 =A0 =A0 (goto-char (point-max))
> =A0 =A0 =A0 =A0 =A0 (or (bolp) (newline)))
> =A0 =A0 =A0 =A0 (insert text-before-node-creation)
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 .......
>
>
> The error is that text-before-node-creation apparently is a nil and th= e
> insert routine is generating an error because of it. =A0This 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 ;; add a headline
> =A0 =A0 (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 b= uffer is not in
> org-mode, this code is triggered using the text-buffer-node-creation.<= br> >
> 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 ab= out
> the problem.
>
> 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

--
Sebastian Rose, EMMA STIL - mediendesign, Niemeyerstr.6, 30449 Hannover
Tel.: =A0+49 (0)511 - 36 58 472
Fax: =A0 +49 (0)1805 - 233633 - 11044
mobil: +49 (0)173 - 83 93 417
Email: s.rose@emma-stil.de, sebastian_rose@gmx.de
Http: =A0www.emma-sti= l.de

--0016e6db61caa1acd8046cbc6ce2-- --===============1876385362== 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 --===============1876385362==--