From mboxrd@z Thu Jan 1 00:00:00 1970 From: Pip Cet Subject: Re: re-search-forward hang in org-link-search Date: Thu, 13 Aug 2015 18:50:54 +0000 Message-ID: References: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary=001a1141f3e0a494f2051d35d09f Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:59814) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZPxaa-00068L-1p for emacs-orgmode@gnu.org; Thu, 13 Aug 2015 14:50:57 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZPxaZ-00068H-44 for emacs-orgmode@gnu.org; Thu, 13 Aug 2015 14:50:55 -0400 Received: from mail-io0-x229.google.com ([2607:f8b0:4001:c06::229]:36426) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZPxaY-00068D-V6 for emacs-orgmode@gnu.org; Thu, 13 Aug 2015 14:50:55 -0400 Received: by iodv127 with SMTP id v127so45999742iod.3 for ; Thu, 13 Aug 2015 11:50:54 -0700 (PDT) In-Reply-To: List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Matthew MacLean Cc: emacs-orgmode@gnu.org --001a1141f3e0a494f2051d35d09f Content-Type: text/plain; charset=UTF-8 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:]_@#%%:]+:\\)?") "[ \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 wrote: > > On Thu, Aug 13, 2015 at 12:26 PM, Pip Cet 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. --001a1141f3e0a494f2051d35d09f Content-Type: text/plain; charset=US-ASCII; name="org-mode-003.diff" Content-Disposition: attachment; filename="org-mode-003.diff" Content-Transfer-Encoding: base64 X-Attachment-Id: f_idak9o530 ZGlmZiAtLWdpdCBhL2xpc3Avb3JnLmVsIGIvbGlzcC9vcmcuZWwKaW5kZXggYTkwOGQ5ZS4uN2Y0 NjY4NyAxMDA3NTUKLS0tIGEvbGlzcC9vcmcuZWwKKysrIGIvbGlzcC9vcmcuZWwKQEAgLTExMTI4 LDE4ICsxMTEyOCwxOCBAQCBvZiBtYXRjaGVkIHJlc3VsdCwgd2l0aCBpcyBlaXRoZXIgYGRlZGlj YXRlZCcgb3IgYGZ1enp5Jy4iCiAJCQkJICAgICAgIlxcW1swL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