I've tried it various ways over time, and settled on the approach whereby each (potentially-modified) key in a command key sequence is written in standard Emacs notation and wrapped in <kbd> markup, and anything else the user types (commonly at a prompt) is wrapped in backticks.
This distinguishes the command key sequences from other typed text, which I feel makes for the most easily-comprehensible output.
Any concerns about the difficulty of entering the markup would seem to be virtually moot in a forum where every single person writing an answer uses Emacs, given that modern web browsers have extensions to allow you to edit textareas in your editor of choice.
The following is an example from SO:
So first, check to see if you have an existing file.
C-hv user-init-file
RET
By default it will show you a file path ending in /.emacs
(even if that file doesn't exist), but on the (unlikely, in your case) offchance that it ends in /.emacs.el
or /.emacs.d/init.el
then it would mean that you have an existing init file at that location.
Load that file with the appropriate one of the following:
- C-xC-f
~/.emacs
RET - C-xC-f
~/.emacs.el
RET - C-xC-f
~/.emacs.d/init.el
RET
Or you could load it regardless of where it was with:
M-: (find-file user-init-file)
RET
Then you can simply add that line of code to the file:
(setq visible-bell 1)
Save the file:
C-xC-s
And the next time you start Emacs, it will use that setting.
You can also evaluate the setting immediately by typing C-xC-e with the cursor after the closing parenthesis.