From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Richard Copley Newsgroups: gmane.emacs.bugs Subject: bug#37957: BibTeX dialect not set if local variables disabled Date: Mon, 28 Oct 2019 09:44:15 +0000 Message-ID: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="0000000000004eb5de0595f559fc" Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="27615"; mail-complaints-to="usenet@blaine.gmane.org" To: 37957@debbugs.gnu.org, winkler@gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Oct 28 10:47:19 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1iP1cJ-00072F-I5 for geb-bug-gnu-emacs@m.gmane.org; Mon, 28 Oct 2019 10:47:15 +0100 Original-Received: from localhost ([::1]:52138 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iP1cI-0004WY-AM for geb-bug-gnu-emacs@m.gmane.org; Mon, 28 Oct 2019 05:47:14 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:33743) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iP1c7-0004Sb-N0 for bug-gnu-emacs@gnu.org; Mon, 28 Oct 2019 05:47:05 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iP1c6-0003Wp-Do for bug-gnu-emacs@gnu.org; Mon, 28 Oct 2019 05:47:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:35023) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iP1c6-0003Wi-An for bug-gnu-emacs@gnu.org; Mon, 28 Oct 2019 05:47:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1iP1c6-0001z5-4u for bug-gnu-emacs@gnu.org; Mon, 28 Oct 2019 05:47:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Richard Copley Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 28 Oct 2019 09:47:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 37957 X-GNU-PR-Package: emacs X-Debbugs-Original-To: bug-gnu-emacs@gnu.org, Roland Winkler Original-Received: via spool by submit@debbugs.gnu.org id=B.15722559877555 (code B ref -1); Mon, 28 Oct 2019 09:47:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 28 Oct 2019 09:46:27 +0000 Original-Received: from localhost ([127.0.0.1]:43843 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iP1bW-0001xn-I3 for submit@debbugs.gnu.org; Mon, 28 Oct 2019 05:46:26 -0400 Original-Received: from lists.gnu.org ([209.51.188.17]:35565) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iP1bU-0001xb-R5 for submit@debbugs.gnu.org; Mon, 28 Oct 2019 05:46:25 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:33142) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iP1bR-0002yh-KA for bug-gnu-emacs@gnu.org; Mon, 28 Oct 2019 05:46:23 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iP1bO-0002tV-Sg for bug-gnu-emacs@gnu.org; Mon, 28 Oct 2019 05:46:21 -0400 Original-Received: from mail-ot1-x32c.google.com ([2607:f8b0:4864:20::32c]:35303) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iP1Zr-00020U-Kw; Mon, 28 Oct 2019 05:46:18 -0400 Original-Received: by mail-ot1-x32c.google.com with SMTP id z6so6218232otb.2; Mon, 28 Oct 2019 02:44:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=eLNBdsaU105TYmSyXCieCR3lBxOMuRHxCCbGvQ8aTP8=; b=oUc3quGEJBnBGbnf0+aIFCo9bqoZaxOzFNU8mKkdZK+Az2uz1VS6tma/AqLqOrlboZ PsvLeCHn1VsBngPP7UeDJtArjvxmIRaw+0K0zC02uvoxc7yzw1LXRV9XszyhYDg6wLbs GTNO2SC+DQGjT5F2nxOMh6/8t/9vLkUuikWN5ZGACnyaP87t4VyMxbSh1QxE1umar5l3 vc4kra1M+toxqxrycCEhU25S2Zbq8i1Fp+hVrDUkHHkKf1qZkVyIJS59s316DYekWkZZ owT1ePZRco73x3QzbOIDyMOZ2K2LA72zDSuAKpjWzgRuJynWqMWwGIzELG6F+nQk2Rdw uOZQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=eLNBdsaU105TYmSyXCieCR3lBxOMuRHxCCbGvQ8aTP8=; b=SCCVHuf/aNKAl/x2TvAWMysZc69iLZXQsotBKNl6cb5NeQn29EPMFUD4jN6l5UGF4G aJE/4erW3cgo1HWUm89fDU2fVta8n26yYav1gEGaEULELl5Pnvzr0e97O3NvaqG/k6es L77YdLIRSyL8Mzd61bRdDpLHw56MKo+fqHlyr+gof+jZn0T1ASVLDywceyCGpPxsY3o5 6Ocqg1frcGzN7sUSaqO3BsmRoGtyRFIhP+u9woXmF1HTJb5x9Za3Z4La6vkgJmbQBMKd Tb84ZTadEA2+vB8ezpaiO3FLodWNaxQJz4iT6UlkWhED/rWEfM0OqsioWDIwZ0SzEjez N2OA== X-Gm-Message-State: APjAAAUdmCue3VsHgQqMdnSs6naeQu8Uk06c9U6BKHYfzKEbu4IOe0vn crnahw8ibOfUQzCr5t1JOQ97T0+SOyCoMI04ZgSa94v2ZGQ= X-Google-Smtp-Source: APXvYqzTvjlkHgCZKb0QoK+66OvBwokDQefyPGIfl6AmYe8lBEpz5JTUV2f+FhP1ZTk/QKoebKyNcZ5rFwous5gMy1s= X-Received: by 2002:a05:6830:1b6d:: with SMTP id d13mr8036349ote.294.1572255881408; Mon, 28 Oct 2019 02:44:41 -0700 (PDT) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.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" Xref: news.gmane.org gmane.emacs.bugs:170288 Archived-At: --0000000000004eb5de0595f559fc Content-Type: text/plain; charset="UTF-8" >From "emacs -Q", * Set the variable 'enable-local-variables' to nil. * Visit a BibTeX (*.bib) file. * Wait one minute or eval (bibtex-parse-buffers-stealthily). Lisp error: (wrong-type-argument number-or-marker-p nil) Backtrace: 1+(nil) (buffer-substring-no-properties (1+ (match-beginning bibtex-type-in-head)) (match-end bibtex-type-in-head)) bibtex-type-in-head() (assoc-string (bibtex-type-in-head) bibtex-entry-alist t) [...] bibtex-parse-keys(t) bibtex-parse-buffers-stealthily() [...] On visiting a BibTeX file, if enable-local-variables is nil, 'bibtex-set-dialect' doesn't get called. This causes errors later on. For example, when 'bibtex-parse-buffers-stealthily' is called, we get the above error, because 'bibtex-entry-head' has not been set. Glancing at the history of 'bibtex-major-mode', this commit seems a likely candidate: ace88aa20f32b298e7f2e8e6115b5661504f8724 Author: Roland Winkler AuthorDate: Sat Jan 28 12:06:10 2012 -0600 lisp/textmodes/bibtex.el: allow bibtex-dialect as file-local variable (Bug#10254) --0000000000004eb5de0595f559fc Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
From "emacs -Q",
* Set the variable 'enab= le-local-variables' to nil.
* Visit a BibTeX (*.bib) file.
* Wait= one minute or eval (bibtex-parse-buffers-stealthily).

