From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Glenn Morris Newsgroups: gmane.emacs.bugs Subject: bug#10254: 24.0.92; Local variable bibtex-dialect has no effect Date: Mon, 09 Jan 2012 20:24:45 -0500 Message-ID: <2rfwfoz6w2.fsf@fencepost.gnu.org> References: <844nxakxtd.fsf@tum.de> <4EE32275.26106.E38FFC3@uwe.siart.tum.de> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: dough.gmane.org 1326158756 24253 80.91.229.12 (10 Jan 2012 01:25:56 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Tue, 10 Jan 2012 01:25:56 +0000 (UTC) Cc: Roland Winkler , 10254@debbugs.gnu.org To: "Uwe Siart" Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Jan 10 02:25:51 2012 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1RkQTG-0007Xl-NX for geb-bug-gnu-emacs@m.gmane.org; Tue, 10 Jan 2012 02:25:50 +0100 Original-Received: from localhost ([::1]:58241 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RkQTG-0005QG-83 for geb-bug-gnu-emacs@m.gmane.org; Mon, 09 Jan 2012 20:25:50 -0500 Original-Received: from eggs.gnu.org ([140.186.70.92]:33695) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RkQTC-0005QB-DA for bug-gnu-emacs@gnu.org; Mon, 09 Jan 2012 20:25:47 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RkQTB-0002KD-AJ for bug-gnu-emacs@gnu.org; Mon, 09 Jan 2012 20:25:46 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:56862) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RkQTB-0002K9-7H for bug-gnu-emacs@gnu.org; Mon, 09 Jan 2012 20:25:45 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1RkQTR-0002iY-Km for bug-gnu-emacs@gnu.org; Mon, 09 Jan 2012 20:26:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Glenn Morris Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 10 Jan 2012 01:26:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 10254 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 10254-submit@debbugs.gnu.org id=B10254.132615870810380 (code B ref 10254); Tue, 10 Jan 2012 01:26:01 +0000 Original-Received: (at 10254) by debbugs.gnu.org; 10 Jan 2012 01:25:08 +0000 Original-Received: from localhost ([127.0.0.1]:51535 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1RkQSZ-0002hM-EM for submit@debbugs.gnu.org; Mon, 09 Jan 2012 20:25:07 -0500 Original-Received: from fencepost.gnu.org ([140.186.70.10]:57218) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1RkQSW-0002hD-8I for 10254@debbugs.gnu.org; Mon, 09 Jan 2012 20:25:05 -0500 Original-Received: from rgm by fencepost.gnu.org with local (Exim 4.71) (envelope-from ) id 1RkQSD-0007Ud-FQ; Mon, 09 Jan 2012 20:24:45 -0500 X-Spook: Rand Corporation Cohiba PLO enforcers Mena Rule Psix X-Ran: /b2@Y7e3]><(>O1l~bD&.yj[IH'Y|g+M%;4H]7Ook]h7@tSTT"1+k645@r+o)u*5;F`:rg X-Hue: blue X-Attribution: GM In-Reply-To: <4EE32275.26106.E38FFC3@uwe.siart.tum.de> (Uwe Siart's message of "Sat, 10 Dec 2011 10:12:21 +0100") User-Agent: Gnus (www.gnus.org), GNU Emacs (www.gnu.org/software/emacs/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:55595 Archived-At: 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),