From: Richard Copley <rcopley@gmail.com>
To: Tom Tromey <tom@tromey.com>
Cc: 26070@debbugs.gnu.org, Dmitry Gutov <dgutov@yandex.ru>
Subject: bug#26070: 26.0.50; js-mode slash insertion bug
Date: Thu, 23 Mar 2017 07:00:58 +0000 [thread overview]
Message-ID: <CAPM58ohwVwbykG-7JiVcgLGsNHyHLgTtBS2Snrgr=Bqki-ZTuw@mail.gmail.com> (raw)
In-Reply-To: <87lgrx0xch.fsf@tromey.com>
On 22 March 2017 at 22:18, Tom Tromey <tom@tromey.com> wrote:
>>>>>> "Richard" == Richard Copley <rcopley@gmail.com> writes:
>
> Richard> Caught one!
>
> Thank you.
>
> Richard> Insert the text below in a JS-mode buffer, go to the beginning of the
> Richard> blank first line in function h() and type "/". There is an infloop.
>
> How did you find this? I'm very curious.
I didn't go looking. The recipe is reduced from a program I was
writing. The infloop happened when I went to comment out a line.
Would have happened to somebody sooner or later :)
> Anyway, please try this patch on top of the previous one I sent.
Seems good, thanks very much.
> Or if you'd prefer I can send a combined patch.
>
> Tom
>
> diff --git a/lisp/progmodes/js.el b/lisp/progmodes/js.el
> index fa865db..c220353 100644
> --- a/lisp/progmodes/js.el
> +++ b/lisp/progmodes/js.el
> @@ -1722,12 +1722,13 @@ js-syntax-propertize-regexp
> (when (eq (nth 3 ppss) ?/)
> ;; A /.../ regexp.
> (goto-char (nth 8 ppss))
> - (when (and (looking-at js--syntax-propertize-regexp-regexp)
> - ;; Don't touch text after END.
> - (or (not (match-end 1)) (<= (match-end 1) end)))
> - (put-text-property (match-beginning 1) (or (match-end 1) (match-end 0))
> + (when (looking-at js--syntax-propertize-regexp-regexp)
> + ;; Don't touch text after END.
> + (when (> end (match-end 1))
> + (setq end (match-end 1)))
> + (put-text-property (match-beginning 1) end
> 'syntax-table (string-to-syntax "\"/"))
> - (goto-char (match-end 0))))))
> + (goto-char end)))))
>
> (defun js-syntax-propertize (start end)
> ;; JavaScript allows immediate regular expression objects, written /.../.
next prev parent reply other threads:[~2017-03-23 7:00 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-03-12 10:23 bug#26070: 26.0.50; js-mode slash insertion bug Richard Copley
2017-03-13 13:50 ` Tom Tromey
2017-03-13 19:12 ` Richard Copley
2017-03-14 5:56 ` Dmitry Gutov
2017-03-14 11:06 ` Tom Tromey
2017-03-19 11:22 ` Richard Copley
2017-03-22 22:18 ` Tom Tromey
2017-03-23 7:00 ` Richard Copley [this message]
2017-03-24 3:53 ` Tom Tromey
2017-03-31 7:53 ` Dmitry Gutov
2017-04-01 21:15 ` bug#26070: fixed Tom Tromey
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CAPM58ohwVwbykG-7JiVcgLGsNHyHLgTtBS2Snrgr=Bqki-ZTuw@mail.gmail.com' \
--to=rcopley@gmail.com \
--cc=26070@debbugs.gnu.org \
--cc=dgutov@yandex.ru \
--cc=tom@tromey.com \
/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 external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.