From unknown Tue Jun 17 21:57:27 2025 X-Loop: help-debbugs@gnu.org Subject: bug#33810: 26.1.50; bibtex initializes some global vars after opening a file Resent-From: Konstantin Reich Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 20 Dec 2018 09:02:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 33810 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 33810@debbugs.gnu.org X-Debbugs-Original-To: bug-gnu-emacs Received: via spool by submit@debbugs.gnu.org id=B.154529651528918 (code B ref -1); Thu, 20 Dec 2018 09:02:02 +0000 Received: (at submit) by debbugs.gnu.org; 20 Dec 2018 09:01:55 +0000 Received: from localhost ([127.0.0.1]:55456 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gZuDK-0007WM-VT for submit@debbugs.gnu.org; Thu, 20 Dec 2018 04:01:55 -0500 Received: from eggs.gnu.org ([208.118.235.92]:45153) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gZuDI-0007W6-KP for submit@debbugs.gnu.org; Thu, 20 Dec 2018 04:01:53 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gZuD4-0005pq-4I for submit@debbugs.gnu.org; Thu, 20 Dec 2018 04:01:47 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,FREEMAIL_FROM autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:33281) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gZuD3-0005pT-Uq for submit@debbugs.gnu.org; Thu, 20 Dec 2018 04:01:38 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54720) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gZuD2-0003fO-11 for bug-gnu-emacs@gnu.org; Thu, 20 Dec 2018 04:01:37 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gZuCw-0005lN-Ci for bug-gnu-emacs@gnu.org; Thu, 20 Dec 2018 04:01:35 -0500 Received: from forward400j.mail.yandex.net ([5.45.198.245]:56222) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gZuCv-0005gQ-V1 for bug-gnu-emacs@gnu.org; Thu, 20 Dec 2018 04:01:30 -0500 Received: from mxback20g.mail.yandex.net (mxback20g.mail.yandex.net [IPv6:2a02:6b8:0:1472:2741:0:8b7:320]) by forward400j.mail.yandex.net (Yandex) with ESMTP id A59BC6E0CC4 for ; Thu, 20 Dec 2018 12:01:24 +0300 (MSK) Received: from localhost (localhost [::1]) by mxback20g.mail.yandex.net (nwsmtp/Yandex) with ESMTP id ZNzikuG5jz-1N1qpjEI; Thu, 20 Dec 2018 12:01:24 +0300 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1545296484; bh=8BxLpCuDhrHsFH4omeVhPGA51vJaRWdW4Lu9+r5As6o=; h=From:To:Subject:Date:Message-Id; b=wSeJDDh8HxA0v1zCG0Ls8qwPm0O5MzpYeK3TvvqnqsCE7AILlSYAjtqznf7z5Soaj NCIqghyGfZXtcoC3CokPlrQZRqmBemjY2/DgGTFXyeRBBjl8peH4ZPUuvE6eD/9o37 C9yRLqayy89FVf8dYvomugV2M2b2uh5Gt4vm4HzY= Authentication-Results: mxback20g.mail.yandex.net; dkim=pass header.i=@yandex.ru Received: by sas2-b4ed770db137.qloud-c.yandex.net with HTTP; Thu, 20 Dec 2018 12:01:23 +0300 From: Konstantin Reich Envelope-From: reich-cv@yandex.ru MIME-Version: 1.0 X-Mailer: Yamail [ http://yandex.ru ] 5.0 Date: Thu, 20 Dec 2018 12:01:23 +0300 Message-Id: <9935781545296483@sas2-b4ed770db137.qloud-c.yandex.net> Content-Transfer-Encoding: 7bit Content-Type: text/plain X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -4.0 (----) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) Hey, i am using emacs 26.1.50 When i ran the following code in just started emacs -Q (with-temp-buffer (insert "@article{aaaa, author = {AAA}, title = {BBBB} }") (bibtex-mode) (bibtex-autokey-get-field "title")) I get the following error: Debugger entered--Lisp error: (wrong-type-argument stringp nil) looking-at(nil) bibtex-valid-entry(t) bibtex-end-of-entry() bibtex-text-in-field("title" t) bibtex-autokey-get-field("title") (progn (insert "@article{aaaa,\n author = {AAA},\n title = {BBBB}\n }") (bibtex-mode) (bibtex-autokey-get-field "title")) (unwind-protect (progn (insert "@article{aaaa,\n author = {AAA},\n title = {BBBB}\n }") (bibtex-mode) (bibtex-autokey-get-field "title")) (and (buffer-name temp-buffer) (kill-buffer temp-buffer))) (save-current-buffer (set-buffer temp-buffer) (unwind-protect (progn (insert "@article{aaaa,\n author = {AAA},\n title = {BBBB}\n }") (bibtex-mode) (bibtex-autokey-get-field "title")) (and (buffer-name temp-buffer) (kill-buffer temp-buffer)))) (let ((temp-buffer (generate-new-buffer " *temp*"))) (save-current-buffer (set-buffer temp-buffer) (unwind-protect (progn (insert "@article{aaaa,\n author = {AAA},\n title = {BBBB}\n }") (bibtex-mode) (bibtex-autokey-get-field "title")) (and (buffer-name temp-buffer) (kill-buffer temp-buffer))))) eval((let ((temp-buffer (generate-new-buffer " *temp*"))) (save-current-buffer (set-buffer temp-buffer) (unwind-protect (progn (insert "@article{aaaa,\n author = {AAA},\n title = {BBBB}\n }") (bibtex-mode) (bibtex-autokey-get-field "title")) (and (buffer-name temp-buffer) (kill-buffer temp-buffer))))) nil) elisp--eval-last-sexp(t) eval-last-sexp(t) eval-print-last-sexp(nil) funcall-interactively(eval-print-last-sexp nil) call-interactively(eval-print-last-sexp nil nil) command-execute(eval-print-last-sexp) After i open any bibtex file the above code works as expected. (I get "BBBB") Also everything works if I add (bibtex-set-dialect) after (bibtex-mode). In (https://emacs.stackexchange.com/questions/46691/package-initialization/46693#46693) I was told that it is some kind of bug due to bibtex initializes some global vars only after opening a file. From unknown Tue Jun 17 21:57:27 2025 X-Loop: help-debbugs@gnu.org Subject: bug#33810: 26.1.50; bibtex initializes some global vars after opening a file Resent-From: Lars Ingebrigtsen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 09 Jul 2019 23:30:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 33810 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Konstantin Reich Cc: 33810@debbugs.gnu.org Received: via spool by 33810-submit@debbugs.gnu.org id=B33810.15627149628894 (code B ref 33810); Tue, 09 Jul 2019 23:30:03 +0000 Received: (at 33810) by debbugs.gnu.org; 9 Jul 2019 23:29:22 +0000 Received: from localhost ([127.0.0.1]:34515 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hkzY1-0002JO-9p for submit@debbugs.gnu.org; Tue, 09 Jul 2019 19:29:21 -0400 Received: from quimby.gnus.org ([80.91.231.51]:55676) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hkzXy-0002J8-Uk for 33810@debbugs.gnu.org; Tue, 09 Jul 2019 19:29:19 -0400 Received: from cm-84.212.202.86.getinternet.no ([84.212.202.86] helo=marnie) by quimby.gnus.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1hkzXt-0001xM-OQ; Wed, 10 Jul 2019 01:29:16 +0200 From: Lars Ingebrigtsen References: <9935781545296483@sas2-b4ed770db137.qloud-c.yandex.net> Date: Wed, 10 Jul 2019 01:29:13 +0200 In-Reply-To: <9935781545296483@sas2-b4ed770db137.qloud-c.yandex.net> (Konstantin Reich's message of "Thu, 20 Dec 2018 12:01:23 +0300") Message-ID: <87k1cqpz1y.fsf@mouse.gnus.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: Konstantin Reich writes: > Hey, i am using emacs 26.1.50 > > When i ran the following code in just started emacs -Q > (with-temp-buffer > (insert "@article{aaaa, > author = {AAA}, > title = {BBBB} > }") > (bibtex-mode) > (bib [...] Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Konstantin Reich writes: > Hey, i am using emacs 26.1.50 > > When i ran the following code in just started emacs -Q > (with-temp-buffer > (insert "@article{aaaa, > author = {AAA}, > title = {BBBB} > }") > (bibtex-mode) > (bibtex-autokey-get-field "title")) > > I get the following error: > > Debugger entered--Lisp error: (wrong-type-argument stringp nil) > looking-at(nil) > bibtex-valid-entry(t) > bibtex-end-of-entry() After poking around in the bibtex code, I think this just isn't supported. All the variables are like this: (defvar bibtex-entry-maybe-empty-head nil "Regexp matching the header line of a BibTeX entry (possibly without key). Initialized by `bibtex-set-dialect'.") And the dialect won't be set until you load a file, so I don't think this is a bug. -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no From debbugs-submit-bounces@debbugs.gnu.org Tue Jul 09 19:29:23 2019 Received: (at control) by debbugs.gnu.org; 9 Jul 2019 23:29:23 +0000 Received: from localhost ([127.0.0.1]:34517 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hkzY3-0002JW-2w for submit@debbugs.gnu.org; Tue, 09 Jul 2019 19:29:23 -0400 Received: from quimby.gnus.org ([80.91.231.51]:55690) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hkzY0-0002JG-LZ for control@debbugs.gnu.org; Tue, 09 Jul 2019 19:29:20 -0400 Received: from cm-84.212.202.86.getinternet.no ([84.212.202.86] helo=marnie) by quimby.gnus.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1hkzXy-0001xX-4F for control@debbugs.gnu.org; Wed, 10 Jul 2019 01:29:20 +0200 Date: Wed, 10 Jul 2019 01:29:17 +0200 Message-Id: <87imsapz1u.fsf@mouse.gnus.org> To: control@debbugs.gnu.org From: Lars Ingebrigtsen Subject: control message for bug #33810 X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: tags 33810 notabug close 33810 quit Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) tags 33810 notabug close 33810 quit