Forums » Using AUTOs »
questions/problems with -batch AUTO updates
Added by David Rogoff 9 months ago
Hi.
I'm setting up scripts to run emacs -batch to update all my AUTOs and also re-indent, but have issues with both.
First, the AUTO. I set up a script based on the FAQ example, like this:
emacs --no-site-file -l ~/.emacs.d/verilog-mode.el --batch \ lowest_file.v \ lower_file.v \ topfile.v \ -f verilog-batch-autoThe real one has about 40 files. It runs, but it's not seeing the
// verilog-typedef-regexp: "_s$"
in the Local Variables section at the end of each file, so it's messing up ports that are structures. If I manually update AUTOs in the file, it works fine. What do I need to do to get the batch version to work?
Next, the auto-indent. It's exactly the same except the last line is-f verilog-batch-indentIt works, but it's not using the hook I added to untabify when saving files:
;; remove tabs from verilog files when saving.
(add-hook 'verilog-mode-hook '(lambda ()
(add-hook 'write-file-functions (lambda()
(untabify (point-min) (point-max))
nil))))
Again, this works fine if not done in batch. I tried changing the first line of the script to
emacs -l ~/.emacs.d/verilog-mode.el --batch \removing the "--no-site-file" so it would read my init.el file, but it didn't change anything.
What now?
Thanks much!
David
Replies (2)
RE: questions/problems with -batch AUTO updates - Added by Wilson Snyder 8 months ago
I believe --batch turns off reading the .emacs, which is why your hook isn't read. Put it into a separate .el file and "-l my.el" on the command line before the -f.
As to Local variables, I added a test to my regression that depended on a local variable and it seems to work, so you'll need to provide some additional hints; one thing you can do is make a foo.el that you -l after the -f that prints the state of things
(find-file "file_i_loaded_earlier.v")
(describe-variable 'verilog-typedef-regexp)RE: questions/problems with -batch AUTO updates - Added by David Rogoff 8 months ago
I moved all my verilog-mode code out of init.el into a separate file and switched the -l to that file and it all worked! FYI, I set '-L' first so my new file picked up my local copy of verilog-mode.el.
(1-2/2)
![[logo]](/img/veripool_small.png)