# HG changeset patch # User Eli Zaretskii # Date 1067706690 0 # Node ID d60ea4b622fe7d6585a4b471c61e4ea1472b2f51 # Parent f785910734e87220c06f18b56a86cfa6ae6a4c69 (texinfo-pre-format-hook): New variable. (texinfo-format-region): Use it. (texinfo-format-buffer-1): Ditto. diff -r f785910734e8 -r d60ea4b622fe lisp/textmodes/texinfmt.el --- a/lisp/textmodes/texinfmt.el Sat Nov 01 17:06:00 2003 +0000 +++ b/lisp/textmodes/texinfmt.el Sat Nov 01 17:11:30 2003 +0000 @@ -134,6 +134,11 @@ (defvar texinfo-region-buffer-name "*Info Region*" "*Name of the temporary buffer used by \\[texinfo-format-region].") +(defvar texinfo-pre-format-hook nil + "Hook called before the conversion of the Texinfo file to Info format. +The functions on this hook are called with argument BUFFER, the buffer +containing the Texinfo file.") + ;; These come from tex-mode.el. (defvar tex-start-of-header) (defvar tex-end-of-header) @@ -215,6 +220,7 @@ input-buffer (max region-beginning header-end) region-end) + (run-hook-with-args 'texinfo-pre-format-hook input-buffer) ;; Make sure region ends in a newline. (or (= (preceding-char) ?\n) (insert "\n")) @@ -381,6 +387,7 @@ (set-syntax-table texinfo-format-syntax-table) (insert-buffer-substring input-buffer) + (run-hook-with-args 'texinfo-pre-format-hook input-buffer) (message "Converting %s to Info format..." (buffer-name input-buffer)) ;; Insert @include files so `texinfo-raise-lower-sections' can