emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Kaushal Modi <kaushal.modi@gmail.com>
To: Nicolas Goaziou <mail@nicolasgoaziou.fr>
Cc: emacs-org list <emacs-orgmode@gnu.org>
Subject: Re: Recent regression in Org master with parsing of verbatim code with spaces
Date: Thu, 12 Oct 2017 15:29:17 +0000	[thread overview]
Message-ID: <CAFyQvY0KJ6abXADTsnM7aAME11JrhwiBfwFw4pbQ_0Q33HPZ=g@mail.gmail.com> (raw)
In-Reply-To: <CAFyQvY2yf9cFjayhMs0eOG-6yRgFdMGQUQFDdy0347L55fNi-w@mail.gmail.com>

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

On Thu, Oct 12, 2017 at 11:20 AM Kaushal Modi <kaushal.modi@gmail.com>
wrote:

> On Thu, Oct 12, 2017 at 11:01 AM Nicolas Goaziou <mail@nicolasgoaziou.fr>
> wrote:
>
>> Why do you consider it to be a regression? IIRC, the change allowed to
>> use zero-width space as a way to escape markup.
>
>
Also I spent few hours trying to understand why

(setq org-emphasis-regexp-components
      '("-[:space:]('\"{"             ;prematch allowed
        "-[:space:].,:!?;'\")}\\["     ;postmatch allowed
        " \t\r\n"                     ;border *not* allowed
        "."                           ;body
        20))                           ;newlines

seems to resolve this issue.. I just changed the "border not allowed"
regexp from "[:space:]" to " \t\r\n".

I spent few hours, using edebug, message based debugging but couldn't
figure out.

If I try this sandbox method to debug:

(dolist (str '("=title = \"foo\"=

~title = \"foo\"​~"))
  (message "String: %s" str)
  (let* ((working-verbatim-re
"\\([-[:space:]('\"{]\\|^\\)\\(\\(?3:[=~]\\)\\([^
\n]\\|[^

\n].*?\\(?:\n.*?\\)\\{0,1\\}[^

\n]\\)\\3\\)\\([-[:space:].,:!?;'\")}\\[]\\|$\\)")
         (bad-verbatim-re
"\\([-[:space:]('\"{]\\|^\\)\\(\\([=~]\\)\\([^[:space:]]\\|[^[:space:]].*?\\(?:\n.*?\\)\\{0,1\\}[^[:space:]]\\)\\3\\)\\([-[:space:].,:!?;'\")}\\[]\\|$\\)")
         (using-working-verbatim-re (string-match-p working-verbatim-re
str))
         (using-bad-verbatim-re (string-match-p bad-verbatim-re str))
         (match? (equal using-working-verbatim-re using-bad-verbatim-re)))
    (message ".. working match %S" using-working-verbatim-re)
    (message ".. bad match %S" using-bad-verbatim-re)
    (message ".. match? %S" match?)))

Both good and "bad" regexp are matching that test string.

So don't know how exactly this commit is breaking this.. but I know for
sure that reverting org-emphasis-regexp-components to the earlier value
fixes things.
-- 

Kaushal Modi

[-- Attachment #2: Type: text/html, Size: 3338 bytes --]

  reply	other threads:[~2017-10-12 15:29 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-10 17:08 Recent regression in Org master with parsing of verbatim code with spaces Kaushal Modi
2017-10-10 17:29 ` Kaushal Modi
2017-10-10 23:47   ` Reuben Thomas
2017-10-11  8:12     ` Robert Klein
2017-10-10 18:31 ` Eric S Fraga
2017-10-10 18:36   ` Kaushal Modi
2017-10-12 15:01 ` Nicolas Goaziou
2017-10-12 15:20   ` Kaushal Modi
2017-10-12 15:29     ` Kaushal Modi [this message]
2017-10-12 15:33     ` Nicolas Goaziou
2017-10-12 15:43       ` Kaushal Modi
2017-10-12 15:53         ` Nicolas Goaziou
2017-10-12 16:08           ` Kaushal Modi

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='CAFyQvY0KJ6abXADTsnM7aAME11JrhwiBfwFw4pbQ_0Q33HPZ=g@mail.gmail.com' \
    --to=kaushal.modi@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=mail@nicolasgoaziou.fr \
    /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).