サイトマップ 更新履歴 ニュース Elispセクション 利用手引

ReformatBuffer

Try this:

C-x h C-M-\

    C-x h runs the command mark-whole-buffer
    M-C-\ runs the command indent-region

You can also insert something like:

    (defun indent-buffer ()
      (interactive)
      (save-excursion
        (indent-region (point-min) (point-max) nil)))
    (global-set-key [f12] 'indent-buffer)

If you want to rewrap comments afterwards, see CodeBeautifying.


CategoryIndentation