From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:403:4876::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms8.migadu.com with LMTPS id KGWrNSbgUWUxMQAAG6o9tA:P1 (envelope-from ) for ; Mon, 13 Nov 2023 09:36:55 +0100 Received: from aspmx1.migadu.com ([2001:41d0:403:4876::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id KGWrNSbgUWUxMQAAG6o9tA (envelope-from ) for ; Mon, 13 Nov 2023 09:36:55 +0100 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 82DED35DBE for ; Mon, 13 Nov 2023 09:36:54 +0100 (CET) Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=BGLmKn+E; dmarc=pass (policy=none) header.from=posteo.net; 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=1699864614; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=3w6lScdeDUnZaPrYzqBJTXfeqS83eviSqB9vgLzhweU=; b=rLjO+Yrh6v7C/LgV7IvbSElYO9q2o28cam2iewcAQlZq9Ky+KTJ0FKvJc7ZPVwz0+ypUwy MnD5nOCqj63OOSXPSjztQad/tVRKWoHoqKWRmA86WHlFiAbqT8HEQNiIeuyZtwT7iSjclB ttNjfUHvKsM+M+CY3Uc44EZ8mG05l1xUY5JdUE2J5o4WZqxxcU2InzvAx9jzgVKpQLBwj4 5VQuNrcBJabeoQLJnDAPEqjB6K40+2/YcZfsWy+P1Hdvs+GrQ70IsKF/LGSqTbMZCLBScT t6V1N0MbvSwQU1W/HLXGq1GI8uHyHfUpLWK+WDWT1HqDlnx7jgxiRNgMo+0xaw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=BGLmKn+E; dmarc=pass (policy=none) header.from=posteo.net; 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=1699864614; a=rsa-sha256; cv=none; b=j8mpefljzuJClAngP8lFd7BtKohcObp/8+vunOfpyn2G6Fqomx0exCHlFUym0e5YBiwap4 ZW3ePLKQzY2ki0xY/6R7AV/ljh6v7r7I3nbuxJFJd5JQPEfbg0YuHtzo4N9c5ZnZSzTmuX yzhLm6p14ebOj3AziBpXPNN7rhyjlSKHBpmoQD8jJw/GkomN61PPWEDnwSsjpJw5cUbqd8 th/YwhPiupxAwxFMXyXoarmYhSKiVj5n/YmVWQ6TdivQcei+G97xK3Q9vGx8hemA4zKS5M 7q/uLzrSLLvqqXkRwbLMJG3ifsrfUGEKJTLtBihxq+7TgYdxDh0P/mgZPrdoCg== Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1r2SQN-0000fa-An; Mon, 13 Nov 2023 03:36:03 -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 1r2SQ3-0000Z0-9n for emacs-orgmode@gnu.org; Mon, 13 Nov 2023 03:35:44 -0500 Received: from mout02.posteo.de ([185.67.36.66]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1r2SPx-0003Xh-83 for emacs-orgmode@gnu.org; Mon, 13 Nov 2023 03:35:42 -0500 Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id 35138240106 for ; Mon, 13 Nov 2023 09:35:30 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1699864530; bh=cz0MSawfXROhvQIFYepZgQrqHGRpRig+1+LEgY9O73o=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version: Content-Transfer-Encoding:From; b=BGLmKn+ECvGMnu7wP2oFYwWWM+BROENbib5gTJUrO/mWFc045Uk6MjOOHKAWRzDy8 x3ri2uPsOkPR2FoupbeOMCHJWWSqGekbQCa6+GuG3fVbOw5TcQqNcU/L+HlrC6EUZz LuciZ5IZjjR1RfIk6K2RcNSMMXgyzLc7cDwI/lhyBVFig4fS6rxrV/BMNsT6OG/4it U4oTHBO7yK30ZH6XfqO2Pj879mxhQP+uLvhASPLGpx3sLwJFDRj5nKcCWepZ8wGElE BIgB1RlgWaJlC/P01noFk+Sj+nMQDi/FSnu2+0VLTRvXX+VBND3dybz2faOqyJPEce /5uj5D+3d63hw== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4STN6T269Wz9rxK; Mon, 13 Nov 2023 09:35:28 +0100 (CET) From: Ihor Radchenko To: JD Smith Cc: emacs-orgmode@gnu.org Subject: Re: org-src-font-lock-fontify-block is unaware of org-edit-src-content-indentation, leading to fontification issues In-Reply-To: <371CA9D8-B187-43BF-B6BE-B2122627C068@gmail.com> References: <371CA9D8-B187-43BF-B6BE-B2122627C068@gmail.com> Date: Mon, 13 Nov 2023 08:37:42 +0000 Message-ID: <87edguujzd.fsf@localhost> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Received-SPF: pass client-ip=185.67.36.66; envelope-from=yantar92@posteo.net; helo=mout02.posteo.de X-Spam_score_int: -53 X-Spam_score: -5.4 X-Spam_bar: ----- X-Spam_report: (-5.4 / 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_MED=-2.3, RCVD_IN_MSPIKE_H5=-1, RCVD_IN_MSPIKE_WL=-0.01, 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-Flow: FLOW_IN X-Migadu-Country: US X-Migadu-Spam-Score: -6.30 X-Spam-Score: -6.30 X-Migadu-Queue-Id: 82DED35DBE X-Migadu-Scanner: mx10.migadu.com X-TUID: w4qR5C9jlaqa JD Smith writes: > When `org-edit-src-content-indentation=E2=80=99 is non-nil (default: 2), = editing SRC blocks preserves this amount of extra indentation space at the = beginning of each line of the block, removing and then re-adding it on roun= d trips through `org-edit-src-code=E2=80=99. > > But `org-src-font-lock-fontify-block' does not consider this extra space.= Instead it simply copies the full block verbatim into e.g. *org-src-fonti= fication:python-mode*, as if the extra indent space were a legitimate part = of the source. Normally this wouldn=E2=80=99t be a problem, as faces are a= ttached to keywords. But for any fontification that depends explicitly on = indentation, this leads to incorrect results. For example, my indent-bars = package adds indentation bars via text properties based on absolute column = position. These bars are then offset in the displayed org src block by 2 c= olumns from their correct locations, due to the extra space org has put the= re. Duplicate of https://list.orgmode.org/orgmode/CAOn=3DhbevUMGS0-qMTy8kB4-db65s1Tmn0cQJcw8= b++PZZ=3DvULA@mail.gmail.com/ Handled. --=20 Ihor Radchenko // yantar92, Org mode contributor, Learn more about Org mode at . Support Org development at , or support my work at