From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: =?UTF-8?Q?Gr=C3=A9goire?= Jadi Newsgroups: gmane.emacs.bugs Subject: bug#21764: 25.0.50; bibtex-set-dialect not called for bibtex buffers Date: Thu, 12 Nov 2015 15:39:28 +0100 Message-ID: <87fv0bb7tr.fsf@univ-nantes.fr> References: <871tchpr46.fsf@univ-nantes.fr> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/signed; boundary="==-=-="; micalg=pgp-sha1; protocol="application/pgp-signature" X-Trace: ger.gmane.org 1447339248 776 80.91.229.3 (12 Nov 2015 14:40:48 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 12 Nov 2015 14:40:48 +0000 (UTC) To: 21764@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Nov 12 15:40:33 2015 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Zwt3A-00086L-J6 for geb-bug-gnu-emacs@m.gmane.org; Thu, 12 Nov 2015 15:40:32 +0100 Original-Received: from localhost ([::1]:47056 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zwt39-0000FV-PA for geb-bug-gnu-emacs@m.gmane.org; Thu, 12 Nov 2015 09:40:31 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:51401) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zwt2n-00087B-H3 for bug-gnu-emacs@gnu.org; Thu, 12 Nov 2015 09:40:10 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Zwt2h-0000ur-Ca for bug-gnu-emacs@gnu.org; Thu, 12 Nov 2015 09:40:09 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:43573) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zwt2h-0000uf-1c for bug-gnu-emacs@gnu.org; Thu, 12 Nov 2015 09:40:03 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1Zwt2g-0002zM-Oo for bug-gnu-emacs@gnu.org; Thu, 12 Nov 2015 09:40:02 -0500 X-Loop: help-debbugs@gnu.org In-Reply-To: <871tchpr46.fsf@univ-nantes.fr> Resent-From: =?UTF-8?Q?Gr=C3=A9goire?= Jadi Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 12 Nov 2015 14:40:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 21764 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 21764-submit@debbugs.gnu.org id=B21764.144733917711442 (code B ref 21764); Thu, 12 Nov 2015 14:40:02 +0000 Original-Received: (at 21764) by debbugs.gnu.org; 12 Nov 2015 14:39:37 +0000 Original-Received: from localhost ([127.0.0.1]:34281 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Zwt2G-0002yS-BU for submit@debbugs.gnu.org; Thu, 12 Nov 2015 09:39:37 -0500 Original-Received: from smtptls1-cha.cpub.univ-nantes.fr ([193.52.103.113]:55699 helo=smtp-tls.univ-nantes.fr) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Zwt29-0002yE-Ux for 21764@debbugs.gnu.org; Thu, 12 Nov 2015 09:39:31 -0500 Original-Received: from localhost (localhost [127.0.0.1]) by smtp-tls.univ-nantes.fr (Postfix) with ESMTP id E95AF40152C for <21764@debbugs.gnu.org>; Thu, 12 Nov 2015 15:39:27 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at smtptls1-lmb.cpub.univ-nantes.fr Original-Received: from smtp-tls.univ-nantes.fr ([127.0.0.1]) by localhost (smtptls1-cha.cpub.univ-nantes.fr [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 3WQJh1dL0iSC for <21764@debbugs.gnu.org>; Thu, 12 Nov 2015 15:39:27 +0100 (CET) Original-Received: from localhost (ipcop.lina.sciences.univ-nantes.fr [193.52.105.131]) (using TLSv1.2 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by smtp-tls.univ-nantes.fr (Postfix) with ESMTPSA id B20FC40152A for <21764@debbugs.gnu.org>; Thu, 12 Nov 2015 15:39:27 +0100 (CET) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 208.118.235.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:108649 Archived-At: --==-=-= Content-Type: multipart/mixed; boundary="=-=-=" --=-=-= Content-Type: text/plain Hi, Below a patch that fixes this bug and with regression tests. Comments welcome. PS: I've signed the FSF paperwork my number is #793656 --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=0001-Ensure-bibtex-set-dialect-is-executed-in-bibtex-buff.patch Content-Transfer-Encoding: quoted-printable From=2085abad38ea1f45ad92794803ddd39e6196cc9582 Mon Sep 17 00:00:00 2001 From: =3D?UTF-8?q?Gr=3DC3=3DA9goire=3D20Jadi?=3D Date: Thu, 12 Nov 2015 15:29:20 +0100 Subject: [PATCH] Ensure `bibtex-set-dialect' is executed in bibtex buffers Call `bibtex-set-dialect' at least once in bibtex buffers even if they are not associated with a file (Bug#21764). * lisp/textmodes/bibtex.el (bibtex-mode): Call `bibtex-set-dialect'. * test/automated/bibtex-tests.el: Add regression tests. =2D-- lisp/textmodes/bibtex.el | 1 + test/automated/bibtex-tests.el | 57 ++++++++++++++++++++++++++++++++++++++= ++++ 2 files changed, 58 insertions(+) create mode 100644 test/automated/bibtex-tests.el diff --git a/lisp/textmodes/bibtex.el b/lisp/textmodes/bibtex.el index df8066e..4400354 100644 =2D-- a/lisp/textmodes/bibtex.el +++ b/lisp/textmodes/bibtex.el @@ -3405,6 +3405,7 @@ bibtex-mode (set (make-local-variable 'syntax-propertize-function) (syntax-propertize-via-font-lock bibtex-font-lock-syntactic-keywords)) + (bibtex-set-dialect nil t) ;; Allow `bibtex-dialect' as a file-local variable. (add-hook 'hack-local-variables-hook 'bibtex-set-dialect nil t)) =20 diff --git a/test/automated/bibtex-tests.el b/test/automated/bibtex-tests.el new file mode 100644 index 0000000..33f53a0 =2D-- /dev/null +++ b/test/automated/bibtex-tests.el @@ -0,0 +1,57 @@ +;;; bibtex-tests.el --- Test suite for bibtex. + +;; Copyright (C) 2013-2015 Free Software Foundation, Inc. + +;; Keywords: bibtex + +;; This file is part of GNU Emacs. + +;; GNU Emacs is free software: you can redistribute it and/or modify +;; it under the terms of the GNU General Public License as published by +;; the Free Software Foundation, either version 3 of the License, or +;; (at your option) any later version. + +;; GNU Emacs is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;; GNU General Public License for more details. + +;; You should have received a copy of the GNU General Public License +;; along with GNU Emacs. If not, see . + +;;; Commentary: + +;;; Code: + +(require 'ert) +(require 'bibtex) + +(ert-deftest bibtex-test-set-dialect () + "Tests if `bibtex-set-dialect' is executed." + (with-temp-buffer + (insert "@article{someID, + author =3D {some author}, + title =3D {some title}, +}") + (bibtex-mode) + (should-not (null bibtex-dialect)) + (should-not (null bibtex-entry-type)) + (should-not (null bibtex-entry-head)) + (should-not (null bibtex-reference-key)) + (should-not (null bibtex-entry-head)) + (should-not (null bibtex-entry-maybe-empty-head)) + (should-not (null bibtex-any-valid-entry-type)))) + +(ert-deftest bibtex-test-parse-buffers-stealthily () + "Tests if `bibtex-parse-buffers-stealthily' can be executed." + (with-temp-buffer + (insert "@article{someID, + author =3D {some author}, + title =3D {some title}, +}") + (bibtex-mode) + (should (progn (bibtex-parse-buffers-stealthily) t)))) + +(provide 'bibtex-tests) + +;;; bibtex-tests.el ends here =2D-=20 1.9.1 --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable =2D-=20 Gr=C3=A9goire Jadi --=-=-=-- --==-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBAgAGBQJWRKShAAoJEBNzVHcrZRiUYtUP/3+C/HPsW+KQ4m7iKl7CkDc9 09GWNutyVt6G2RlLd+hsJvNSuNYoxsQGEylLa250MRpyCc89DjZwXQ+pUPBsZfEv Rz1xQPz3ue9r2h0TzO/9jQA4jJ0RIIenkX+SMXevDlbildeooQNhS2AT7RcepYy8 nApwRVvrfXLgoZRhSKg2AxV2BAlrUwZks1QJsFH4gYBHOsmacg4a0VZZBfSckvEW tqMauh4OeECjNamFe8i77U3dPdpGshm1UuFaO8q6EuqvBcg5LJGHHNAC0xARTL/S IpMAv0o7TwvGfbayG4RflCVXXsoPsKEV0aqqjZeTvVTCNVUhIqplWpzs4v9N2wDp Ax618szqgoCyGxNRtAVZk36iluSrYaefE+unOx4KyinM+rBivPfTgH29m3DVmNz1 xeF5MUR6R76XsyWU/jwMqOp+hh/Ei//or3e33ap9/1kk5ra59tXedsX1wIpi9dWQ 0datjfRUSLKBVBqs8pKfPwVX8iSNOfK/2Na//V908VzLdhuDGZReGx2mQraUq6SN Jd8aoYERkbeMRjQRJskGawe8tH8eZAsRgpbX+uKB++Zf6uNqZknK5k79t7YmtlX6 KtaQYcf6Sf2YndOjPYRuROjIXTUNPs7iCrVzgjbEK4wFh9AWSu3G16AJtR1LHqac zgcgv6ZlGVs27zwokcjr =Z1dI -----END PGP SIGNATURE----- --==-=-=--