GNU bug report logs - #37127
27.0.50; in cperl mode, scan-error Unbalanced parentheses

Previous Next

Package: emacs;

Reported by: Vincent Lefevre <vincent <at> vinc17.net>

Date: Wed, 21 Aug 2019 12:18:01 UTC

Severity: minor

Tags: confirmed, fixed

Found in version 27.0.50

Fixed in version 28.1

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: haj <at> posteo.de (Harald Jörg)
Cc: 37127 <at> debbugs.gnu.org
Subject: bug#37127: [PATCH] cperl-mode: Suppress a misleading message
Date: Fri, 30 Oct 2020 10:30:04 -0400
> +(ert-deftest cperl-bug37127 ()
[...]
> +    ;; part two: Regex terminator missing -> message
> +    (ert-with-message-capture collected-messages
> +      (with-temp-buffer
> +        (insert "$_ =~ /(..;")
> +        (goto-char (point-min))
> +        (cperl-mode)
> +        (search-forward ".")
> +        (let ((last-command-event ?\)))
> +          (cperl-electric-rparen 1)
> +          (cperl-find-pods-heres (point-min) (point-max) t)))
> +      (should (string-match "^End of .* string/RE"
> +                            collected-messages)))))

Why is this behavior desirable?

I mean, I don't necessarily mind it, but as a user I find it odd that
typing a `)` which has a matching `(` nearby (which can be found without
crossing any string/RE boundary) should emit a warning about some
"unrelated" surrounding entity like the RE in which it is located.

Emacs usually doesn't emit any such warning when editing within an
unclosed string.

I don't think we should necessarily change CPerl's behavior in this
regard, but that we shouldn't consider it a feature and thus shouldn't
enforce it in our tests.


        Stefan





This bug report was last modified 4 years and 257 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.