Lisp error: (= wrong-type-argument number-or-marker-p nil)
Backtrace:
=C2=A0 1+(nil)=
=C2=A0 (buffer-substring-no-properties (1+ (match-beginning bibtex-type= -in-head)) (match-end bibtex-type-in-head))
=C2=A0 bibtex-type-in-head()=
=C2=A0 (assoc-string (bibtex-type-in-head) bibtex-entry-alist t)
=C2= =A0 [...]
=C2=A0 bibtex-parse-keys(t)
=C2=A0 bibtex-parse-buffers-ste= althily()
=C2=A0 [...]

On visiting a BibTeX file, if enable-local= -variables is nil, 'bibtex-set-dialect' doesn't get called. Thi= s causes errors later on. For example, when 'bibtex-parse-buffers-steal= thily' is called, we get the above error, because 'bibtex-entry-hea= d' has not been set. Glancing at the history of=C2=A0 'bibtex-major= -mode', this commit seems a likely candidate:

ace88aa20f32b298e7= f2e8e6115b5661504f8724
Author: Roland Winkler <winkler@gnu.org>
AuthorDate: Sat Jan 28 12:06:10 201= 2 -0600

lisp/textmodes/bibtex.el: allow bibtex-dialect as file-= local variable (Bug#10254)

--0000000000004eb5de0595f559fc--