emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Pip Cet <pipcet@gmail.com>
To: Matthew MacLean <archenoth@gmail.com>
Cc: emacs-orgmode@gnu.org
Subject: Re: re-search-forward hang in org-link-search
Date: Thu, 13 Aug 2015 18:50:54 +0000	[thread overview]
Message-ID: <CAOqdjBdyOWZWbhtwO9igWdxiL0S5vP5=qNuADvCERnvr0Bjy0g@mail.gmail.com> (raw)
In-Reply-To: <CA+GZiYrBVpj7X1_1H25bmbCgAFtKNkPE=xetHccdkf01ezaa2g@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 2209 bytes --]

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 <archenoth@gmail.com> wrote:
>
> On Thu, Aug 13, 2015 at 12:26 PM, Pip Cet <pipcet@gmail.com> 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 #2: org-mode-003.diff --]
[-- Type: text/plain, Size: 897 bytes --]

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))

  reply	other threads:[~2015-08-13 18:50 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-13 18:00 re-search-forward hang in org-link-search Matthew MacLean
     [not found] ` <CAOqdjBcwTCOUePnCkS5tamMROs+SEmruyAquDXykbkO4j3Hwag@mail.gmail.com>
2015-08-13 18:36   ` Matthew MacLean
2015-08-13 18:50     ` Pip Cet [this message]
2015-08-13 18:55       ` Matthew MacLean
2015-08-13 23:37       ` Nicolas Goaziou
2015-08-14 16:55         ` Pip Cet
2015-08-14 20:41           ` Nicolas Goaziou
2015-08-18 17:30 ` Bastien
2015-08-18 17:48   ` Matthew MacLean
2015-08-18 17:54     ` Bastien
2015-08-18 17:58       ` Matthew MacLean
2015-08-18 18:01         ` Bastien
2015-08-18 17:57     ` Pip Cet

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='CAOqdjBdyOWZWbhtwO9igWdxiL0S5vP5=qNuADvCERnvr0Bjy0g@mail.gmail.com' \
    --to=pipcet@gmail.com \
    --cc=archenoth@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).