emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Nick Dokos <ndokos@gmail.com>
To: emacs-orgmode@gnu.org
Subject: Re: Long lines prevent Org mode!
Date: Wed, 08 Jan 2014 01:05:51 -0500	[thread overview]
Message-ID: <87wqibypmo.fsf@gmail.com> (raw)
In-Reply-To: 87ha9fvyjm.fsf@iro.umontreal.ca

François Pinard <pinard@iro.umontreal.ca> writes:

> Nick Dokos <ndokos@gmail.com> writes:
>
>> you can leave org out of the picture altogether: create an empty
>> buffer, insert 33333 x's by hand, go to the beginning and evaluate
>
>>    (looking-at ".*foo")
>
>> As Stefan says in the thread you pointed out, it's a limitation of the
>> emacs regexp engine.
>
> Yes, I got this from his article.  However, it seems that "[^\nf]*foo"
> would succeed, avoiding the stack explosion.  So, it is possible to
> rework the regexpes around the limitation.
>
> Surely not a fun job to do for Org regexpes, I know.  Maybe not worth
> doing as very long lines are unusual, yet maybe worth doing nevertheless
> for Org files because long lines are still possible.  The fact is that I
> was hit by this problem in the Org buffers generated by org-grep.
>

It would be better to reimplement the regexp engine using e.g. an NDFA.
IIRC, it requires constant stack but it limits the regexps allowed. See
e.g.

        http://swtch.com/~rsc/regexp/regexp1.html

It might make sense to pair the NDFA with a backtracker. The pattern
compiler could then choose which one to use based on the regexp.

-- 
Nick

  reply	other threads:[~2014-01-08  6:06 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-08  1:24 Long lines prevent Org mode! François Pinard
2014-01-08  4:41 ` Nick Dokos
2014-01-08  5:21   ` François Pinard
2014-01-08  6:05     ` Nick Dokos [this message]
2014-01-08  9:18     ` Sebastien Vauban
2014-01-08 12:10       ` Nick Dokos
2014-01-08 12:29       ` François Pinard
2014-01-09  8:57         ` Sebastien Vauban

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=87wqibypmo.fsf@gmail.com \
    --to=ndokos@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).