verilog-auto-insert-lisp
verilog-auto-insert-lisp is a compiled Lisp function in `verilog-mode.el
'.
(verilog-auto-insert-lisp)
Expand AUTOINSERTLISP statements, as part of M-x verilog-auto.
The Lisp code provided is called before other AUTOS are expanded,
and the Lisp code generally will call `insert` to insert text
into the current file beginning on the line after the
AUTOINSERTLISP.
See also AUTOINSERTLAST and `verilog-auto-insert-last' which
executes after (as opposed to before) other AUTOs.
See also AUTO_LISP, which takes a Lisp expression and evaluates
it during `verilog-auto-inst' but does not insert any text.
An example:
module ExampInsertLisp;
/*AUTOINSERTLISP(my-verilog-insert-hello "world")*/
endmodule
// For this example we declare the function in the
// module's file itself. Often you'd define it instead
// in a site-start.el or init file.
/*
Local Variables:
eval:
(defun my-verilog-insert-hello (who)
(insert (concat "initial $write(\"hello " who "\");\n")))
End:
*/
Typing M-x verilog-auto will call my-verilog-insert-hello and
expand the above into:
// Beginning of automatic insert lisp
initial $write("hello world");
// End of automatics
You can also call an external program and insert the returned
text:
/*AUTOINSERTLISP(insert (shell-command-to-string "echo //hello"))*/
// Beginning of automatic insert lisp
//hello
// End of automatics