From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:306:2d92::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms9.migadu.com with LMTPS id kKNHKn362GRkhQAASxT56A (envelope-from ) for ; Sun, 13 Aug 2023 17:45:01 +0200 Received: from aspmx1.migadu.com ([2001:41d0:306:2d92::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id wD0tKn362GS/KAEA9RJhRA (envelope-from ) for ; Sun, 13 Aug 2023 17:45:01 +0200 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 7148244F1A for ; Sun, 13 Aug 2023 17:45:01 +0200 (CEST) Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=o1oaIlwa; dmarc=pass (policy=none) header.from=posteo.net; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1691941501; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=AyoY+U8SQrgeSOQWWxSitWnjFDAK9Ya/pU6XhnIzpV8=; b=jjaeDhg63E/3OJGDBkRf9KZRfXuyT1Pxfo+CbJ+H9NPjiBylQie2KL073L9yRxBbDxwtdD ewuOMDz5oZW3VaT8vuW/wbSqExYk97uWMOqmss7KBR09c1gld3XNr9qk4ZDG1yfTAqXI2K Myx8uLoU4hRWDd9WvXjuj734vD5NDOjzc5pUWK+4H08+mqq1aSYNNwsp0uDlblxeGzUITW mNfu7PCwloy0ZU6LETLXkQqi7mjtJ5qzMs/s5JUcB9PU2NiQ82gqj8iPBJmAaoCPro6Hy+ 9iLfRTj5kgUReMAttPk0D6UN0xes3azjAjODrwo9oq4l7jzO2veOVX/FRfoZYg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=o1oaIlwa; dmarc=pass (policy=none) header.from=posteo.net; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" ARC-Seal: i=1; s=key1; d=yhetil.org; t=1691941501; a=rsa-sha256; cv=none; b=oc8AmmjXelI2aaVK5Z1qYKOHqW9HcmZzoOWJqBKU+pZmTnlNPAUrq56okKFihnxJQhYfiY +EJ5VqEFD9MrEQRsrnuSk4QuPXCCD8cPKCOBTHbSrOzJRHM+aI05Cl3RUr16o2SYE27pv6 rz+9c7CiEMG1pbMPmOq+gV0XubvCf7S05VhHJXYYlDwTOndV5B9CTNA41dtDLnt75LWxmQ nwLMNGRwEZ2guBLjYMY51U4NNIuj7f24kFwtXPMaQIOaG5gxet42X6o+kAUdZfO79USuo1 JxLCcqzW9bgiqGiyiiS1zvy1tqpAElHs4oFAVjaQJdAeckmsbr8aHfiVjZjTuw== Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qVDGR-00072d-1I; Sun, 13 Aug 2023 11:44:23 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qVDGP-00072N-9T for emacs-orgmode@gnu.org; Sun, 13 Aug 2023 11:44:21 -0400 Received: from mout01.posteo.de ([185.67.36.65]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qVDGN-0001TI-CA for emacs-orgmode@gnu.org; Sun, 13 Aug 2023 11:44:21 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id 699BC240027 for ; Sun, 13 Aug 2023 17:44:17 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1691941457; bh=3Nh+DrtI6d9VP105RBzEtDnUG0eK+Eg1Zxkn0HqtrPw=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:From; b=o1oaIlwavt6TUJ+pLFy8zgns0vOxHiL/qfzArRIjiNgyCzVwWpnAD9l60cKtVnxID txmG8DL9u3YylsUlHkfMawddupAbA1RpNReGPg3DBi0EvYKYXs0YH/d2z+EBhsEjtH obd7FMqf4/z7c+9fJl0AcTyq3UknfgjEngL5IATVu+OYXa5tkiLTTCbhVqiXTl0QHm oVvLlIRRrOMOi6zuIjNIarJcREH1cuF6oYlpX16/WXsvrEbCMxdcEI0RAf/lJXk83+ Go3nqppjyxjQH0REZEEU9h9UsxJPajHy0exoM28nmBdjLuBuTzInYkZ6L3ILm7JBYu PGHj5g1B24Suw== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4RP1zj08tRz6tx2; Sun, 13 Aug 2023 17:44:16 +0200 (CEST) From: Ihor Radchenko To: Jeremias Gonzalez Cc: Org-Mode Mailing List Subject: Re: org-bibtex-yank failing with error Wrong type argument: stringp, nil In-Reply-To: References: <1939460027.3272000.1691771671040.ref@mail.yahoo.com> <1939460027.3272000.1691771671040@mail.yahoo.com> <324290413.3530604.1691813726246@mail.yahoo.com> <87wmxzl6gy.fsf@localhost> Date: Sun, 13 Aug 2023 15:44:43 +0000 Message-ID: <87r0o7dk0k.fsf@localhost> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Received-SPF: pass client-ip=185.67.36.65; envelope-from=yantar92@posteo.net; helo=mout01.posteo.de X-Spam_score_int: -53 X-Spam_score: -5.4 X-Spam_bar: ----- X-Spam_report: (-5.4 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H5=-1, RCVD_IN_MSPIKE_WL=-0.01, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: emacs-orgmode-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US X-Migadu-Spam-Score: -9.37 X-Spam-Score: -9.37 X-Migadu-Queue-Id: 7148244F1A X-Migadu-Scanner: mx2.migadu.com X-TUID: cFa1DNn+0apZ --=-=-= Content-Type: text/plain Jeremias Gonzalez writes: >> Do I understand correctly that you attempted to run org-bibtex-read from >> a non-bibtex buffer? >> > > At a top level, I was using org-bibtex-yank with an org buffer (and in my > ideal case with no bibtex buffers whatsoever) as the documentation for that > function only requires bibtex to be in the kill ring. However, yes, > org-bibtex-yank calls org-bibtex-read, and I was doing so (in the ideal > case) with a non-bibtex buffer. Does the attached patch fix the problem? --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=0001-org-bibtex-yank-Fix-bibtex-parser-not-initialized-in.patch >From 67c15a645f98f25af4db37830d632e9daf875e5e Mon Sep 17 00:00:00 2001 Message-ID: <67c15a645f98f25af4db37830d632e9daf875e5e.1691941444.git.yantar92@posteo.net> From: Ihor Radchenko Date: Sun, 13 Aug 2023 18:41:59 +0300 Subject: [PATCH] org-bibtex-yank: Fix bibtex parser not initialized in temp buffer * lisp/ol-bibtex.el (org-bibtex-yank): Make sure that we parse bibtex entry from the kill ring in a `bibtex-mode' buffer. Otherwise, calling `org-bibtex-read' (that calls `bibtex-parse-entry') may err because some Bibtex parser variables are not initialized. Reported-by: J. G. Link: https://orgmode.org/list/1939460027.3272000.1691771671040@mail.yahoo.com --- lisp/ol-bibtex.el | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lisp/ol-bibtex.el b/lisp/ol-bibtex.el index 4308424a3..17fbb9fbd 100644 --- a/lisp/ol-bibtex.el +++ b/lisp/ol-bibtex.el @@ -765,7 +765,10 @@ (defun org-bibtex-yank () "If kill ring holds a bibtex entry yank it as an Org headline." (interactive) (let (entry) - (with-temp-buffer (yank 1) (setf entry (org-bibtex-read))) + (with-temp-buffer + (yank 1) + (bibtex-mode) + (setf entry (org-bibtex-read))) (if entry (org-bibtex-write) (error "Yanked text does not appear to contain a BibTeX entry")))) -- 2.41.0 --=-=-= Content-Type: text/plain -- Ihor Radchenko // yantar92, Org mode contributor, Learn more about Org mode at . Support Org development at , or support my work at --=-=-=--