emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Carsten Dominik <carsten.dominik@gmail.com>
To: David Maus <maus.david@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: Fri, 27 Nov 2009 08:31:06 +0100	[thread overview]
Message-ID: <2FB9A9B4-BC5A-4653-B9BC-9298D51A026D@gmail.com> (raw)
In-Reply-To: <873a41x7qz.wl%maus.david@gmail.com>


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

- Carsten

      reply	other threads:[~2009-11-27  8:55 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
2009-11-27  7:31     ` Carsten Dominik [this message]

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=2FB9A9B4-BC5A-4653-B9BC-9298D51A026D@gmail.com \
    --to=carsten.dominik@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=maus.david@gmail.com \
    /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).