[Top][All Lists]

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

[patch] texinfmt.el; new var `texinfo-pre-format-hook'

From: Wedler, Christoph
Subject: [patch] texinfmt.el; new var `texinfo-pre-format-hook'
Date: Tue, 28 Oct 2003 21:28:31 +0100

When people use M-x texinfo-format-buffer together with my package
X-Symbol (<http://x-symbol.sourceforge.net/>), X-Symbol doesn't have any
chance to do its encoding, i.e., converting characters to the
corresponding TeXinfo sequences (e.g., converting รค to @"a).

The following patch should fix this (it's vs 1.68, but should also work
vs the current head revision 1.70).

2003-05-19  Christoph Wedler  <address@hidden>

        * textmodes/texinfmt.el (texinfo-pre-format-hook): New variable.
        (texinfo-format-region): Use it.
        (texinfo-format-buffer-1): Ditto.

diff -c texinfmt.el.~1.68~ texinfmt.el
*** texinfmt.el.~1.68~  Mon May 19 21:51:57 2003
--- texinfmt.el Mon May 19 21:51:57 2003
*** 134,139 ****
--- 134,144 ----
  (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,220 ****
--- 220,226 ----
       (max region-beginning header-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,386 ****
--- 387,393 ----
      (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

reply via email to

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