From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2.migadu.com ([2001:41d0:403:4876::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms13.migadu.com with LMTPS id 4NMbK3RdemfGgwAAe85BDQ:P1 (envelope-from ) for ; Sun, 05 Jan 2025 10:22:44 +0000 Received: from aspmx1.migadu.com ([2001:41d0:403:4876::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2.migadu.com with LMTPS id 4NMbK3RdemfGgwAAe85BDQ (envelope-from ) for ; Sun, 05 Jan 2025 11:22:44 +0100 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=adamkovic.org header.s=fm3 header.b=g3t59mGF; dkim=pass header.d=messagingengine.com header.s=fm2 header.b=tc3UGpPx; 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=adamkovic.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1736072564; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=SVywEYVxeposDinrS1UD0pe7enUXuDwIgHZyM7B4tK8=; b=B/UUjr8R9vMnw/2OXZ1vhkknD+IxHtglIa2stWhk/OuFWn9pHo6/5S18mckZbxnIUl+fU5 VfGTCakRqhQl0IevQsWqswCh/9tcrZjNqIfpnf2ZvsF3XVgy57nmwEDsoUju2eKdtvbzhb 2VpNfwmn/gYGuryk5o3lWTJ62BHSmeBJjHdCz27yG6Nc+3YdQmIHl94sJLyPtJXiCXan1A jSY1XPMASy8MLNCjk1CxQr/NoKkVVTbS49FXMMfGpXMK9UQ6U/4iWBoGSgvJ2YZleF6aQR F/a4CMdKF05rl0YE0xgs5BEPRyCnNzr7CfSv1TvyQLCbh7PRAdoB8xN+RppGeA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=adamkovic.org header.s=fm3 header.b=g3t59mGF; dkim=pass header.d=messagingengine.com header.s=fm2 header.b=tc3UGpPx; 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=adamkovic.org ARC-Seal: i=1; s=key1; d=yhetil.org; t=1736072564; a=rsa-sha256; cv=none; b=Cnjow2SZgpv9yPkAW2iVAkowuRVVRK3cUQDgAKtlmX9HRD4Dleopo5YWJ6ORJovMKZKY57 i5wHvxNfyQgBseGxM8L7FC+5a4HBWyTxDkh4sqZnmMENfFy4ILDmaNLmseAiP5SQNZwYi4 vIQp/QAPjAsWme8SE7z3z6TZA9tbcuOzQCLiwRPjF2wDnHU/kijjpqDT7k7tKAq/vOeM/D VBas4znGzOLYf3S25ZFqiCw4qQ66wy+uZc+q2u2IFlZrwbNnPOtlMWvoFCYHLXBhUBGg3s Y8gMoRKFKMPo81G8CSkeJDmCaoLfDyOhxlPyyNjVn/DVprkTNXZOpVtE+FDH2Q== 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 74CB11CE00 for ; Sun, 05 Jan 2025 11:22:44 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tUNlQ-00086b-N7; Sun, 05 Jan 2025 05:21:45 -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 1tUNlM-00086G-9E for emacs-orgmode@gnu.org; Sun, 05 Jan 2025 05:21:40 -0500 Received: from fhigh-b3-smtp.messagingengine.com ([202.12.124.154]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tUNlK-0002S6-39 for emacs-orgmode@gnu.org; Sun, 05 Jan 2025 05:21:40 -0500 Received: from phl-compute-11.internal (phl-compute-11.phl.internal [10.202.2.51]) by mailfhigh.stl.internal (Postfix) with ESMTP id 634D825400D2; Sun, 5 Jan 2025 05:21:34 -0500 (EST) Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-11.internal (MEProxy); Sun, 05 Jan 2025 05:21:34 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=adamkovic.org; h=cc:cc:content-transfer-encoding:content-type:date:date:from :from:in-reply-to:message-id:mime-version:reply-to:subject :subject:to:to; s=fm3; t=1736072494; x=1736158894; bh=SVywEYVxep osDinrS1UD0pe7enUXuDwIgHZyM7B4tK8=; b=g3t59mGF43YNr5iOjnaRe6/Nq9 VtYdy1kP6ygDRwf+ZDSb8hJbbS+98+poE/zoEvVs9LDyZWXCfeiGKjSaTACAiFaA jvu1A0iBL4n+tEgCkKDT8Vq6EZDC/8KcnD+p39hBHaoHybgtc6XPoK/2AHkNCEnJ yMH4+Ec3gGs93dV7TmM1+vQd2u3jck+Pj4Q+8NOdl//w5Pyv/CXS/0J+cCVHh0ot 54JjE2eDV4WzH7Luqn/qfAPfJUvqZ3W0Xn4Xh30kdf6BVJNRDHP9VZPIJVL2jkW/ qg7ZOu7ezJm4PpG+NV4SMDxF2/Ykg6fj1Pqp8M+XC07T3t+eLq5oQ3En9mDA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:message-id:mime-version:reply-to:subject:subject:to :to:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t= 1736072494; x=1736158894; bh=SVywEYVxeposDinrS1UD0pe7enUXuDwIgHZ yM7B4tK8=; b=tc3UGpPxujnvEB3Q1Faj7xchqtLJAM+zFJHHVmCJZgX+ULlOo7b YmowKXmQrSuiN/BFeFzJqB1yJZ1sBDYQb6PFC/8PWZ+sqIBVCHPKA2DHUUAEiEDM lANy5oXo6nDVsxp6eKUGi4RPjjHhvamwvdiGSYcdn2MB7+fzn1h4V+8qSG/9OW6y 6FrptSfzZgkLtGDoq5aRCHL+n1idXvjFHQ9KIVY1Cp/RH1ssDGhJo07PbD6bYjS0 0vDN4A+1hnustXSlBc6xs9JTdAiJMO6V9qyprZ65by3ZfuN7g5NhiFlxbxko2zq9 9AsIVduCI4s6LycRkFg2PARNaj4mHdb0UaA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefuddrudefkedgudefucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggvpdfu rfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucenucfjughrpefhvfevuf ffkffoggfgsedtkeertdertdejnecuhfhrohhmpeftuhguohhlfhcutegurghmkhhovhhi tgcuoehruhguohhlfhesrggurghmkhhovhhitgdrohhrgheqnecuggftrfgrthhtvghrnh epjeejgfetfedutefhueejleffudffheetgeeuhfekieehvdejfeefieehveejkeetnecu ffhomhgrihhnpegsihgsthgvgidrnhhofidpvghmrggtshdrohhrghenucevlhhushhtvg hrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehruhguohhlfhesrggurghm khhovhhitgdrohhrghdpnhgspghrtghpthhtohepvddpmhhouggvpehsmhhtphhouhhtpd hrtghpthhtohepvghmrggtshdqohhrghhmohguvgesghhnuhdrohhrghdprhgtphhtthho pehruhguohhlfhesrggurghmkhhovhhitgdrohhrgh X-ME-Proxy: Feedback-ID: i88214938:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sun, 5 Jan 2025 05:21:33 -0500 (EST) From: =?UTF-8?q?Rudolf=20Adamkovi=C4=8D?= To: emacs-orgmode@gnu.org Cc: =?UTF-8?q?Rudolf=20Adamkovi=C4=8D?= Subject: [PATCH] ob-tangle: Tangle BibTeX files with the standard .bib file extension Date: Sun, 5 Jan 2025 11:20:55 +0100 Message-ID: <20250105102055.62372-1-rudolf@adamkovic.org> X-Mailer: git-send-email 2.47.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=202.12.124.154; envelope-from=rudolf@adamkovic.org; helo=fhigh-b3-smtp.messagingengine.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.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, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_PASS=-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 X-Migadu-Spam-Score: -7.82 X-Spam-Score: -7.82 X-Migadu-Queue-Id: 74CB11CE00 X-Migadu-Scanner: mx10.migadu.com X-TUID: MCUCLxBzHtHd --- etc/ORG-NEWS | 7 +++++++ lisp/ob-tangle.el | 3 ++- testing/lisp/test-ob-tangle.el | 24 ++++++++++++++++++++++++ 3 files changed, 33 insertions(+), 1 deletion(-) diff --git a/etc/ORG-NEWS b/etc/ORG-NEWS index 8f266c560..097550805 100644 --- a/etc/ORG-NEWS +++ b/etc/ORG-NEWS @@ -484,6 +484,13 @@ ignored by ~org-babel-tangle-collect-blocks~. Now, if it inherits a filename), a source block without =language= will get tangled to that file. +*** BibTeX is tangled with the standard =.bib= file extension + +Previously, =bibtex= source blocks located in a file named =NAME.org= +were tangled into a file named =NAME.bibtex=. Now, they are tangled +into a file named =FILE.bib=, using the standard extension =.bib=, +matching the rest of the ecosystem, including BibTeX and LaTeX. + * Version 9.7 ** Important announcements and breaking changes diff --git a/lisp/ob-tangle.el b/lisp/ob-tangle.el index 1f5de9250..38cad78ab 100644 --- a/lisp/ob-tangle.el +++ b/lisp/ob-tangle.el @@ -58,7 +58,8 @@ (defcustom org-babel-tangle-lang-exts '(("emacs-lisp" . "el") - ("elisp" . "el")) + ("elisp" . "el") + ("bibtex" . "bib")) "Alist mapping languages to their file extensions. The key is the language name, the value is the string that should be inserted as the extension commonly used to identify files diff --git a/testing/lisp/test-ob-tangle.el b/testing/lisp/test-ob-tangle.el index 6e95c4c91..4a197f76b 100644 --- a/testing/lisp/test-ob-tangle.el +++ b/testing/lisp/test-ob-tangle.el @@ -715,6 +715,30 @@ another block (funcall count-blocks-in-target-files (org-babel-tangle-collect-blocks))))))))) +(ert-deftest ob-tangle/bibtex () + "Tangle BibTeX into a `.bib' file." + (let ((file (make-temp-file "org-tangle-" nil ".org")) + (bib "@Misc{example, + author = {Richard Stallman and {contributors}}, + title = {{GNU} {Emacs}}, + publisher = {Free Software Foundation}, + url = {https://www.emacs.org/}, +}")) + (unwind-protect + (with-current-buffer (find-file-noselect file) + (insert (format "#+begin_src bibtex :tangle yes +%s +#+end_src" + bib)) + (org-babel-tangle) + (let ((bib-file (file-name-with-extension file "bib"))) + (should (file-exists-p bib-file)) + (should (string= (string-trim (org-file-contents bib-file)) + bib)))) + (delete-file file)))) + +(delete-file file) + (provide 'test-ob-tangle) ;;; test-ob-tangle.el ends here -- 2.47.1