From: Ihor Radchenko <yantar92@posteo.net>
To: JD Smith <jdtsmith@gmail.com>
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
Date: Mon, 13 Nov 2023 08:37:42 +0000 [thread overview]
Message-ID: <87edguujzd.fsf@localhost> (raw)
In-Reply-To: <371CA9D8-B187-43BF-B6BE-B2122627C068@gmail.com>
JD Smith <jdtsmith@gmail.com> writes:
> When `org-edit-src-content-indentation’ 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’.
>
> 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’t 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.
Duplicate of
https://list.orgmode.org/orgmode/CAOn=hbevUMGS0-qMTy8kB4-db65s1Tmn0cQJcw8b++PZZ=vULA@mail.gmail.com/
Handled.
--
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>
next prev parent reply other threads:[~2023-11-13 8:36 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-11-12 15:39 org-src-font-lock-fontify-block is unaware of org-edit-src-content-indentation, leading to fontification issues JD Smith
2023-11-13 8:37 ` Ihor Radchenko [this message]
2023-11-13 12:25 ` JD Smith
2023-11-13 12:30 ` Ihor Radchenko
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.orgmode.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87edguujzd.fsf@localhost \
--to=yantar92@posteo.net \
--cc=emacs-orgmode@gnu.org \
--cc=jdtsmith@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).