auctex-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Allowing closure's in style hooks?


From: Arash Esbati
Subject: Allowing closure's in style hooks?
Date: Thu, 17 Nov 2022 12:55:16 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50

Hi all,

I'd like to install this change in `TeX-parse-argument':

--8<---------------cut here---------------start------------->8---
diff --git a/tex.el b/tex.el
index 7fe8095a..129571ae 100644
--- a/tex.el
+++ b/tex.el
@@ -3554,7 +3554,7 @@ See `TeX-parse-macro' for details."
              (set-marker TeX-exit-mark (point)))
            (insert TeX-arg-closing-brace)
            (setq insert-flag t))
-          ((symbolp arg)
+          ((or (symbolp arg) (functionp arg))
            (funcall arg optional))
           ((listp arg)
            (let ((head (car arg))
--8<---------------cut here---------------end--------------->8---

With this, we can use things like this:

  (TeX-add-symbols
    `("foo" ,(lambda (_) ...)))

in our styles.  We're already using this in `TeX-read-key-val' et al.,
so why not also anywhere else?  This could help us getting rid of more
`TeX-arg-eval' constructs.

Any comments welcome.

Best, Arash



reply via email to

[Prev in Thread] Current Thread [Next in Thread]