Closed Rich-Cloutier closed 1 year ago
The original thinking was verilog-warn-fatal would be globally set, so not in Local Variables. Are you setting it in Local Variables only due to batch mode, or for another reason (e.g. when running interactively on separate files)?
I think your suggestion to make it safe is reasonable, though I'd want to figure out how to avoid that warning, either by suppressing it, or with a new variable that only that "let" sets.
Some of our use of verilog-auto is for batch mode scripting run by services and may not be run as a user who has setup an .emacs file. We wanted those scripts to error out (not just warn) if there was an issue with one of the templates. So for this use case we decided that all configuration information should be in the local variables section (almost as a boilerplate section) in our source SystemVerilog files.
Should work now, thanks for the report & fix.
I have found a problem when using batch mode (verilog-batch-auto) and trying to set verilog-warn-fatal in the local-variables section of a SystemVerilog file. The inclusion of verilog-warn-fatal will cause processing of the local variables section to be abandonded.
Conditions to see the issue
Then while executing the command verilog-batch-auto, verilog-mode will be unable to find the modules defined in the directories specified for the verilog-library-directories, because the setting of verilog-library-directories will not be processed, because verilog-warn-fatal is not considered a safe local variable. Since it is not considered safe, the batch mode emacs abandons processing of local variables because there was no possible response to the question about using unsafe local variables. A potential fix for this problem is to apply something like this patch to verilog-mode.el
Even with this patch you will still get the message from emacs:
Making verilog-warn-fatal buffer-local while locally let-bound!
, because verilog-warn-fatal is a let variable in verilog-batch-auto. So I don't know if there is a better alternative fix for this problem.Details for reproduction of problem: Versions: Emacs : GNU Emacs 27.1 (build 2, x86_64-pc-linux-gnu, X toolkit, Xaw scroll bars) of 2020-09-24 Package: verilog-mode v2022-07-17-dad7c92-vpo
Two SystemVerilog source files, in specific directories: File1: ./foo.sv
File2: ./lib_area/bar.sv
Run emacs in batch mode:
and you will see the output: