5 karma · joined Dec 29, 2021 (4y ago) · 9 submissions
comment 4y ago · link · parent
The other thing you might want to try is to remap the function indent-for-tab-command to insert-tab.
comment 4y ago · link · parent
I'm not at a computer with an emacs installation so I can't try it out myself. I would try binding to a regular key (e.g. "q") while debugging to try to reduce the possible problems.
I think you'll find that remapping tab everywhere like that is going to break a lot of things though (navigating fields/links, expanding sections, etc). You might want to just remap the key by explicitly listing the modes you care about.
The #emacs channel on libera (previously freenode) used to be amazing but since IRC waned it's become less good but if you're lucky and during busy times you might still find someone there that can give you a better solution.
comment 4y ago · link · parent
There's also general-override-mode-map from the "general" package.
edit: Looking at the code I don't think bind-key* creates a minor-mode but it still does what you want (and is probably the recommended way).
comment 4y ago · link · parent
(require 'bind-key)
(bind-key* (kbd "tab") (lambda () (insert " ")))
And you should probably construct the number of spaces from the tab-width variable.