From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id YLqDKsg6KmGPbAEAgWs5BA (envelope-from ) for ; Sat, 28 Aug 2021 15:31:52 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id oCwmJsg6KmEfWgAA1q6Kng (envelope-from ) for ; Sat, 28 Aug 2021 13:31:52 +0000 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 E66AE1860A for ; Sat, 28 Aug 2021 15:31:51 +0200 (CEST) Received: from localhost ([::1]:57830 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mJyR4-00052T-07 for larch@yhetil.org; Sat, 28 Aug 2021 09:31:50 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:47990) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mJyQU-00050C-Gd for emacs-orgmode@gnu.org; Sat, 28 Aug 2021 09:31:14 -0400 Received: from mail-ed1-x536.google.com ([2a00:1450:4864:20::536]:34667) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mJyQS-0001fz-Ne for emacs-orgmode@gnu.org; Sat, 28 Aug 2021 09:31:14 -0400 Received: by mail-ed1-x536.google.com with SMTP id i6so14248397edu.1 for ; Sat, 28 Aug 2021 06:31:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:in-reply-to:references:date:message-id :mime-version; bh=FvM9IL8UEfE0RUKj6QePcxxkDwWmIj3BCtGNra+1vPk=; b=boT2D3bj5OiSxirg4MeElzlOnujJD3rj40egMqWGtmiXOeFQ4CNLC1WwyyLFf52Xmn vUGd430+2XzgxHz7l9PUrSsvM1MsNBiRgv+Mv+UxC3KtuslyWqRAjMdAtSmwrrS+LwWQ JyLDPApXRQZQl4V5iT5XszQWJzVmbAvwKTuKT6FKaiIUl32YC47t96d3Cqn85dTRA4H8 hiFsKJnBeyTpY6YgKR5pHB6/tZNiois+UJtADATP2Sefh+1q7UgG5rXX+qgzQeUvhmGu MBcBP1dPTY+ykbkkeSXJJTMFzI8/5tkI6/ypDcPDa3DTViyufXjhJT5VxnH2JopeLWO+ OciQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:in-reply-to:references:date :message-id:mime-version; bh=FvM9IL8UEfE0RUKj6QePcxxkDwWmIj3BCtGNra+1vPk=; b=ho1DjOhT+dihlF0UyRjTzlc9gizsKZ5vDuVWZIUGtAxW6GKCzJgACE6B6DWELT5q2K CxpWJ7UhhsWdHSFQvPVwBIF04/hQj6AaRJXzYvao+shJjeV8maJ83Gz7jKbyHCRZyQIW FdTesj10OoozCO2vFMGB6dfOryHHisLYWHEcvtdWYQ1PnmP0FCBdpITjzeTSsmb+mxoq nt0BrYF27Klt69zi5a+HLZ2r4ikvmaQFHKE+K7crFqYQh0mh5sRhhpi3615INo4oQkFx ERPVGZjo1JZnh4aJjf7fOHP1QPnAZiexOZ/0g6G8E9GNMwS5+JfLhSnLTdkBlg8XGLx2 soxw== X-Gm-Message-State: AOAM533fFUtyQe9c7U8ut6R3/6h//DyWAroSn9lFcoG9XfANW1hKYVkb YJddjtx+N9d5TbfP7UDeh6I= X-Google-Smtp-Source: ABdhPJw4bnuMxyPvOj2zps/KqsDJcXuZaf7A4w+2ARcTGwIo9aXVNWsV2DUUdHtdw/PpA7misNLIvw== X-Received: by 2002:aa7:d501:: with SMTP id y1mr6734523edq.6.1630157471171; Sat, 28 Aug 2021 06:31:11 -0700 (PDT) Received: from localhost ([158.255.2.9]) by smtp.gmail.com with ESMTPSA id h10sm4797250edb.74.2021.08.28.06.31.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 28 Aug 2021 06:31:10 -0700 (PDT) From: Ihor Radchenko To: Colin Baxter Subject: [PATCH] Re: org-bibtex does not recognise @Comment In-Reply-To: <874kd3288n.fsf@yandex.com> References: <874kd3288n.fsf@yandex.com> Date: Sat, 28 Aug 2021 21:32:00 +0800 Message-ID: <878s0lu23z.fsf@localhost> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Received-SPF: pass client-ip=2a00:1450:4864:20::536; envelope-from=yantar92@gmail.com; helo=mail-ed1-x536.google.com X-Spam_score_int: -17 X-Spam_score: -1.8 X-Spam_bar: - X-Spam_report: (-1.8 / 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, FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, 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.23 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: emacs-orgmode@gnu.org Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1630157512; 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=FvM9IL8UEfE0RUKj6QePcxxkDwWmIj3BCtGNra+1vPk=; b=HjwQ85OGg72ZPZgnxnMlHMeFTQeA3x4T8Suhnc7W0f+oZvq+fiqYWbQVxkVyu8GVkWzz9a fNZG4GYglAaH2kKiiA0hGL9/TCpRuFWHiaDfum5jlHyF4EPkAxQdhQyHFxbVd5EfYiDnKQ +a4xBkb4rG9jrbu3Mbz/rV/hEi9j25rUoxFQc0TM3nwN7mqNmKXvmhXHCRflaxeJ/bRIdx dVasEd75caF5RhM/lcYrYOdzvyyXoNTgUXFrTiLoeGZS4jFofkrWqzAXEeZXdib3y8E7oN 6f528FyYjQXWkqYL3SjIr/Ugg3eimkfLDJQVB+1JdMQyqVq/f8nHFv+PMS5kKw== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1630157512; a=rsa-sha256; cv=none; b=TXQPK328vaGdkR5aXR0JiYlrWVOQbtoaPkWwgEp4h9In8P6NsQ/gcbvptqGGpVcj1O7hGt Cf3F2pfWTQwTPFfNYK2NUw84VXo3YY2rzmga0gYvzAebenqYJCtiNJF+4B5ih+vuroDMqM ruDYXddeNQ9lbuWN/RbI8c3J9r00TXyTGL1hYRKrRrfRrt28w77fH+EuvGqmyZnRg7JwbL akBpwZUJlmgrgWXAj1gdtNeQN2U8+onlaiMOESlPLIitXzk4fIq46WgDJ9njsRhmMoCS3L 3U8mjKTRgd0ZP3wIB88S8mWEuRKNo9aO5H3kW2b/QFfhDELnbNTsZG+SZSEE5w== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20161025 header.b=boT2D3bj; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Migadu-Spam-Score: -2.63 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20161025 header.b=boT2D3bj; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Migadu-Queue-Id: E66AE1860A X-Spam-Score: -2.63 X-Migadu-Scanner: scn0.migadu.com X-TUID: 9fAuAWx5k0R6 --=-=-= Content-Type: text/plain Colin Baxter writes: > I've noticed that "org-bibtex-import-from-file" will not import from bib files > which begin with the standard bibtex mode-line heading of > > @Comment -*- mode: bibtex; -*- Well. It will import the files. However, org-bibtex-write will indeed fail. If I got it wrong, please provide more details. Confirmed The fix is attached. Best, Ihor --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=0001-org-bibtex-read-Do-not-add-nil-when-there-is-no-entr.patch >From 248a594fb89820a6ee2ca5782f98502851c9a315 Mon Sep 17 00:00:00 2001 Message-Id: <248a594fb89820a6ee2ca5782f98502851c9a315.1630157370.git.yantar92@gmail.com> From: Ihor Radchenko Date: Sat, 28 Aug 2021 21:23:43 +0800 Subject: [PATCH] org-bibtex-read: Do not add nil when there is no entry at point * lisp/ol-bibtex.el (org-bibtex-read): Previously, when there is no entry at point, `nil' would be added to `org-bibtex-entries' causing errors later, i.e. upon calling org-bibtex-write. Now, nil is never pushed to `org-bibtex-entries'. Fixes https://orgmode.org/list/874kd3288n.fsf@yandex.com --- lisp/ol-bibtex.el | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lisp/ol-bibtex.el b/lisp/ol-bibtex.el index 4970be9c4..e70d847b4 100644 --- a/lisp/ol-bibtex.el +++ b/lisp/ol-bibtex.el @@ -677,7 +677,8 @@ (defun org-bibtex-read () (_ field))) (funcall clean-space (funcall strip-delim (cdr pair))))) (save-excursion (bibtex-beginning-of-entry) (bibtex-parse-entry))) - org-bibtex-entries))) + org-bibtex-entries) + (unless (car org-bibtex-entries) (pop org-bibtex-entries)))) (defun org-bibtex-read-buffer (buffer) "Read all bibtex entries in BUFFER and save to `org-bibtex-entries'. -- 2.31.1 --=-=-=--