branch: main commit 8ac3fd74ed9e9df0bedd6bb5bd09e41ab15484b3 Author: Arash Esbati <ar...@gnu.org> Commit: Arash Esbati <ar...@gnu.org>
Add new style argument hooks * doc/auctex.texi (Adding Macros): Document them. * tex.el (TeX-arg-space, TeX-arg-set-exit-mark): Add new functions. --- doc/auctex.texi | 6 ++++++ tex.el | 11 +++++++++++ 2 files changed, 17 insertions(+) diff --git a/doc/auctex.texi b/doc/auctex.texi index 53bb94bd..7cca6f8b 100644 --- a/doc/auctex.texi +++ b/doc/auctex.texi @@ -5824,6 +5824,12 @@ Prompt for a @samp{key=value} list of options and return them. @item TeX-arg-key-val Prompt for a @samp{key=value} list of options and insert it as a @TeX{} macro argument. + +@item TeX-arg-space +Insert one or more spaces. + +@item TeX-arg-set-exit-mark +Set @code{TeX-exit-mark} to current point or a given position. @end ftable If you add new hooks, you can assume that point is placed directly after diff --git a/tex.el b/tex.el index 2953efa0..62f0f102 100644 --- a/tex.el +++ b/tex.el @@ -3688,6 +3688,17 @@ Used for specifying extra syntax for a macro. The compatibility argument OPTIONAL is ignored." (apply #'insert args)) +(defun TeX-arg-space (_optional &optional how-many) + "Ignore OPTIONAL and insert 1 or HOW-MANY spaces. + +This function is equivalent to + (TeX-arg-literal \" \") +when HOW-MANY is omitted." + (insert (make-string (or how-many 1) ?\s))) + +(defun TeX-arg-set-exit-mark (_optional &optional pos) + "Ignore OPTIONAL and set `TeX-exit-mark' to POS or current point." + (set-marker TeX-exit-mark (or pos (point)))) ;;; Font Locking