org-indent-line: Do not err in src blocks when there is no language mode

* lisp/org.el (org-indent-line): When attempting to indent as in major
mode, ignore any errors, like errors arising when the major mode is
not available.
This commit is contained in:
Ihor Radchenko 2024-05-02 19:47:26 +03:00
parent fede1c9909
commit 1cafe3e8e4
No known key found for this signature in database
GPG Key ID: 6470762A7DA11D8B
1 changed files with 2 additions and 1 deletions

View File

@ -19696,7 +19696,8 @@ Also align node properties according to `org-property-format'."
(org-with-point-at (org-element-property :begin element)
(+ (org-current-text-indentation)
org-edit-src-content-indentation)))))
(org-babel-do-in-edit-buffer (funcall indent-line-function))
(ignore-errors ; do not err when there is no proper major mode
(org-babel-do-in-edit-buffer (funcall indent-line-function)))
(when (and block-content-ind (looking-at-p "^$"))
(indent-line-to block-content-ind))))
(t