emacs-orgmode
[Top][All Lists]
Advanced

[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: Carsten Dominik
Subject: Re: [Orgmode] Bug: Infinite loop when org-entry-put is called in buffer not in org-mode [6.33trans]
Date: Fri, 27 Nov 2009 08:31:06 +0100


On Nov 26, 2009, at 11:04 PM, David Maus wrote:

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.

That is exactly the right course of action.


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.

No, this variable (see below) is always set in Org buffers.


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?

I could do that, but just the same I would have to do that for
many different other variables which only work inside org-mode.

- Carsten


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

- Carsten







reply via email to

[Prev in Thread] Current Thread [Next in Thread]