Function: bibtex-set-dialect
bibtex-set-dialect is an interactive and byte-compiled function
defined in bibtex.el.gz.
Signature
(bibtex-set-dialect &optional DIALECT LOCAL)
Documentation
Select BibTeX DIALECT for editing BibTeX files.
This sets the user variable bibtex-dialect as well as the dialect-dependent
internal variables. Allowed dialects are listed in bibtex-dialect-list.
If DIALECT is nil use current value of bibtex-dialect.
If LOCAL is non-nil make buffer-local bindings for these variables rather than
setting the global values. The dialect-dependent internal variables
are also bound buffer-locally if bibtex-dialect is already buffer-local
in the current buffer (for example, as a file-local variable).
LOCAL is t for interactive calls.
Key Bindings
Source Code
;; Defined in /usr/src/emacs/lisp/textmodes/bibtex.el.gz
(defun bibtex-set-dialect (&optional dialect local)
"Select BibTeX DIALECT for editing BibTeX files.
This sets the user variable `bibtex-dialect' as well as the dialect-dependent
internal variables. Allowed dialects are listed in `bibtex-dialect-list'.
If DIALECT is nil use current value of `bibtex-dialect'.
If LOCAL is non-nil make buffer-local bindings for these variables rather than
setting the global values. The dialect-dependent internal variables
are also bound buffer-locally if `bibtex-dialect' is already buffer-local
in the current buffer (for example, as a file-local variable).
LOCAL is t for interactive calls."
(interactive (list (intern (completing-read "Dialect: "
(mapcar #'list bibtex-dialect-list)
nil t))
t))
(let ((setfun (if (or local (local-variable-p 'bibtex-dialect))
(lambda (var val) (set (make-local-variable var) val))
'set)))
(if dialect (funcall setfun 'bibtex-dialect dialect))
;; Set internal variables
(funcall setfun 'bibtex-entry-alist (bibtex-entry-alist bibtex-dialect))
(funcall setfun 'bibtex-field-alist
(let ((var (intern (format "bibtex-%s-field-alist"
bibtex-dialect))))
(if (boundp var)
(symbol-value var)
(user-error "Field types for BibTeX dialect `%s' undefined"
bibtex-dialect))))
(funcall setfun 'bibtex-entry-type
(concat "@[ \t]*\\(?:"
(regexp-opt (mapcar #'car bibtex-entry-alist)) "\\)"))
(funcall setfun 'bibtex-entry-head
(concat "^[ \t]*\\(" bibtex-entry-type "\\)[ \t]*[({][ \t\n]*\\("
bibtex-reference-key "\\)"))
(funcall setfun 'bibtex-entry-maybe-empty-head
(concat bibtex-entry-head "?"))
(funcall setfun 'bibtex-any-valid-entry-type
(concat "^[ \t]*@[ \t]*\\(?:"
(regexp-opt
(append '("String" "Preamble")
(mapcar #'car bibtex-entry-alist))) "\\)"))
(setq imenu-generic-expression
(list (list nil bibtex-entry-head bibtex-key-in-head))
imenu-case-fold-search t)))