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 ms5.migadu.com with LMTPS id 6O0TIN0QYGL6OAAAbAwnHQ (envelope-from ) for ; Wed, 20 Apr 2022 15:55:41 +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 aA8EIN0QYGKPJgAA9RJhRA (envelope-from ) for ; Wed, 20 Apr 2022 15:55:41 +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 D65222CCCC for ; Wed, 20 Apr 2022 15:55:40 +0200 (CEST) Received: from localhost ([::1]:51862 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nhAnz-0008Aq-By for larch@yhetil.org; Wed, 20 Apr 2022 09:55:39 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37320) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nhALN-0004lz-IS for emacs-orgmode@gnu.org; Wed, 20 Apr 2022 09:26:06 -0400 Received: from mail-pj1-x102a.google.com ([2607:f8b0:4864:20::102a]:43999) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nhALK-0004BC-A0 for emacs-orgmode@gnu.org; Wed, 20 Apr 2022 09:26:03 -0400 Received: by mail-pj1-x102a.google.com with SMTP id j8-20020a17090a060800b001cd4fb60dccso2019999pjj.2 for ; Wed, 20 Apr 2022 06:26:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:subject:in-reply-to:references:message-id:date:mime-version; bh=9zdFuRonKraBFsLEu7m2c1x2/1bdohqbov7eZbv0RSE=; b=LxYq8MOBC/pnp/Meo7NXh9h9GNZ3uuKUdRmpRw3vCJ3gB5zR2t6oXn9vmW9vvQK514 +5VYjqe8GLI/3GYBaPKZBPpww2ZSmolrwTDx6oaqi0HsrJlg2otymRfaZjXOiHaqbb6N e8HWoM8z5DUaK/c8qlETa/vnAd+WX/JEkinFVR6NSnMbG4Y8wyb76MP7Z0C+XyQI0Mfx QjkOHWV1BqZLCFx73u2vxyjCD1GFzNTiDMbB3vIuY0MjyFd1vEofZz3n+kD4vVlTZ+rn jiBOi5WI6nuIUIaXUBrRyuo+oaAbsl2VKz7TYf+ll+cN7vy03nyjFk7C9JcsQwSxHCqM 7zig== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:in-reply-to:references :message-id:date:mime-version; bh=9zdFuRonKraBFsLEu7m2c1x2/1bdohqbov7eZbv0RSE=; b=tGF2wryWfSykiicL+wDOe+YoAqVm9CIuIFKjfY7c6247QbZwq1oRKw8uljeOZMeOF2 bkEI2jDW1AYd8SJRNmco7QKGphlUXrW6Qq3K8W7e3hHgz6XRJnByEpPle3iK/zLNv804 WFnPRDGJyUaBW/cLOjcgb2X0rk0ZJ73NdNpfWzjhON79hlbDy5GpVL96e7NhIhjHe5BG Zb3ycNNd7y2uRvr+4bJsNYNDSR4ilBgZ2gNPtg4EV6bDeMpAehY8IWk1mwLFPOGSEn9P LEN0DkW5O84CCqBpZlvFk6+hlYB+Wt7YQXdPP1kJc4z0u3nzUourjunCWU6a+afsXLj1 p82A== X-Gm-Message-State: AOAM5335NHcZh/GBFFq7RbDn5uqO934gB0c7fvnf90UKkpX52EZG4Jfm 8IirDZUo0ojyUjGpOcwOsDgrt8HNaNpbLw== X-Google-Smtp-Source: ABdhPJxh62memVLWjCtmG3D8quRjEVhu3+keFGr21biW6BSXf9N854Qrrt2nr0jOeVuHaibjUqEs/g== X-Received: by 2002:a17:902:bc8c:b0:156:bc64:fa47 with SMTP id bb12-20020a170902bc8c00b00156bc64fa47mr20670582plb.135.1650461160675; Wed, 20 Apr 2022 06:26:00 -0700 (PDT) Received: from localhost ([64.32.23.62]) by smtp.gmail.com with ESMTPSA id r33-20020a63fc61000000b003a9f98905e9sm10674431pgk.76.2022.04.20.06.25.59 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Apr 2022 06:26:00 -0700 (PDT) From: Anders Johansson X-Google-Original-From: Anders Johansson To: emacs-orgmode@gnu.org Subject: [PATCH v2 25/38] Fix bug in org-get-headingFixes #26, where fontification could make the matching and extraction of heading In-Reply-To: References: Message-Id: <79cb6cbbbf309636f1d0c373b29e3d9568687b54.1650460489.git.yantar92@gmail.com> Date: Wed, 20 Apr 2022 21:26:53 +0800 MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=2607:f8b0:4864:20::102a; envelope-from=yantar92@gmail.com; helo=mail-pj1-x102a.google.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 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, 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" X-Migadu-Flow: FLOW_IN X-Migadu-To: larch@yhetil.org X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1650462940; 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:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=9zdFuRonKraBFsLEu7m2c1x2/1bdohqbov7eZbv0RSE=; b=avaVehewXF2DF6C8rTj7NAuX71qy70t02Bb98ppxxkpMzbYN2seJQMYXXuDTJYJiQyXgMX 84YGPQxZgkltdG0OmrfHYVIjgQsDBao3yLYOgmtf5yRmx6FiI0eHemAds8Ugn4D47u1r6m ynniiat9Ej6S530FP14wsW4JYbzPS1f5d0xCU6eqVuoTmsDp4RMjjDVrd27mGFbKseEu9w +qsMCgyD9JeptBSq+cvpxkek6PC/huDA4MBeTfR3NYmEqwNVHO2BNEJU1vMYjxu5vUrwis S/fwcU4tncIIW9Z+Zx2S/c+nJk57i3kgcqGC5FLfD9ToX9YiaCRzGIMnCA8lhg== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1650462940; a=rsa-sha256; cv=none; b=A9c1f3izMBOUdkN4SBL9YXVv0NHv5cpZhyT2obGd+PIs6kJBP8z9InduwKOV0Ih/0SCooz 4uOWtUbs9l4PRXz1GmVEeAagiICbNJLjmI3PoCvHtM5E833vWo6Kro9Sz5RyNSiPRUI/e7 aEWn/w/0Zgemts/hQUvOPobiXAPuX3nYBmJNBYUq5HjP/08R77MWNSiqrmuPOZwwEEGfVO 8PS2Tt5cCI/nQdVr7w9PgvS6dyHnavBKsitupSPUeAM4kYu6yEzen7iEApQ2XRcjHQS/z1 CE/NaXKTPXMzZriTMBegBUQ5UGm7i7b1WFBrWHs80Aqmn4JPH5je8XWzW2UzGQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=LxYq8MOB; dmarc=pass (policy=none) header.from=gmail.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" X-Migadu-Spam-Score: -3.04 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=LxYq8MOB; dmarc=pass (policy=none) header.from=gmail.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" X-Migadu-Queue-Id: D65222CCCC X-Spam-Score: -3.04 X-Migadu-Scanner: scn1.migadu.com X-TUID: PVrk6Xtptu4q Fixes #26, where fontification could make the matching and extraction of heading components fail. --- lisp/org.el | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lisp/org.el b/lisp/org.el index 0f31e7794..ff17bf001 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -6167,8 +6167,9 @@ (defun org-get-heading (&optional no-tags no-todo no-priority no-comment) (let ((case-fold-search nil)) (looking-at org-complex-heading-regexp) ;; When using `org-fold-core--optimise-for-huge-buffers', - ;; returned text may be invisible. Clear it up. - (org-fold-core-remove-optimisation (match-beginning 0) (match-end 0)) + ;; returned text will be invisible. Clear it up. + (save-match-data + (org-fold-core-remove-optimisation (match-beginning 0) (match-end 0))) (let ((todo (and (not no-todo) (match-string 2))) (priority (and (not no-priority) (match-string 3))) (headline (pcase (match-string 4) -- 2.35.1 -- Ihor Radchenko, PhD, Center for Advancing Materials Performance from the Nanoscale (CAMP-nano) State Key Laboratory for Mechanical Behavior of Materials, Xi'an Jiaotong University, Xi'an, China Email: yantar92@gmail.com, ihor_radchenko@alumni.sutd.edu.sg