From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms9.migadu.com with LMTPS id yBF3NudTk2QfgAAASxT56A (envelope-from ) for ; Wed, 21 Jun 2023 21:47:51 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id cBVdNudTk2QAewAA9RJhRA (envelope-from ) for ; Wed, 21 Jun 2023 21:47:51 +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 884C02EF2E for ; Wed, 21 Jun 2023 21:47:51 +0200 (CEST) Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=Y9iZgQWH; dmarc=pass (policy=none) header.from=redhat.com; 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=1687376871; a=rsa-sha256; cv=none; b=aNfj7j3iCkjxvSp8p4U73b2kPCi5XuMHK1MKwMh0w+D4opie8KwMtGZaE4eb+mlYs+Tle6 4fSRfGfxfO7r8JkB8w62QFf23fwACEp83ptqCSUagmKi7MPAHuQAawN+iDX1HclQcUVkiL bCTKz9/UZAo0ExVLLtkUfAK/FYWpRl66SCqNy212MYN9hWEopZ7AOS3Dng6RajhVjFV5xz 8DOmz0RZz/jpd4YGgxKZpM9AMqAuPpV2MbI5/SeA8lr07P6TXAut2wFxdbdl2KQ7jdpyjn 7LBvd8bIULtXw9FXm6SkQH/pZPle0dGaFf+h17Fbx22C3WKAZUYUrHTh2uYi2A== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=Y9iZgQWH; dmarc=pass (policy=none) header.from=redhat.com; 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=1687376871; 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:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=if69n3k8OYVbIT3l+qMAjSda8wNxWO2IjGGrae0hJJ4=; b=AgGOvO7DYwHv2/vl5jAJVuDgoaCx9j3pBlwLC/KLEAUBmv3CcS7wFrTInsDv7KqtLyd3D3 TzMGQGR+5ep4lfsLY+aFuNKWxFZ17KrjEa/gM4Vk4QyKFxuG0RYKsTecfrQ3uoKuhd91mv UGMH8HSVSB+eBJ/4PQAdwK74odme9qTeJGKoTlD8gHj6HQvTIewxveau4LHx9WJDzw61EH 5E4Pcj9M9SwsU/0cPMSkAfFRfMbBWV4p90w8dToRCyMjdkwlO4o1EaY01VbIbc2QzRNSui MAHyTJGxFmlrl7l2FZzL8fr7Oi68p9ru6hNImkR5g+xRz0WVH+ex0gOmyvctUg== Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qC3nI-0002kX-9W; Wed, 21 Jun 2023 15:47:08 -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 1qC3nG-0002kM-EI for emacs-orgmode@gnu.org; Wed, 21 Jun 2023 15:47:06 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qC3nE-0003ny-Mu for emacs-orgmode@gnu.org; Wed, 21 Jun 2023 15:47:06 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1687376822; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type; bh=if69n3k8OYVbIT3l+qMAjSda8wNxWO2IjGGrae0hJJ4=; b=Y9iZgQWH1Dlgn8celVIJm9Kfh9OLwAc92Z8H2sU2Fs9X0NI/gAgDPyER6ITkBrFdY4I0sL sEDDHWzF1EriAHSDjyu27eZaEivYO38pMlUcEaaJmnLRcyCpywcbMFiMfnheCUYIpdJaES gu7fNaiYOTHwrKchhBD3gOBv8c0XgPY= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-333-sD772ubyN-SBcr9MXzeuLg-1; Wed, 21 Jun 2023 15:45:16 -0400 X-MC-Unique: sD772ubyN-SBcr9MXzeuLg-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id EC941101A529 for ; Wed, 21 Jun 2023 19:45:14 +0000 (UTC) Received: from alphaville.usersys.redhat.com (unknown [10.22.10.108]) by smtp.corp.redhat.com (Postfix) with ESMTPS id E2A7440C2063 for ; Wed, 21 Jun 2023 19:45:14 +0000 (UTC) Received: from alphaville.usersys.redhat.com (localhost [IPv6:::1]) by alphaville.usersys.redhat.com (Postfix) with ESMTPS id 81B8F81C40BF for ; Wed, 21 Jun 2023 15:45:14 -0400 (EDT) From: Nick Dokos To: emacs-orgmode@gnu.org Subject: [BUG] org-babel-tangle: Header arg `:comments org' produces no comment in the output [9.7-pre (release_9.6.6-418-g294a4d @ /home/nick/src/emacs/org/org-mode/lisp/)] Date: Wed, 21 Jun 2023 15:45:14 -0400 Message-ID: <87bkh8k3at.fsf@alphaville.usersys.redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.1 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain Received-SPF: pass client-ip=170.10.129.124; envelope-from=ndokos@redhat.com; helo=us-smtp-delivery-124.mimecast.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, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 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-Scanner: scn1.migadu.com X-Migadu-Spam-Score: -5.04 X-Migadu-Queue-Id: 884C02EF2E X-Spam-Score: -5.04 X-TUID: f5hLAjKu+LoE Remember to cover the basics, that is, what you expected to happen and what in fact did happen. You don't know how to make a good report? See https://orgmode.org/manual/Feedback.html#Feedback Your bug report will be posted to the Org mailing list. ------------------------------------------------------------------------ Here's an ECM: --8<---------------cut here---------------start------------->8--- * Function heading #+begin_src elisp :tangle "file.el" :comments org (message "FOO") #+end_src --8<---------------cut here---------------end--------------->8--- Tangling it with `C-c C-v C-t' produces the following: --8<---------------cut here---------------start------------->8--- (message "FOO") --8<---------------cut here---------------end--------------->8--- with no comment added. In 9.5.5, the output is correct: --8<---------------cut here---------------start------------->8--- ;; Function heading (message "FOO") --8<---------------cut here---------------end--------------->8--- I narrowed it down to this snippet of code in `org-babel-tangle-single-block': ,---- | ;; From the previous heading or code-block end | (funcall | org-babel-process-comment-text | (buffer-substring | (max (condition-case nil | (save-excursion | (org-back-to-heading t) ; Sets match data | (match-end 0)) | (error (point-min))) | (save-excursion | (if (re-search-backward | org-babel-src-block-regexp nil t) | (match-end 0) | (point-min)))) | (point))))) `---- and bisecting fingered this commit: --8<---------------cut here---------------start------------->8--- 2737128aa778297f41971cc93c464faf17718e34 is the first bad commit commit 2737128aa778297f41971cc93c464faf17718e34 Author: Ihor Radchenko Date: Tue Sep 13 20:59:13 2022 +0800 org-back-to-heading: Use cache * lisp/org.el (org-back-to-heading): Use element cache when cache is active. lisp/org.el | 63 ++++++++++++++++++++++++++++++++++++++++--------------------- 1 file changed, 41 insertions(+), 22 deletions(-) --8<---------------cut here---------------end--------------->8--- Apparently, `org-back-to-heading' sets match data differently now: `(match-end 0)' gets the end of the line, Before the patch, it got the beginning of the line. Emacs : GNU Emacs 30.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.37, cairo version 1.17.6) of 2023-06-21 Package: Org mode version 9.7-pre (release_9.6.6-418-g294a4d @ /home/nick/src/emacs/org/org-mode/lisp/) -- Nick "There are only two hard problems in computer science: cache invalidation, naming things, and off-by-one errors." -Martin Fowler