emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: David Maus <maus.david@gmail.com>
To: Carsten Dominik <carsten.dominik@gmail.com>
Cc: emacs-orgmode@gnu.org
Subject: Re: 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	[thread overview]
Message-ID: <873a41x7qz.wl%maus.david@gmail.com> (raw)
In-Reply-To: <1DE0324A-7A6A-4A55-983C-1B2D8DEE6C3A@gmail.com>

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.... dmjena@jabber.org
Email..... maus.david@gmail.com
ICQ....... 241051416

  reply	other threads:[~2009-11-26 22:05 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-11-25  8:05 Bug: Infinite loop when org-entry-put is called in buffer not in org-mode [6.33trans] David Maus
2009-11-26  7:42 ` Carsten Dominik
2009-11-26 22:04   ` David Maus [this message]
2009-11-27  7:31     ` Carsten Dominik

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=873a41x7qz.wl%maus.david@gmail.com \
    --to=maus.david@gmail.com \
    --cc=carsten.dominik@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).