Backport commit 2b5d43081 from Emacs

* lisp/ox.el (org-export-to-buffer): Modernize docstring accordingly.
* lisp/ox-latex.el (org-latex-export-as-latex):
* lisp/ox-koma-letter.el (org-koma-letter-export-as-latex):
* lisp/ox-beamer.el (org-beamer-export-as-latex):
Use `major-mode-remap` when available.

(major-mode-remap(-defaults)): New var and function (bug#69191)
2b5d43081a30f816dd38a16c7b5bfbad712a779b
Stefan Monnier
Sun Mar 3 23:58:18 2024 -0500
This commit is contained in:
Stefan Monnier 2024-03-03 23:08:16 -05:00 committed by Kyle Meyer
parent e8fe9642b0
commit ab62bdd79f
4 changed files with 12 additions and 4 deletions

View File

@ -1008,7 +1008,10 @@ will be displayed when `org-export-show-temporary-export-buffer'
is non-nil." is non-nil."
(interactive) (interactive)
(org-export-to-buffer 'beamer "*Org BEAMER Export*" (org-export-to-buffer 'beamer "*Org BEAMER Export*"
async subtreep visible-only body-only ext-plist (lambda () (LaTeX-mode)))) async subtreep visible-only body-only ext-plist
(if (fboundp 'major-mode-remap)
(major-mode-remap 'latex-mode)
#'LaTeX-mode)))
;;;###autoload ;;;###autoload
(defun org-beamer-export-to-latex (defun org-beamer-export-to-latex

View File

@ -911,7 +911,9 @@ non-nil."
(let (org-koma-letter-special-contents) (let (org-koma-letter-special-contents)
(org-export-to-buffer 'koma-letter "*Org KOMA-LETTER Export*" (org-export-to-buffer 'koma-letter "*Org KOMA-LETTER Export*"
async subtreep visible-only body-only ext-plist async subtreep visible-only body-only ext-plist
(lambda () (LaTeX-mode))))) (if (fboundp 'major-mode-remap)
(major-mode-remap 'latex-mode)
#'LaTeX-mode))))
;;;###autoload ;;;###autoload
(defun org-koma-letter-export-to-latex (defun org-koma-letter-export-to-latex

View File

@ -4160,7 +4160,10 @@ will be displayed when `org-export-show-temporary-export-buffer'
is non-nil." is non-nil."
(interactive) (interactive)
(org-export-to-buffer 'latex "*Org LATEX Export*" (org-export-to-buffer 'latex "*Org LATEX Export*"
async subtreep visible-only body-only ext-plist (lambda () (LaTeX-mode)))) async subtreep visible-only body-only ext-plist
(if (fboundp 'major-mode-remap)
(major-mode-remap 'latex-mode)
#'LaTeX-mode)))
;;;###autoload ;;;###autoload
(defun org-latex-convert-region-to-latex () (defun org-latex-convert-region-to-latex ()

View File

@ -6608,7 +6608,7 @@ use it to set a major mode there, e.g.,
(interactive) (interactive)
(org-export-to-buffer \\='latex \"*Org LATEX Export*\" (org-export-to-buffer \\='latex \"*Org LATEX Export*\"
async subtreep visible-only body-only ext-plist async subtreep visible-only body-only ext-plist
#\\='LaTeX-mode)) (major-mode-remap 'latex-mode)))
When expressed as an anonymous function, using `lambda', When expressed as an anonymous function, using `lambda',
POST-PROCESS needs to be quoted. POST-PROCESS needs to be quoted.