Subject: AW: bug#63251: 28.2; vhdl-mode contribution

From: Cyril Arnould <[email-masked]>
Date: Sat, 6 May 2023 22:11:50 +0000

Ok, I hope the attached patch takes care of things. This time
it's based on the emacs-29 branch.

- I've updated the docstring with a description of the TYPE,
  pretty much copied from compile.el. Feel free to change it of
  course.

- I've added TYPE to the vhdl-compiler definition with the
  appropriate choices for Info/Warning/Error and the dotted
  pair. I'm not sure if sexp was the correct choice for the
  dotted pair, is there a better alternative? At any rate, it
  seems to work.

- All other compiler entries now have TYPE nil, i.e. an error.

- I added another entry to the backwards compatibility code, all
  it took was a slight modification of the entry before
  that. I've tested it by saving a custom vhdl-compiler-alist and
  then updating the vhdl-mode.el, it automatically inserted nil
  into the customization without touching the other values.

- Unrelated to the changes above, I've also updated the Xilinx
  Vivado compiler entry's library directory, I got an error
  message that it must end with '/'.

Since this introduces changes in the vhdl-compiler type, I guess
it would be appropriate to increment the vhdl-version number?

Von: Cyril Arnould<mailto:[email-masked]>
Gesendet: Samstag, 6. Mai 2023 14:53
An: Mattias Engdegård<mailto:[email-masked]>; [email-masked]<mailto:[email-masked]>
Cc: Reto Zimmermann<mailto:[email-masked]>; Eli Zaretskii<mailto:[email-masked]>
Betreff: AW: bug#63251: 28.2; vhdl-mode contribution

Forgot to hit «Reply to all»

Oh, did not realize that. Yes, the (2 . 3) is important, it’s the
TYPE that determines whether the message is highlighted as an
INFO, WARNING or ERROR. From compilation-error-regexp-alist:

Each elt has the form (REGEXP FILE [LINE COLUMN TYPE HYPERLINK
HIGHLIGHT...]).

TYPE is 2 or nil for a real error or 1 for warning or 0 for info.
TYPE can also be of the form (WARNING . INFO).  In that case this
will be equivalent to 1 if the WARNING’th subexpression matched
or else equivalent to 0 if the INFO’th subexpression matched,
or else equivalent to 2 if neither of them matched.
See ‘compilation-error-face’, ‘compilation-warning-face’,
‘compilation-info-face’ and ‘compilation-skip-threshold’.

I’ll try to take a look into modifying the type of the
vhdl-compiler-alist.

Von: Mattias Engdegård<mailto:[email-masked]>
Gesendet: Samstag, 6. Mai 2023 11:22
An: [email-masked]<mailto:[email-masked]>
Cc: Reto Zimmermann<mailto:[email-masked]>; Eli Zaretskii<mailto:[email-masked]>; Cyril Arnould<mailto:[email-masked]>
Betreff: bug#63251: 28.2; vhdl-mode contribution

> Following bug#62508, I've taken a bit of a closer look at the compiler
> regexp for ModelSim. I've modified it so that it can differentiate
> between Errors, Warnings and Notes when highlighting. I also make use of
> Xilinx Vivado at work, for which I've added a new compiler entry:

Sorry, but computer says no. The modified vhdl-compiler-alist value does not match its declared type.

You can easily check this by running `M-x customize-variable vhdl-compiler-alist`; it will show the contents as a single big text field and say (mismatch).
If the value matches the type, it would have shown the value structurally.

Another check is to run `make -C test test-custom-opts`, which checks the values of all defcustom variables in Emacs.

In this case it seems to be the `(2 . 3)` values at the end of the error message sublists. Remove them and the value matches the type.
If those (2 . 3) are important, perhaps you want to change the type instead but you would have to maintain compatibility somehow. I see there is a lot of code dealing with changes to the type of that variable in vhdl-mode.el.