From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id SCMeElMcq2ORKwAAbAwnHQ (envelope-from ) for ; Tue, 27 Dec 2022 17:24:51 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id qGU6ElMcq2MElAAA9RJhRA (envelope-from ) for ; Tue, 27 Dec 2022 17:24:51 +0100 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 DCDD9154AF for ; Tue, 27 Dec 2022 17:24:50 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pACko-00048t-Vn; Tue, 27 Dec 2022 11:24:39 -0500 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 1pACkm-00045x-Ul for emacs-orgmode@gnu.org; Tue, 27 Dec 2022 11:24:36 -0500 Received: from mail-oa1-x30.google.com ([2001:4860:4864:20::30]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pACkl-0004UM-9f for emacs-orgmode@gnu.org; Tue, 27 Dec 2022 11:24:36 -0500 Received: by mail-oa1-x30.google.com with SMTP id 586e51a60fabf-1447c7aa004so15917914fac.11 for ; Tue, 27 Dec 2022 08:24:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=to:date:message-id:subject:mime-version:content-transfer-encoding :from:from:to:cc:subject:date:message-id:reply-to; bh=sf9viScHUOiipDuHlPosmOH9Rs/TSBLqzyUFw2U4YWg=; b=lf1WUTqoLmUHYGc12yIMyGsrsh/oQoEXQb+4yhQ8TOtAnBOISzBGsiRxxvtKCPWGx5 oGA3ZS2yruzS+24obDA+HsRPGK+DADZkRCUUxue6kH98+TQ5SUZ0i7dc5F4XeYCl2K+B TfXHJCtI9chQUm/X2+y00m4Jccyh1Lm5LJ/K28MXpdZfM/OoQyIMuHcQdlEw9t+trm0+ 5ATFAh9h69QBiqhI0C71/Q4hos9xZ4fo3Z/ZQKLX1Cus1T58eahbs9+TzH4tUm/u5via A3v3CLEReqf0O5ubPMEs46l48ZCREU2sNj3eOKqh3SC/3mf375Fw7U0ESEUti2zO+SC1 9vaw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=to:date:message-id:subject:mime-version:content-transfer-encoding :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=sf9viScHUOiipDuHlPosmOH9Rs/TSBLqzyUFw2U4YWg=; b=Nd6+MvE65lPY2RnESqyw5BlHLDv3/1Eemyk2N5AYOhXtg5hmfar770TVK9Sl2eUMjg 8U3yKzs44huG6LdLDqDNe/rlE32mEnwyrdjA4KTGdpO+1q6oi0Tih5X9ymFE4eQJLW+G CbTDeAKPpfp0Z/35vs/WaYtKcCNmPF0fQO9/sDf1lwV0BTT3OUwOhOY6MzggQX2LQfuO UL137WnfO+7QmG4liRP/74hAqfh3M8z9j6CZ5gDRaFiaRY0TmS2Eb5gxwbQxVM330u7P Lfck4TAQsVHEWTN8NeKJ33SHt8hBCOObafVJXvD0ce1KqTJ1vDc4n/r97IoRFPmQ8guB tM2A== X-Gm-Message-State: AFqh2kpFVVMywxbZFbVot+jXc/2MGBaLdLrHhB2rpmswH70JY9Q8++Hr NUyhcWrNaPEHSkEiXuRgbiQKTVCy54/dbw== X-Google-Smtp-Source: AMrXdXvdAzXVuLlSlspIujJE7vzwXl6y/9XyJqcz2CSZZO5YrppQWRPLc+t8HF3HdODwqIgO29yodQ== X-Received: by 2002:a05:6870:b4a5:b0:148:3341:5249 with SMTP id y37-20020a056870b4a500b0014833415249mr12177264oap.22.1672158271733; Tue, 27 Dec 2022 08:24:31 -0800 (PST) Received: from smtpclient.apple ([2804:14c:101:8547:1d54:73a2:6ba6:c3ce]) by smtp.gmail.com with ESMTPSA id b7-20020a4aac87000000b004a5a69c1861sm5524007oon.22.2022.12.27.08.24.30 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 27 Dec 2022 08:24:31 -0800 (PST) From: Sterling Hooten Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3696.120.41.1.1\)) Subject: [FR] Please add writing to existing heading in org-bibtex Message-Id: <76ED509D-E464-4B3E-B751-B233340B2E94@gmail.com> Date: Tue, 27 Dec 2022 13:24:28 -0300 To: emacs-orgmode@gnu.org X-Mailer: Apple Mail (2.3696.120.41.1.1) Received-SPF: pass client-ip=2001:4860:4864:20::30; envelope-from=hooten@gmail.com; helo=mail-oa1-x30.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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_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.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-Country: US X-Migadu-Flow: FLOW_IN ARC-Seal: i=1; s=key1; d=yhetil.org; t=1672158290; a=rsa-sha256; cv=none; b=AZORAv7/3Z3LYECFyHTmQG7g8xBXPDAgUwlrqjkbpT0curv9hCWnL7gVC8KRzXGkJBp0Rp To2fuNK5YbG+yjbfe1Maz5JVHkIq4MEFAFy3JtxHL8nvSph2dMU3UkT/YORmNeNE5EWCHS C8/xecSeXp1VaqXuosriPp95J4W6yjVdw91/a6itWyFuJvvwY4YOi4pNLMXOkS9g3xn38g eZWZXI9uahlj5hYUMr9zkuzfbxhL9GsKRARIsKNGJU2wmZkwDtoA6ZsmNxQ+4ySxDudT7T jZ8VfSIosvfyW7oTUdoOMQBv0LF5OQWb5hBUOQxDsfmfM6WTanpPQiAHsxg4sQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=lf1WUTqo; 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"; dmarc=pass (policy=none) header.from=gmail.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1672158290; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=sf9viScHUOiipDuHlPosmOH9Rs/TSBLqzyUFw2U4YWg=; b=NN0mbLxC8uDxpMC6bSaK+A/iMTB8fiLfbQEnvrr35oMhUnIHSt6rL2dsUI0YZnP3TKryM6 rqzrQWFy6VW9Pol8J5GskS7nxn/gpgkcp3rBvpN1AmpEWUJKC0fecLoOJ+R3dAsCe+GpBW D5Uk2UtVCRLYJFU5I5/kg6QlR/6A5VdH5EHQQbirJDrqdCB7Tiofq379UUMPU7Xv+g1pj1 Am6O78NagrIj4s1WXTCsigr5uMjw/cgyHJYvkp0In7oZ/w0SFrQm9GBZrxvK95b5dcd9kV ZJmK2RI4NAOESlPL0GMU8GJlpS3im6QmGGMmgXeIMkGfsxhIXzqPvDIG9jMxcQ== X-Spam-Score: -5.70 X-Migadu-Queue-Id: DCDD9154AF Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=lf1WUTqo; 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"; dmarc=pass (policy=none) header.from=gmail.com X-Migadu-Scanner: scn0.migadu.com X-Migadu-Spam-Score: -5.70 X-TUID: eBm1BPRgeXUj The default behavior of org-bibtex-write is to insert a new heading with the bibliographic data in the properties. But an alternative workflow would just update the properties of the heading at point, rather than creating a new one. The below patch is a simple implementation I=E2=80=99ve been using for a month. Would it be possible = to integrate this upstream? Thanks, Sterling diff --git a/lisp/ol-bibtex.el b/lisp/ol-bibtex.el index 81b99167b..38198eae4 100644 --- a/lisp/ol-bibtex.el +++ b/lisp/ol-bibtex.el @@ -703,8 +703,9 @@ Return the number of saved entries." (interactive "fFile: ") (org-bibtex-read-buffer (find-file-noselect file 'nowarn 'rawfile))) =20 -(defun org-bibtex-write () - "Insert a heading built from the first element of = `org-bibtex-entries'." +(defun org-bibtex-write (&optional no-new) + "Insert a heading built from the first element of = `org-bibtex-entries'. With non-nil optional NO-NEW write to heading at = point instead of creating new." + ;; SWH 2022-11-22 changes to allow for writing heading at point = instead of inserting new. (interactive) (when (=3D (length org-bibtex-entries) 0) (error "No entries in `org-bibtex-entries'")) @@ -712,8 +713,9 @@ Return the number of saved entries." (org-special-properties nil) ; avoids errors with = `org-entry-put' (val (lambda (field) (cdr (assoc field entry)))) (togtag (lambda (tag) (org-toggle-tag tag 'on)))) - (org-insert-heading) - (insert (funcall org-bibtex-headline-format-function entry)) + (unless no-new + (org-insert-heading) + (insert (funcall org-bibtex-headline-format-function entry))) (org-bibtex-put "TITLE" (funcall val :title)) (org-bibtex-put org-bibtex-type-property-name (downcase (funcall val :type)))