Configure emacs to handle gas-style comments
Posted: Fri Jun 02, 2017 8:30 am
How do I configure emacs to "play nice" with assembly code to be compiled by the gnu assembler?
asm-mode assumes that the semi-colon is the only comment character. gas allows '#', '//', and '/* */'.
I figured out how to change the comment character to '#' using (setq asm-comment-char ?\#); but, indenting and line breaking still don't work right.
Specifically, if I type a long comment and press M-q, the lines break, but the additional lines are not prefixed by '#'. If I edit a comment and press M-q, the lines break, but the existing comment characters end up in the middle of lines.
Support for '//' and '/* */' would be nice, but I'll be happy if I can just get the '#' comments to re-balance when I edit them.
If there aren't any good solutions for emacs, can anybody suggest a better editor? (I did check out SASM, but it doesn't appear to "re-balance" comments. CLion only recently added syntax highlighting for assembly, and my University won't upgrade the image until the end of summer term.)
asm-mode assumes that the semi-colon is the only comment character. gas allows '#', '//', and '/* */'.
I figured out how to change the comment character to '#' using (setq asm-comment-char ?\#); but, indenting and line breaking still don't work right.
Specifically, if I type a long comment and press M-q, the lines break, but the additional lines are not prefixed by '#'. If I edit a comment and press M-q, the lines break, but the existing comment characters end up in the middle of lines.
Support for '//' and '/* */' would be nice, but I'll be happy if I can just get the '#' comments to re-balance when I edit them.
If there aren't any good solutions for emacs, can anybody suggest a better editor? (I did check out SASM, but it doesn't appear to "re-balance" comments. CLion only recently added syntax highlighting for assembly, and my University won't upgrade the image until the end of summer term.)