emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] re-search-forward hang in org-link-search


From: Pip Cet
Subject: Re: [O] re-search-forward hang in org-link-search
Date: Thu, 13 Aug 2015 18:50:54 +0000

Can you try this patch? That appears to fix the issue here, at least
for this one file, at the cost of yet another shy group added to the
regular expression.

diff --git a/lisp/org.el b/lisp/org.el
index a908d9e..7f46687 100755
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -11128,18 +11128,18 @@ of matched result, with is either
`dedicated' or `fuzzy'."
                       "\\[[0-9]*\\(?:%\\|/[0-9]*\\)\\]"
                       wspaceopt
                       "\\)"))
-              (sep (concat "\\(?:" wspace "+\\|" cookie "+\\)"))
+              (sep (concat "\\(?:\\(?:" wspace "\\|" cookie "\\)+\\)"))
               (re (concat
                org-outline-regexp-bol
                "\\(?:" org-todo-regexp "[ \t]+\\)?"
                "\\(?:\\[#.\\][ \t]+\\)?"
                "\\(?:" org-comment-string "[ \t]+\\)?"
-               sep "*"
+               sep "?"
                (let ((title (mapconcat #'regexp-quote
                            words
-                           (concat sep "+"))))
+                           sep)))
                  (if starred (substring title 1) title))
-               sep "*"
+               sep "?"
                (org-re "\\(?:[ \t]+:[[:alnum:address@hidden:]+:\\)?")
                "[ \t]*$")))
          (goto-char (point-min))

(Sorry if this arrives in duplicate, I had neglected to configure
Gmail to default to reply-to-all behaviour).


On Thu, Aug 13, 2015 at 6:36 PM, Matthew MacLean <address@hidden> wrote:
>
> On Thu, Aug 13, 2015 at 12:26 PM, Pip Cet <address@hidden> wrote:
>>
>> It's not an Emacs bug. Your regular expression whittles down to:
>>
>> (defvar hang-re "^\\*+ *Mawile\\(?:[ ]+\\)+stuff\\(?:[ ]+\\)*$")
>>
>> or even
>>
>> (defvar hang-re "\\(?:[ ]+\\)+s")
>>
>> That expression matches the string of spaces separating the first
>> Mawhile headline from its tags in many many different ways, and is one
>> of the type of regular expressions warned about in the (Emacs Lisp
>> Reference) manual. We shouldn't be generating it, and it is a bug, but
>> it is in Org, not Emacs.
>
>
> Ah... Well, this is the reason I posted it here first.
>
> In that case, the bug is present as late as
> a97f2c1830910d7a239dcbb98e200a6e4038acaa.

Attachment: org-mode-003.diff
Description: Text document


reply via email to

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