emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: "J. G." <jerzor@pacbell.net>
To: Org-Mode Mailing List <emacs-orgmode@gnu.org>
Subject: Re: org-bibtex-yank failing with error Wrong type argument: stringp, nil
Date: Sat, 12 Aug 2023 04:15:26 +0000 (UTC)	[thread overview]
Message-ID: <324290413.3530604.1691813726246@mail.yahoo.com> (raw)
In-Reply-To: <1939460027.3272000.1691771671040@mail.yahoo.com>

[-- Attachment #1: Type: text/plain, Size: 1593 bytes --]

On Friday, August 11, 2023 at 09:34:31 AM PDT, J. G. <jerzor@pacbell.net> wrote: 
> Hi, I'm trying to figure out why I'm getting consistent failures using org-bibtex-yank. This appears to be identical to the problem posted here:
On further investigation I have pinpointed the precise error as referenced by the comment in the Stackoverflow thread. One of the nested function calls stemming from org-bibtex-yank is to bibtex-parse-entry in bibtex.el, and that in turn attempts to make use of the internal variable bibtex-entry-maybe-empty-head. That variable, among others, has documentation that they are nil until initialized by bibtex-set-dialect, which sets a number of other internal variables along with bibtex-dialect. That default nil value bubbles up to cause the error I am experiencing. The solution in my original email of opening a dummy.bib file works because it calls bibtex-mode and that calls bibtex-set-dialect.
Adding the following two lines to my init fixes the error in my case:
(require 'bibtex)(bibtex-set-dialect 'biblatex nil)
where the first line seems to be necessary in my barebones case because bibtex isn't yet loaded, and the second line sets my dialect of choice (biblatex) and sets the internal variables for bibtex globally (nil), not locally (t).
Given the disconnect between the error and the solution (as I understand it at least), and the absence of this necessity in the documentation (I have read through at least ol-bibtex.el), perhaps a small mention of this in the documentation in ol-bibtex.el is in order, and I can submit a patch for review?

[-- Attachment #2: Type: text/html, Size: 2358 bytes --]

  reply	other threads:[~2023-08-13  2:22 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1939460027.3272000.1691771671040.ref@mail.yahoo.com>
2023-08-11 16:34 ` org-bibtex-yank failing with error Wrong type argument: stringp, nil J. G.
2023-08-12  4:15   ` J. G. [this message]
2023-08-13  7:57     ` Ihor Radchenko
2023-08-13 15:30       ` Jeremias Gonzalez
2023-08-13 15:44         ` Ihor Radchenko
2023-08-13 16:15           ` Jeremias Gonzalez
2023-08-13 16:25             ` Ihor Radchenko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=324290413.3530604.1691813726246@mail.yahoo.com \
    --to=jerzor@pacbell.net \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).