From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:303:e16b::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms8.migadu.com with LMTPS id SLD4Cd3xUGXEvgAAauVa8A:P1 (envelope-from ) for ; Sun, 12 Nov 2023 16:40:13 +0100 Received: from aspmx1.migadu.com ([2001:41d0:303:e16b::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id SLD4Cd3xUGXEvgAAauVa8A (envelope-from ) for ; Sun, 12 Nov 2023 16:40:13 +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 2087A6564D for ; Sun, 12 Nov 2023 16:40:12 +0100 (CET) Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=LfnDgpUP; 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"; dmarc=pass (policy=none) header.from=gmail.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1699803613; 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=ZZ5y0whtlKIwEvy/KOW+gJYdwLd+pdOabtzmG1pX70g=; b=gG3Ft+MlcP95MpAWzz6EBtllpV3wpdaH87zh2on24eBQWIpeKAH5hBWI/ZQjsIGCHXASmN UzEgteP4O7b7VodMycewL3z9ronKh2uG82cm0fJGbqPOodl3qI5ky3TjO9rsn8viK3Q/74 sDGzOfdoqBjLXF8cYWr5mV9tQRmzFMdCuflfamonYl9GdiFLOb2p3SgZ9/QlWvb67XUIMs B8MzTFb19Mrk8qV3tn8vjL3z5HrHZV82MQWAmurDpZrEb8YkZM3At4ioSD9Xqe2b96Lzcu kmmiI0PxOhPBq6v1EM0ZFkZ+EjXjJdyQDR8TrgRO/JvjtIDSKEinATK+etNk7g== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=LfnDgpUP; 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"; dmarc=pass (policy=none) header.from=gmail.com ARC-Seal: i=1; s=key1; d=yhetil.org; t=1699803613; a=rsa-sha256; cv=none; b=S4HwdXcV9XmB9iLYdnQ+jdrcd3u+BH46YBKNIO/XnzEXK5AQFpu7yOjNsuOtNgjbnxb4EH AqTwF8LzRd2bJpC4mgU4HlIAt3xf7ruKlTk9z2f6TII8dfpopEJwJHXx5TV+sC2QMHeoC1 +K8P6TTDZ+BAfgm1o2fULUDoEK5ov440Bvdl0NLwvgaYMef4XPeejMWwuNAUCP9KmiOFE+ amEbOPT3DVmwtxmgUxzNFrb5V9n93OQxw75620zmyW99UTsILyS0tfHdqY8ThHmDaiHZqV UTCYd/bLFzUBicUqagDgbkMIfktEb0p6G4PkHpP+MKEJg94+JisFNsmh4xtEgw== Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1r2CYa-0006x6-DV; Sun, 12 Nov 2023 10:39:28 -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 1r2CYY-0006wU-9z for emacs-orgmode@gnu.org; Sun, 12 Nov 2023 10:39:26 -0500 Received: from mail-io1-xd35.google.com ([2607:f8b0:4864:20::d35]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1r2CYW-0008SU-LL for emacs-orgmode@gnu.org; Sun, 12 Nov 2023 10:39:26 -0500 Received: by mail-io1-xd35.google.com with SMTP id ca18e2360f4ac-7b006f7c473so79169239f.2 for ; Sun, 12 Nov 2023 07:39:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1699803562; x=1700408362; darn=gnu.org; h=to:date:message-id:subject:mime-version:from:from:to:cc:subject :date:message-id:reply-to; bh=ZZ5y0whtlKIwEvy/KOW+gJYdwLd+pdOabtzmG1pX70g=; b=LfnDgpUP3AoggSaw3c91qobOYCRYx4lVwNdYR5K5N6lbDGQjsY+Sd63E37BPgLhcdK mKD+d6Kfsc9gMbxxHTbt8hibmEsxZ6ARZ9U8pWgdl+iTVeLtNTfI7Kkv+9Z2+foHqsT8 MaKcFU1hT/Hy6kfPrWHtI7Ekcv+M5VlE/YUp2BpSKOP6GtQDB5TIDnLTv2ttMUy+b6E9 c50GpYG8DDPie8O1tOd5Lf/CgkEWUq/gYCw2HP5KSnMegJ3TbiAKTqEXU02+UyOL2CGt 6mgfdNE03lW+4wXh5vwlROEKA1WAepZdGaK+qb+7PP08wj78qWBjgb7stmPTYCB48Xg4 oJ2Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699803562; x=1700408362; h=to:date:message-id:subject:mime-version:from:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=ZZ5y0whtlKIwEvy/KOW+gJYdwLd+pdOabtzmG1pX70g=; b=WmUS5ll5KBUDfwCAxjGHA2DcRwQpROih2Xi7rpAvWNJno/KeYgQHhjKePdDZ0EL2Er 2cbz5M474tjpDZ1Ul7Z3lQwER8adxDm6eXjzGALdZhQb82/3Yfytx0WO4YpIVF9bbI3l wXCGFc7T+6itGDUlEIA3UgHDpgpAcrCv/3q9aRF76Ze/GCjnB1sffBH9olbxq/SjUdXD pkD9atmf2CBc0bIZtzG8vBOkU1rNby3wsUxIc+Gko7sZE25xF3BG6orhSQ6JAAucVU6B ryJ8OBlmEXrAhet7AjaIArbVv0DStPpSnuXtuEGxsDZ8PqGM5QZ3+WTOnli5oR/q2ppj +KDw== X-Gm-Message-State: AOJu0YxV7BE+Gb9N+Lbc2Q+bZ7d84uAErdNCkk3J9EMZCpqD4RTn1uH+ k2DpRyHyWCxug8p33VdDr9EBRitJH0s= X-Google-Smtp-Source: AGHT+IE8/Wl9ZGiZidad/qinLgHNgyLTJTCgcwGN29MIIJJ2DaOddcTUa6dBt+UN42KRlOu+3a3HNg== X-Received: by 2002:a5d:9a98:0:b0:7a9:b1c9:665a with SMTP id c24-20020a5d9a98000000b007a9b1c9665amr5217260iom.6.1699803561603; Sun, 12 Nov 2023 07:39:21 -0800 (PST) Received: from smtpclient.apple (cm-24-53-187-34.buckeyecom.net. [24.53.187.34]) by smtp.gmail.com with ESMTPSA id z13-20020a6b0a0d000000b0077a1b6f73b9sm1149748ioi.41.2023.11.12.07.39.20 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sun, 12 Nov 2023 07:39:20 -0800 (PST) From: JD Smith Content-Type: multipart/alternative; boundary="Apple-Mail=_25AA1B66-853C-487A-99B3-1243623974AF" Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3731.700.6\)) Subject: org-src-font-lock-fontify-block is unaware of org-edit-src-content-indentation, leading to fontification issues Message-Id: <371CA9D8-B187-43BF-B6BE-B2122627C068@gmail.com> Date: Sun, 12 Nov 2023 10:39:09 -0500 To: emacs-orgmode@gnu.org X-Mailer: Apple Mail (2.3731.700.6) Received-SPF: pass client-ip=2607:f8b0:4864:20::d35; envelope-from=jdtsmith@gmail.com; helo=mail-io1-xd35.google.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, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, HTML_MESSAGE=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-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US X-Migadu-Spam-Score: -6.42 X-Spam-Score: -6.42 X-Migadu-Queue-Id: 2087A6564D X-Migadu-Scanner: mx13.migadu.com X-TUID: PTrHl2v70qFT --Apple-Mail=_25AA1B66-853C-487A-99B3-1243623974AF Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 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 round 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-fontification: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 attached 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 columns from their correct = locations, due to the extra space org has put there. A sensible solution might be for fontify-block to strip = `org-edit-src-content-indentation=E2=80=99 worth of space from the = beginning of each line, just as is done for src block editing, then = perform the fontification, then add that space back to the fontified = text for display. Thanks for all your work on org.= --Apple-Mail=_25AA1B66-853C-487A-99B3-1243623974AF Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=utf-8 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 round 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-fontification: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 attached 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 columns from their correct locations, due to the extra = space org has put there.

A sensible = solution might be for fontify-block to strip `org-edit-src-content-indentation=E2=80=99 worth of = space from the beginning of each line, just as is done for src block = editing, then perform the fontification, then add that space back to the = fontified text for display.

Thanks for all = your work on org.
= --Apple-Mail=_25AA1B66-853C-487A-99B3-1243623974AF--