in reply to Re^5: How would you indent this?
in thread How would you indent this?

I'd say CPerl mode is, to some extent, entitled to move this statement on a separate line, if only as a hint that you might revisit your code.

I don't think it's useful but it's not worth arguing about.

Without that strange scrolling (which I still fail to reproduce)

With emacs -Q I got the scrolling every time the error message was produced. It is a huge nuisance to deal with this scrolling.

Since the message is also an indicator that syntax highlighting and indentation will not work correctly until the closing delimiter is found, I'd hesitate to just suppress it.

That is absolutely ridiculous. Pressing the "m" key or the "s" key should not cause an error message to appear, especially not because of the extremely faint possibility that the user actually wants to start their regex with

m
}

I don't know of any other language mode in Emacs, or even another instance in cperl-mode, where an unfinished statement of any kind, like a /* in c-mode or an open quote " without its closing quote causes an error message to appear. This unwanted error message is a truly exasperating nuisance.

Replies are listed 'Best First'.
Re^7: How would you indent this?
by haj (Vicar) on Mar 20, 2021 at 00:17 UTC
    I don't think it's useful but it's not worth arguing about.

    This behavior also goes away if you set the configuration variable ‘cperl-indent-region-fix-constructs’ to nil.

    I don't know of any other language mode in Emacs, or even another instance in cperl-mode, where an unfinished statement of any kind, like a /* in c-mode or an open quote " without its closing quote causes an error message to appear.

    Well, parens (of any kind) are sort of magical in Emacs, even in situations where they should not be, like within comments or strings. Comments and strings, on the other hand, have ... a different kind of magic.

    I am still at a loss why the message would cause scrolling. Emacs emits warnings rather frequently without any scrolling taking place. I have a hunch that the issue is not caused by CPerl mode. There are similar cases, which might help to narrow down the issue:

    • Start with an empty buffer and hit } (or any other "closing" paren). This should - in any mode - cause a message No matching parenthesis found. Does this message also cause scrolling for you?
    • Does the issue go away if you set the variable blink-matching-paren to nil or t? A value of 'jump (which was the default for some time) can indeed cause unwanted scrolling.