1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-06 06:20:55 -08:00

Initialize native-tab-width in cases where there is no language mode

org-src-font-lock-fontify-block creates an uninitialized
native-tab-width variable and then, when there is no language set on a
block, ends up using it.  This triggers an error.
This commit is contained in:
Mark A. Hershberger 2025-08-09 13:02:54 -04:00
parent 210bcf1366
commit c4af4b3901
No known key found for this signature in database
GPG key ID: C5E6B11787B8FA01

View file

@ -665,7 +665,8 @@ Leave point in edit buffer."
"Fontify code block between START and END using LANG's syntax.
This function is called by Emacs's automatic fontification, as long
as `org-src-fontify-natively' is non-nil."
(let ((modified (buffer-modified-p)) native-tab-width)
(let ((modified (buffer-modified-p))
(native-tab-width tab-width))
(remove-text-properties start end '(face nil))
(let ((lang-mode (org-src-get-lang-mode lang)))
(when (fboundp lang-mode)