asm-mode, C-hk; reports that ; is bound to
The Commentary for
asm-mode RET) says:
This minor mode is based on text mode. It defines a private abbrev table
that can be used to save abbrevs for assembler mnemonics. It binds just
TAB tab to next tab stop
: outdent preceding label, tab to tab stop
comment char place or move comment
asm-comment-char specifies which character this is;
you can use a different character in different
Asm mode buffers.
C-j, C-m newline and tab to tab stop
Code is indented to the first tab stop level.
This mode runs two hooks:
1) An asm-mode-set-comment-hook before the part of the initialization
depending on asm-comment-char, and
2) an asm-mode-hook at the end of initialization.
So the variable
asm-comment-char defines the comment character, and the mode uses this value to bind the associated key to the
asm-comment command (i.e. "place or move comment").
You can configure this value globally via M-x
Exactly how this feature works is entirely up to how the mode is written. In this case I can see that when the
asm-mode function is called it generates a new local keymap for the buffer which inherits from
asm-mode-map, and it defines the comment key in there.
Immediately before it does that it runs
asm-mode-set-comment-hook, so one could also set a value for
asm-comment-char (potentially a buffer-local value) using that hook, instead of customizing the option globally.
All of this commenting configuration happens when the
asm-mode function runs, so changing the global value doesn't affect existing
asm-mode buffers; but you could just run
M-x asm-mode in a buffer to get it to pick on on a change to
asm-comment-char, or you could revert the buffer(s), or re-visit them.
- or kill the buffer and re-visit it
- or use something like M-x
ibuffer to mark and revert buffers en-masse
ibuffer that would be *M
asm-mode RET to mark, and V to revert.
Note that the way the keymap is generated means that each
asm-mode buffer has its own independent comment key binding, so reverting a single buffer will not affect the pre-existing comment bindings in other
asm-mode buffers, so reverting them all after a change to the global comment char option would make sense.