branch: externals/auctex commit 2d0c70114e5c475f311c1c481dae060c3e2cd882 Author: Paul Nelson <ultr...@gmail.com> Commit: Arash Esbati <ar...@gnu.org>
Allow multiple preview preprocessors * preview.el.in (preview-preprocessor-functions): New variable, replacing `preview-preprocessor-function'. (preview-region): Use it. (bug#70607) --- preview.el.in | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/preview.el.in b/preview.el.in index 9f7db67445..72568be781 100644 --- a/preview.el.in +++ b/preview.el.in @@ -4120,9 +4120,9 @@ stored in `preview-dumped-alist'." (preview-format-kill old-format) (setcdr old-format nil)) -(defvar preview-preprocess-function nil - "Function used to preprocess region before previewing. -The function bound to this variable will be called inside +(defvar preview-preprocess-functions nil + "List of functions used to preprocess region before previewing. +The functions in this variable will each be called inside `preview-region' with one argument which is a string.") (defun preview-region (begin end) @@ -4134,9 +4134,9 @@ The function bound to this variable will be called inside TeX-region-extra))) (TeX-region-create (TeX-region-file TeX-default-extension) (let ((str (buffer-substring-no-properties begin end))) - (if preview-preprocess-function - (funcall preview-preprocess-function str) - str)) + (dolist (fun preview-preprocess-functions) + (setq str (funcall fun str))) + str) (if (TeX-buffer-file-name) (file-name-nondirectory (TeX-buffer-file-name)) "<none>")