branch: externals/auctex
commit 5d951fea037f77b47cdbd72a44bd812715fd46da
Author: Ikumi Keita <[email protected]>
Commit: Ikumi Keita <[email protected]>
Fix bibtex dialect
* tex.el (TeX-auto-store): Use `(or :bibtex :latex)' instead of
`:bibtex' as dialect argument for `TeX-add-style-hook' when saving auto
file for BibTeX file.
---
tex.el | 19 +++++++++++++++++--
1 file changed, 17 insertions(+), 2 deletions(-)
diff --git a/tex.el b/tex.el
index 9188ccd74d..6b80b4e80c 100644
--- a/tex.el
+++ b/tex.el
@@ -4101,7 +4101,8 @@ If TEX is a directory, generate style files for all files
in the directory."
LaTeX-verbatim-macros-with-delims-local))
(verb-macros-braces (when (boundp
'LaTeX-verbatim-macros-with-braces-local)
LaTeX-verbatim-macros-with-braces-local))
- (dialect TeX-style-hook-dialect))
+ (dialect TeX-style-hook-dialect)
+ (bibtex-p (eq major-mode 'bibtex-mode)))
(TeX-unload-style style)
(with-current-buffer (generate-new-buffer file)
(erase-buffer)
@@ -4131,7 +4132,21 @@ If TEX is a directory, generate style files for all
files in the directory."
(mapc (lambda (el) (TeX-auto-insert el style))
TeX-auto-parser)
(insert ")")
- (if dialect (insert (concat "\n " (prin1-to-string dialect))))
+ (if dialect (insert (concat
+ "\n "
+ (prin1-to-string
+ (if bibtex-p
+ ;; Add :latex since functions such
+ ;; as `LaTeX-add-bibitems' are
+ ;; only meaningful in LaTeX
+ ;; document buffer.
+ ;; FIXME: BibTeX is available to
+ ;; plain TeX through eplain
+ ;;
(<URL:https://tug.org/eplain/doc/eplain.html#Citations>).
+ ;; It would be nice if AUCTeX
+ ;; supports such usage.
+ `'(or ,dialect :latex)
+ dialect)))))
(insert ")\n\n")
(write-region (point-min) (point-max) file nil 'silent)
(kill-buffer (current-buffer))))
_______________________________________________
auctex-diffs mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/auctex-diffs