Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
目前在主要模式下,我正在编写按制表符将点移动一定数量的空格。
我想要发生的更像是 python 模式如何使制表符将整行移动到正确的缩进。
有谁知道这是怎么做到的?
在主模式功能中适当设置indent-line-function,例如使用类似的东西
indent-line-function
(defun my-mode-indent-line (&optional _arg) ...) (define-derived-mode my-mode prog-mode "MyMode" "Have fun with My Mode." ... (setq-local indent-line-function #'my-mode-indent-line) ...)