From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Ihor Radchenko Newsgroups: gmane.emacs.bugs Subject: bug#56475: 28.1.50; bibtex-parse-entry disregards @string substitutions Date: Sun, 17 Jul 2022 16:34:02 +0800 Message-ID: <87zgh887et.fsf@localhost> References: <87let1v3pq.fsf@localhost> <87sfn8ymw7.fsf@gnus.org> <87sfn7po84.fsf@gnu.org> <877d4jpngx.fsf@gnu.org> <87fsj76oxi.fsf@localhost> <871qurnf0d.fsf@gnu.org> <874jzm7to8.fsf@localhost> <87pmial54o.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="36040"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Lars Ingebrigtsen , 56475@debbugs.gnu.org To: Roland Winkler Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Jul 17 10:34:22 2022 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oCzjK-0009DH-01 for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 17 Jul 2022 10:34:22 +0200 Original-Received: from localhost ([::1]:58718 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oCzjI-0004Xd-G4 for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 17 Jul 2022 04:34:20 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:45236) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oCzj1-0004XR-3H for bug-gnu-emacs@gnu.org; Sun, 17 Jul 2022 04:34:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:48866) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oCzj0-0008Mq-D0 for bug-gnu-emacs@gnu.org; Sun, 17 Jul 2022 04:34:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oCzj0-0001z8-9J for bug-gnu-emacs@gnu.org; Sun, 17 Jul 2022 04:34:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Ihor Radchenko Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 17 Jul 2022 08:34:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 56475 X-GNU-PR-Package: emacs Original-Received: via spool by 56475-submit@debbugs.gnu.org id=B56475.16580467897568 (code B ref 56475); Sun, 17 Jul 2022 08:34:02 +0000 Original-Received: (at 56475) by debbugs.gnu.org; 17 Jul 2022 08:33:09 +0000 Original-Received: from localhost ([127.0.0.1]:46625 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oCzi8-0001y0-Pj for submit@debbugs.gnu.org; Sun, 17 Jul 2022 04:33:09 -0400 Original-Received: from mail-pf1-f177.google.com ([209.85.210.177]:33484) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oCzi5-0001xK-Ri for 56475@debbugs.gnu.org; Sun, 17 Jul 2022 04:33:06 -0400 Original-Received: by mail-pf1-f177.google.com with SMTP id v7so8270373pfb.0 for <56475@debbugs.gnu.org>; Sun, 17 Jul 2022 01:33:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:in-reply-to:references:date:message-id :mime-version; bh=Puio783/ARlZawbSoQr3Ytk7ZWEISvFHbNbj34+2G4o=; b=plVNrCLS6cmsQRXQ3kW+vpvM9/mMwI8pnddlqXsAc5w4Ami/YcLZe/tDa6DX8fLyNP ws/hPo7xFTLSOdAkgeAA64wrKF5NJQxUZLqW8h9RHZMoYb7PjWfuIKRBQ2sUXPYqN0jl qiwx+lNAPpRMlEFW1ies2oYY/VQ8UU3009LFWq14MC23Y2uJwvuYGFeGOO12S3ggidKA r/Rhfg9/wFA4aorcln3YqL50I/yDY6Omi60VVJK2xUjrTFxP+SKhFdUdy+UuddaYqyse d03dkxVw9Owbp8aMVMlgOek2XWgkIwd0JAvvzi81Xw+1Sv9V02QteeH2m4159b3YAg89 OB2g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:in-reply-to:references:date :message-id:mime-version; bh=Puio783/ARlZawbSoQr3Ytk7ZWEISvFHbNbj34+2G4o=; b=u6lBFcXM5Y3/ODw82uXLgj2Xgyt80MER9Tc/f+/62jOuqoHK/3fkLkcSDjvM8IpY/M HRkfKMA/gvJ8XttLI2PuWATlgqZ/Qpn1HBSOI9bSqbafWAi81ZBZ7KbqLhrDwXd3ehzl vAVQqCGVn3TvXiIGjeRU05sM5OVyuQgpDTJxwISn9VShFZmZV6FGp2w4SxNEbBQfRNl4 KVXQC8FJQb4sdP8O2ULOga/384bF0ODOFT+pvBskfzQVdZidbQ+X+166oKpO8AIA0ROs WX2HBBVnUfllnlo10wtEZzDwd6yPeSIVXvHT0rvBYZH6MEvMOLblFqHvnTOhOnCmRL8h 0yLQ== X-Gm-Message-State: AJIora/RiY1fanmcsmnMfzzsHl0eEwGWlIi8j8QxafWcXPAGaZlGLlqt HqkjSMGnRuT8SUI8lX1AWkQ= X-Google-Smtp-Source: AGRyM1uStF3d/HZWwBYVNFkB3sz05dmdB6xl04yVaGo0SjYpyY6pIMh81VhsZKjSpZ56xK1OhBqbKg== X-Received: by 2002:a05:6a00:27a6:b0:52a:e089:e777 with SMTP id bd38-20020a056a0027a600b0052ae089e777mr23286659pfb.53.1658046779849; Sun, 17 Jul 2022 01:32:59 -0700 (PDT) Original-Received: from localhost ([2409:8a70:2bd:4d0:8ec6:81ff:fe70:339d]) by smtp.gmail.com with ESMTPSA id e15-20020a056a0000cf00b005255489187fsm6901841pfj.135.2022.07.17.01.32.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 17 Jul 2022 01:32:59 -0700 (PDT) In-Reply-To: <87pmial54o.fsf@gnu.org> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:237242 Archived-At: Roland Winkler writes: > On Tue, Jul 12 2022, Ihor Radchenko wrote: >> I am wondering why bibtex-string-files is not documented inside the >> docstring of bibtex-expand-strings. Same for bibtex-expand-strings not >> being documented in bibtex-parse-entry. > > I believe the situation is the other way round: bibtex-files and > bibtex-string-files are basic user variables for bibtex-mode and have > been around for 30+ years (much longer than I support bibtex.el). > bibtex-expand-strings is a small add-on in this context. I think that the main issue on my side is that I interact with bibtex.el from API perspective without editing many actual .bib files. So, I was mostly looking into parser API instead of user customizations. If you start exploring bibtex.el from bibtex-parse-entry and its docstring, it is not very easy to figure out that bibtex-string-files and bibtex-expand-strings need to be set. They are not mentioned in the docstring other than by common word "extract content" with "extract" meaning being not very clear. >> I tried the following simple test: >> >> M-: (let ((bibtex-string-files `(,(buffer-file-name))) >> (bibtex-expand-strings t)) (bibtex-parse-entry)) >> >> The journal field is still not handled: ("journal" . "jgr") > > Try > > M-: (let ((bibtex-string-files `(,(buffer-file-name))) > (bibtex-expand-strings t)) (bibtex-parse-entry t)) Thanks! It works now. >> Also, note that bibtex-string-files cannot help with situations when >> the BibTeX buffer does not have an associated file. > > When does this happen? To the best of my knowledge, this has never been > an issue for users of bibtex.el. It is more of a hypothetical scenario that might occur in future if Org tries to support bibliographies provided inside .org files. Such bibliographies will need to be converted to .bib files transiently and might not need to be saved on disk. In any case, it is not a concern you need to worry about now. AFAIU, bibtex.el depends on .bib buffers having non-nil buffer-file-name in multiple places. Best, Ihor