emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Backslash cleanup introduced bug [284c470e 9/17]


From: Wilson Snyder
Subject: Backslash cleanup introduced bug [284c470e 9/17]
Date: Fri, 18 Sep 2015 08:34:37 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.3 (gnu/linux)

Thanks for your recent quoting cleanup commit.  One of your
cleanups broke the verilog-mode.el package regressions.
I've repaired it; no additional action is needed, but a
heads up in case this affects other packages.

This:

-       "==" "!=" "===" "!==" "<=" ">=" "==\?" "!=\?" "<->"
+       "==" "!=" "===" "!==" "<=" ">=" "==\\?" "!=\\?" "<->"

was a list of operators, not a series of regexps, so this
change will break matching `==?' (it will look for `==\?'.
Therefore the proper cleanup is:

-       "==" "!=" "===" "!==" "<=" ">=" "==\?" "!=\?" "<->"
+       "==" "!=" "===" "!==" "<=" ">=" "==?" "!=?" "<->"

Also:

          (verilog-string-replace-matches
-          "\[[^0-9: \t]+\]" "" nil nil
+          "\\[[^0-9: \t]+]" "" nil nil


While I agree it works, I think quoting literal open
brackets without quoting literal closing brackets makes it
harder to read - which closing bracket matches the literal
open bracket?

          (verilog-string-replace-matches
-          "\[[^0-9: \t]+\]" "" nil nil
+          "\\[[^0-9: \t]+\\]" "" nil nil

I find this is easier to read as the \\[ and \\] form a
matching pair.  Furthermore I can see any unquoted closing
bracket and know it is part of a character class; and see
any quoted closing bracket and know it matches a literal.

Thanks



reply via email to

[Prev in Thread] Current Thread [Next in Thread]