Auto-formatting a source file in emacs

前端 未结 6 780
旧巷少年郎
旧巷少年郎 2021-01-29 19:47

How do I apply a set of formatting rules to an existing source file in emacs?

Specifically I have an assembly (*.s) file, but I would like a generic command

6条回答
  •  深忆病人
    2021-01-29 20:47

    if you want indent current buffer

    (defun iwb ()
      "indent whole buffer"
      (interactive)
      (delete-trailing-whitespace)
      (indent-region (point-min) (point-max) nil)
      (untabify (point-min) (point-max)))
    

提交回复
热议问题