我一直在尝试在批处理模式下使用 emacs 来漂亮地打印 ActionScript 文件,但它并没有完全达到我的预期。我从这里http://blog.pettomato.com/?p=12下载了 actionscript-mode.el 和 as-config.el 并将它们放入我的主目录,将 actionscript-mode.el 复制到我的工作目录中。然后我也在我的主目录中创建了一个文件“.emacs”,内容如下:
(load "~/actionscript-mode.el")
(actionscript-mode)
(indent-region 0 (buffer-size) nil)
(save-buffer)
然后我转到格式不正确的 .as 文件的目录并在命令行上运行此命令:
emacs -batch WrongFormat.as -l ~/.emacs -l actionscript-mode.el
And I get:
Loading /Users/pnm/actionscript-mode.el (source)...
Indenting region...
Indenting region... done
(No changes need to be saved)
现在的问题是:
如何让 emacs 重新格式化花括号而不是新行?我越来越绝望,我不确定用木棍敲击 50 次是否是强制执行代码样式指南的好方法。