From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id YMrzCXx15F6yUQAA0tVLHw (envelope-from ) for ; Sat, 13 Jun 2020 06:43:08 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id mHioBXx15F6ERgAAbx9fmQ (envelope-from ) for ; Sat, 13 Jun 2020 06:43:08 +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 0BB7A9404D7 for ; Sat, 13 Jun 2020 06:43:06 +0000 (UTC) Received: from localhost ([::1]:55122 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jjzsf-0004of-QN for larch@yhetil.org; Sat, 13 Jun 2020 02:43:05 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35858) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jjzs3-0004oK-B2 for emacs-orgmode@gnu.org; Sat, 13 Jun 2020 02:42:27 -0400 Received: from pb-smtp2.pobox.com ([64.147.108.71]:56330) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jjzs1-0003tN-02 for emacs-orgmode@gnu.org; Sat, 13 Jun 2020 02:42:26 -0400 Received: from pb-smtp2.pobox.com (unknown [127.0.0.1]) by pb-smtp2.pobox.com (Postfix) with ESMTP id BCD2369332; Sat, 13 Jun 2020 02:42:22 -0400 (EDT) (envelope-from kyle@kyleam.com) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=pobox.com; h=from:to:cc :subject:in-reply-to:references:date:message-id:mime-version :content-type; s=sasl; bh=6m71QesXxvo/ofVcPY4gVasHPjw=; b=czwEgN elusVOUKKnoEZa/8SeF4Tf9AxL+XbScu0xloHkKGnNq5Wd0ZFbjiTyI/YNn1Q4Ac peLq0+wiIp4yYJzq8dAHiIGT4rW2dsuNkX/DlBbLbDXd8V8i8ImW6oIsMtOLM5Bo ASggnESs4xigZNH1j5DjHILwp9gPjijqKTEM4= Received: from pb-smtp2.nyi.icgroup.com (unknown [127.0.0.1]) by pb-smtp2.pobox.com (Postfix) with ESMTP id A51DB69331; Sat, 13 Jun 2020 02:42:22 -0400 (EDT) (envelope-from kyle@kyleam.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=kyleam.com; h=from:to:cc:subject:in-reply-to:references:date:message-id:mime-version:content-type; s=mesmtp; bh=Jj1Ckmj39hy9t1VzzkHiDVUMHj2+joX21lUqf22HvNM=; b=KDa1tJtT0NPDLhVppFzSqz24vuBUYVnsaGFG2qtOUnt+gCCYwSOuhl/W4FmVpdccrsCRTfVYVTiSYByqbO3x3Ock0Zf6k4FPkLcXTuPIIpL8vukLqCDMmbmx9mdaPcurB/JtnJDIJpB4LjJYCQLgN/YwxT+RLjzUWlx8v+6fIwg= Received: from localhost (unknown [45.33.91.115]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by pb-smtp2.pobox.com (Postfix) with ESMTPSA id 1616F69330; Sat, 13 Jun 2020 02:42:22 -0400 (EDT) (envelope-from kyle@kyleam.com) From: Kyle Meyer To: ciolfi@mathworks.com Subject: Re: Bug: fontification error with #end_src in 9.3.7 [9.3.7 (9.3.7-dist @ /PATH/TO/org/install/emacs/site-lisp/org/)] In-Reply-To: References: X-Woof-Bug: confirmed Date: Sat, 13 Jun 2020 06:42:21 +0000 Message-ID: <87sgezpiuq.fsf@kyleam.com> MIME-Version: 1.0 Content-Type: text/plain X-Pobox-Relay-ID: 08D81D86-AD41-11EA-989F-D1361DBA3BAF-24757444!pb-smtp2.pobox.com Received-SPF: pass client-ip=64.147.108.71; envelope-from=kyle@kyleam.com; helo=pb-smtp2.pobox.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/06/13 02:42:22 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] 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, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN 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: , Cc: emacs-orgmode@gnu.org Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Scanner: scn0 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=pobox.com header.s=sasl header.b=czwEgN e; dkim=pass header.d=kyleam.com header.s=mesmtp header.b=KDa1tJtT; dmarc=none; 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-Spam-Score: -1.21 X-TUID: CI220fLIHwZm John Ciolfi writes: > Given the following org file, on the #+end_src line, I get "Org mode > fontification error in # at 9". If I place a newline > before the #+end_src line, the error goes away. This is a recent > regression. This worked fine in 9.2.6 and prior. > > #+begin_src C++ > #include > int main() { > std::cout << "hello"; > return 0; > } > > // The results: > #+end_src > > #+RESULTS: Thanks for the report. This bisects to 04d2828ad (org: Fix verbatim block fontification to end blocks on headlines, 2019-12-11). Reverting different parts of that patch, it seems this is the problematic hunk: diff --git a/lisp/org.el b/lisp/org.el index 68ca5839a..14840d8ca 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -5320,10 +5320,14 @@ (defun org-fontify-meta-lines-and-blocks-1 (limit) (add-text-properties beg (if whole-blockline bol-after-beginline end-of-beginline) '(face org-block-begin-line)) - (add-text-properties - beg-of-endline - (min (point-max) (if whole-blockline (min (point-max) (1+ end-of-endline)) end-of-endline)) - '(face org-block-end-line)) + (unless (string-prefix-p "*" (match-string 1)) + (add-text-properties + beg-of-endline + (if whole-blockline + (let ((beg-of-next-line (1+ end-of-endline))) + (min (point-max) beg-of-next-line)) + (min (point-max) end-of-endline)) + '(face org-block-end-line))) t)) ((member dc1 '("+title:" "+author:" "+email:" "+date:")) (org-remove-flyspell-overlays-in I'll try to take a closer look tomorrow.