From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id cA1UFVRNsWCEgQAAgWs5BA (envelope-from ) for ; Fri, 28 May 2021 22:06:44 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id 8EKyEFRNsWBsTAAAB5/wlQ (envelope-from ) for ; Fri, 28 May 2021 20:06:44 +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 8C89A11089 for ; Fri, 28 May 2021 22:06:43 +0200 (CEST) Received: from localhost ([::1]:60282 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lmikk-0000EL-JH for larch@yhetil.org; Fri, 28 May 2021 16:06:42 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:39168) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lmik3-000084-Or for emacs-orgmode@gnu.org; Fri, 28 May 2021 16:06:00 -0400 Received: from mout01.posteo.de ([185.67.36.65]:55815) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lmik1-0002iW-9a for emacs-orgmode@gnu.org; Fri, 28 May 2021 16:05:59 -0400 Received: from submission (posteo.de [89.146.220.130]) by mout01.posteo.de (Postfix) with ESMTPS id 5A89F240028 for ; Fri, 28 May 2021 22:05:52 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.eu; s=2017; t=1622232352; bh=pWocahbV2ZJlJIrcPYq6zj05VTTaaVo0TVx+rUePWwE=; h=Subject:To:From:Date:From; b=Zku5J2ITLtdeLi+demjxyKp7Ck+7AHrUsyDp+pJBjPkrbX8hLYeYZUfM0mFQIMG+l 5A22uo8qqGmHSpiDubJ01RgkVqYqYP6Ql2uGsoekVr9A7U4GhEXKKx8bxxE4XcuYTE +IlhUNYzDES7QuHAJ8P/3uJLxspex+OEvMnPrHWGG6NYHd/+zt+uNUCCoJ1yQvaKeF iYJyY997Jz86CWEBKyCR0Bxa2pVOeUZM2/8zlQUmGF9dS4huw3u/EIdZPzZ5jvVZ+Q pu7gcvJRKJS40GILOxUKRU7i/fxSabRjDLZf8j9UKXTP0YwknFkEMKNri1hIrknXB0 DU4mqvZBqFs9w== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4FsFzz0dMXz6tmF; Fri, 28 May 2021 22:05:50 +0200 (CEST) Subject: Re: [PATCH] Bug: No highlighting after [9.4.6 (release_9.4.6-544-gc5573b @ /home/user/.emacs.d/straight/build/org/)] To: Axel Svensson , emacs-orgmode References: X-Woof-Bug: confirmed From: =?UTF-8?Q?S=c3=a9bastien_Miquel?= Message-ID: Date: Fri, 28 May 2021 20:05:50 +0000 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/mixed; boundary="------------F9E67F4B6EA39F3493DD93C2" Content-Language: fr Received-SPF: pass client-ip=185.67.36.65; envelope-from=sebastien.miquel@posteo.eu; helo=mout01.posteo.de 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_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, 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: , Reply-To: sebastien.miquel@posteo.eu 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=1622232403; h=from:from:sender:sender:reply-to: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=utAO9vHfqZ70aIXhM6vbhzoq2p2aBEkSsejyMHLtl7A=; b=B7+lgRrG5gXE5389hE8BLgl1RIxDC4n+GbCUGHtOrFvPkk0odss6Eh+5jSmOptetuhKbd+ jHdjjpHh+ri/uIqB+10mlsqvu2aMvFSfJMKiqE8HuXSbrndLeGhNMB9xnjYbV9pmaOcE68 xzZArOsKfnmVJhYEliehEH0VbnPIJpwu0H9H4ygFsCJS7N0dpaktmnLes5L2yggIl+CmD0 7VDGqvjM2/PVAA9bi3dEYa8h3V4dbQMdbpgE8x8/Jhj+KdSfzrpc/6O2OID0Lml2ur2unT 8Z1gve+MyhewO938Fp7grNZlUXYso9aCJJQxncUuj7+WiG8xkpTCw96E6SBkFA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1622232403; a=rsa-sha256; cv=none; b=KwcahRAbwHVZBd8t5dOXnNdQs8/Nj2Y7hwBJQfWtIQGoxg57icv5JDi3LbImivVfb1LhkY sAmBcgmds1sB55agJPXCtw9ZPbRmuFxx4kQLgA3SgVuFO2vx/WeODokre/aypjJwGFnmyO o2GXlY1cFPS0fQvKkFJ/eUiZ5/k3ONovWS/Xue+argcfasjJxM4pnm6AjT6EpzFNbnQ8em OqihzkBc0YVTFAXhdztHgD48hSdi3L+P7sYRGBiSijY12+HaP3OSdIEPZf9hDL3sIgoU89 JkVNkrlUxnlTQ6PBHP450B/jI8hTabXyAB9xN67HzhZY5KrSGtZ8gcR/ScF9Ig== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=posteo.eu header.s=2017 header.b=Zku5J2IT; 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: -3.13 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=posteo.eu header.s=2017 header.b=Zku5J2IT; dmarc=pass (policy=none) header.from=posteo.eu; 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: 8C89A11089 X-Spam-Score: -3.13 X-Migadu-Scanner: scn0.migadu.com X-TUID: 6tVl7OjkBkWX This is a multi-part message in MIME format. --------------F9E67F4B6EA39F3493DD93C2 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Hi, Axel Svensson writes: > Steps to reproduce: > 1) In an empty org-mode buffer, type a * SPC a C-b C-b C-b . > 2) The buffer now has two lines, the first one "a" and the second "* a". > > Expected: > 3) The second line is formatted as a first-level heading. > > Actual: > 3) The second line is formatted as normal text. Thanks for the report, I can confirm this bug with latest org. Here's a patch that fixes this. Regards, -- Sébastien Miquel --------------F9E67F4B6EA39F3493DD93C2 Content-Type: text/x-patch; charset=UTF-8; name="0001-org.el-org-fontify-extend-region-Fix-headline-fontif.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename*0="0001-org.el-org-fontify-extend-region-Fix-headline-fontif.pa"; filename*1="tch" >From c598f705bf1d8003514751fffc07fd64620a7e42 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Miquel?= Date: Fri, 28 May 2021 21:14:22 +0200 Subject: [PATCH] org.el (org-fontify-extend-region): Fix headline fontification in edge case * lisp/org.el (org-fontify-extend-region): Fix fontification of headline or meta line created by inserting a newline. Unrelated to the fix: `org-fontify-extend-region' is added to `font-lock-extend-after-change-region-function' and doesn't need to use `save-excursion'. --- lisp/org.el | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/lisp/org.el b/lisp/org.el index 1bd9e02eb..b7b1416bd 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -5427,7 +5427,9 @@ by a #." t))))) (defun org-fontify-extend-region (beg end _old-len) - (let ((begin-re "\\(\\\\\\[\\|\\(#\\+begin_\\|\\\\begin{\\)\\S-+\\)") + (let ((end (if (progn (goto-char end) (looking-at-p "^[*#]")) + (1+ end) end)) + (begin-re "\\(\\\\\\[\\|\\(#\\+begin_\\|\\\\begin{\\)\\S-+\\)") (end-re "\\(\\\\\\]\\|\\(#\\+end_\\|\\\\end{\\)\\S-+\\)") (extend (lambda (r1 r2 dir) @@ -5437,15 +5439,14 @@ by a #." "[][]" r2 (match-string-no-properties 0))))) (re-search-forward (regexp-quote re) nil t dir))))) + (goto-char beg) + (back-to-indentation) (save-match-data - (save-excursion - (goto-char beg) - (back-to-indentation) - (cond ((looking-at end-re) - (cons (or (funcall extend "begin" "[" -1) beg) end)) - ((looking-at begin-re) - (cons beg (or (funcall extend "end" "]" 1) end))) - (t (cons beg end))))))) + (cond ((looking-at end-re) + (cons (or (funcall extend "begin" "[" -1) beg) end)) + ((looking-at begin-re) + (cons beg (or (funcall extend "end" "]" 1) end))) + (t (cons beg end)))))) (defun org-activate-footnote-links (limit) "Add text properties for footnotes." -- 2.31.1 --------------F9E67F4B6EA39F3493DD93C2--