How can I set a default TAB behavior (i.e. 4 spaces instead of tab) in an Org source-block when the language is not supported? Example:
#+begin_src xyz
lkjsdf
iouqweou
#+end_src
Using TAB within the source-block gives me the following error message:
org-edit-src-code: No such language mode: xyz-mode
I've already added
(setq-default indent-tabs-mode nil)
(setq-default tab-width 4)
to the top of my init-file, and I'm loading org-mode via use-package
(use-package org
:ensure org-plus-contrib
:mode (("\\.org\\'" . org-mode))
:hook
(org-mode . variable-pitch-mode)
(org-mode . visual-line-mode)
:config
(setq org-src-preserve-indentation t)
(setq org-src-tab-acts-natively t))
tab-width
is definitely not what you want to change here.C-h o tab-width RET
says "NOTE: This controls the display width of a TAB character, and not the size of an indentation step."TAB
is bound toorg-cycle
, which does not give rise to the error you show, so you probably have some customization in place. Check whatTAB
is bound to in your case withC-h c TAB
. Also, tryemacs -q -l minimal.el
whereminimal.el
is an init file with the bare minimum of initialization needed and see if you can reproduce the problem there: I suspect you will not be able to.emacs -q
TAB
is bound toorg-cycle
; when I use my own init-file,TAB
is also bound toorg-cycle
-- so no difference there. And also when starting withemacs -q
the issue remains the same: If I pressTAB
in a code-block of an unknown language, the cursor won't move.TAB
in a code-block of an unknown language, the cursor won't move and I get the aforementioned error-message … and that's not the behavior I want; if I pressTAB
in an source-block of an unknown language, I want that the cursor moves 4 spaces.