[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Orgmode] Bug: Infinite loop when org-entry-put is called in buffer
From: |
David Maus |
Subject: |
Re: [Orgmode] Bug: Infinite loop when org-entry-put is called in buffer not in org-mode [6.33trans] |
Date: |
Thu, 26 Nov 2009 23:04:52 +0100 |
User-agent: |
Wanderlust/2.15.6 (Almost Unreal) SEMI/1.14.6 (Maruoka) FLIM/1.14.9 (Gojō) APEL/10.7 Emacs/23.1.50 (i486-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO) |
Hi Carsten,
At Thu, 26 Nov 2009 08:42:09 +0100,
Carsten Dominik wrote:
> Hi David,
>
> you cannot reasonably expect that org-mode functions should work
> in other modes. And you cannot expect these functions to check
> the mode all the time.
>
> I don't know what you are up to here. But maybe the function
> `org-run-as-in-org-mode' offers a way out?
I stumpled on this infinite loop by accident and simply avoid it by
make my function refuse to work on a buffer not in org-mode.
However, I decided it worth a bugreport as I didn't know the reason
for this and assumed org-mode may enter this loop by itself if the
right conditions are met.
After debugging the loop it turns out that the loop occurs in
`org-insert-property-drawer' because `org-keyword-time-regexp' is
buffer local only (calculated when entering org-mode) and defaults to
nil, so when `org-insert-property-drawer' tries to skip SCHEDULED,
DEADLINE etc. lines it tries this by while-re-search-forwarding[1]
with the regexp "^[ \t]*" -- that is what throws Emacs in this loop
(for whatever reason -- I hope I am going to find out).
So the question is: Is it in anyway possible that
`org-keyword-time-regexp' is (re-set to) nil in regular orgmode
operation?
As far as I could see: No, so it should not effect the normal
operations of org-mode.
Regards,
-- David
[1] i.e.: (while (re-search-forward "^[ \t]*")) causes Emacs to
loop. That means "not beeing in orgmode" not even a sine qua non for
this loop.
--
OpenPGP... 0x316F4BE4670716FD
Jabber.... address@hidden
Email..... address@hidden
ICQ....... 241051416