branch: main
commit 08075445e2fc1e94e5ebd7dcc4dd14c4ccab3add
Author: Arash Esbati <ar...@gnu.org>
Commit: Arash Esbati <ar...@gnu.org>

    Add support for the 'build' hook
    
    * font-latex.el (font-latex-built-in-keyword-classes): Don't
    fontify the code argument of \AddToHook and \AddToHookNext.
    
    * latex.el (TeX-read-hook): Support 'build' hook.
---
 font-latex.el |  2 +-
 latex.el      | 16 +++++++++++++++-
 2 files changed, 16 insertions(+), 2 deletions(-)

diff --git a/font-latex.el b/font-latex.el
index 57149bda..4bea8d65 100644
--- a/font-latex.el
+++ b/font-latex.el
@@ -354,7 +354,7 @@ variable `font-latex-fontify-sectioning'." ',num)
       ("addvspace" "{") ("vspace" "*{") ("hspace" "*{")
       ("addcontentsline" "{{{") ("addtocontents" "{{")
       ("labelformat" "{{") ("linespread" "{")
-      ("AddToHook" "{[{") ("RemoveFromHook" "{[") ("AddToHookNext" "{{")
+      ("AddToHook" "{[") ("RemoveFromHook" "{[") ("AddToHookNext" "{")
       ("ProvidesClass" "{[") ("ProvidesPackage" "{[") ("ProvidesFile" "{[")
       ("NewMarkClass" "{")
       ("DeclareDocumentCommand" "|{\\{{")
diff --git a/latex.el b/latex.el
index 311c1043..e320719a 100644
--- a/latex.el
+++ b/latex.el
@@ -3686,7 +3686,9 @@ INHERIT-INPUT-METHOD are passed to
                   ;; From ltpara-doc.pdf
                   "para"
                   ;; From ltmarks-doc.pdf
-                  "insertmark")))
+                  "insertmark"
+                  ;; From ltoutput.dtx
+                  "build")))
          (place (lambda (&optional opt pr)
                   (completing-read
                    (TeX-argument-prompt opt pr "Where")
@@ -3842,6 +3844,18 @@ INHERIT-INPUT-METHOD are passed to
           ((string= hook "shipout")
            (setq where (funcall place)))
 
+          ;; build/<name>/<where>: <name> is one of (page|column) and
+          ;; <where> is one of (before|after|(reset)?)
+          ((string= hook "build")
+           (setq name (completing-read
+                       (TeX-argument-prompt nil nil "Place")
+                       '("page" "column")))
+           (setq where (if (string= name "page")
+                           (completing-read
+                            (TeX-argument-prompt nil nil "Where")
+                            '("after" "before" "reset"))
+                         (funcall place))))
+
           ;; Other hooks or user specific input, do nothing:
           (t nil))
 

Reply via email to