Lionel Henry <lionel....@gmail.com> writes: Hi Lionel,
> Is there a way to specify a list of macros that should always be > inserted with braces, even in math mode? Yes. Something like this should work: (add-hook 'LaTeX-mode-hook (lambda () (TeX-add-symbols '("text" t)))) The single t means there's one mandatory argument for which {} should be inserted and point placed in between. See the description of t in: ,----[ C-h f TeX-parse-macro RET ] | TeX-parse-macro is a compiled Lisp function in `tex.el'. | | (TeX-parse-macro SYMBOL ARGS) | | How to parse TeX macros which takes one or more arguments. | | First argument SYMBOL is the name of the macro. | | If called with no additional arguments, insert macro with point | inside braces. Otherwise, each argument of this function should | match an argument to the TeX macro. What is done depend on the | type of ARGS: | | string: Use the string as a prompt to prompt for the argument. | | number: Insert that many braces, leave point inside the first. | | nil: Insert empty braces. | | t: Insert empty braces, leave point between the braces. | | other symbols: Call the symbol as a function. You can define | your own hook, or use one of the predefined argument hooks. If | you add new hooks, you can assume that point is placed directly | after the previous argument, or after the macro name if this is | the first argument. Please leave point located after the | argument you are inserting. If you want point to be located | somewhere else after all hooks have been processed, set the value | of `exit-mark'. It will point nowhere, until the argument hook | set it. By convention, these hooks all start with `TeX-arg-'. | | list: If the car is a string, insert it as a prompt and the next | element as initial input. Otherwise, call the car of the list | with the remaining elements as arguments. | | vector: Optional argument. If it has more than one element, | parse it as a list, otherwise parse the only element as above. | Use square brackets instead of curly braces, and is not inserted | on empty user input. `---- Bye, Tassilo _______________________________________________ auctex mailing list auctex@gnu.org https://lists.gnu.org/mailman/listinfo/auctex