From: Glenn Morris <rgm@gnu.org>
To: "Uwe Siart" <uwe.siart@tum.de>
Cc: Roland Winkler <winkler@gnu.org>, 10254@debbugs.gnu.org
Subject: bug#10254: 24.0.92; Local variable bibtex-dialect has no effect
Date: Mon, 09 Jan 2012 20:24:45 -0500 [thread overview]
Message-ID: <2rfwfoz6w2.fsf@fencepost.gnu.org> (raw)
In-Reply-To: <4EE32275.26106.E38FFC3@uwe.siart.tum.de> (Uwe Siart's message of "Sat, 10 Dec 2011 10:12:21 +0100")
A better solution would be something like the following. However, it
seems that at present bibtex.el is simply not set up to handle a
buffer-local dialect. Eg none of the variables set by bibtex-set-dialect
(bibtex-entry-type etc) are buffer-local. So it won't work right if you
open multiple buffers with different dialects.
*** lisp/textmodes/bibtex.el 2012-01-05 09:46:05 +0000
--- lisp/textmodes/bibtex.el 2012-01-10 01:19:18 +0000
***************
*** 836,841 ****
--- 836,842 ----
:type '(choice (const BibTeX)
(const biblatex)
(symbol :tag "Custom")))
+ ;;;###autoload(put 'bibtex-dialect 'safe-local-variable 'symbolp)
(defcustom bibtex-no-opt-remove-re "\\`option"
"If a field name matches this regexp, the prefix OPT is not removed.
***************
*** 3376,3382 ****
(setq imenu-generic-expression
(list (list nil bibtex-entry-head bibtex-key-in-head))
imenu-case-fold-search t)
! (bibtex-set-dialect bibtex-dialect))
(defun bibtex-set-dialect (dialect)
"Select BibTeX mode DIALECT.
--- 3377,3383 ----
(setq imenu-generic-expression
(list (list nil bibtex-entry-head bibtex-key-in-head))
imenu-case-fold-search t)
! (add-hook 'hack-local-variables-hook 'bibtex-hack-local-variables nil t))
(defun bibtex-set-dialect (dialect)
"Select BibTeX mode DIALECT.
***************
*** 3475,3480 ****
--- 3476,3486 ----
t))
bibtex-dialect-list))))))))
+ (defun bibtex-hack-local-variables ()
+ "BibTex mode adds this to `hack-local-variables-hook'."
+ ;; Respect any buffer-local setting of bibtex-dialect (bug#10254).
+ (bibtex-set-dialect bibtex-dialect))
+
(defun bibtex-field-list (entry-type)
"Return list of allowed fields for entry ENTRY-TYPE.
More specifically, the return value is a cons pair (REQUIRED . OPTIONAL),
next prev parent reply other threads:[~2012-01-10 1:24 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-12-09 7:29 bug#10254: 24.0.92; Local variable bibtex-dialect has no effect Uwe Siart
2011-12-10 7:43 ` Glenn Morris
2011-12-10 9:12 ` Uwe Siart
2012-01-10 1:24 ` Glenn Morris [this message]
2012-01-10 18:33 ` Roland Winkler
2012-01-11 6:41 ` Uwe Siart
2012-01-11 10:46 ` Roland Winkler
2012-01-11 14:57 ` Uwe Siart
2012-01-15 9:04 ` Roland Winkler
2012-01-16 14:14 ` Stefan Monnier
2012-01-16 22:21 ` Roland Winkler
2012-01-17 5:44 ` Uwe Siart
2012-01-17 14:04 ` Stefan Monnier
2012-01-17 20:45 ` Roland Winkler
2012-01-17 21:21 ` Stefan Monnier
2012-01-28 8:17 ` Roland Winkler
2012-01-28 14:05 ` Chong Yidong
2012-01-28 18:13 ` Roland Winkler
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=2rfwfoz6w2.fsf@fencepost.gnu.org \
--to=rgm@gnu.org \
--cc=10254@debbugs.gnu.org \
--cc=uwe.siart@tum.de \
--cc=winkler@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).