[Emacs mode] Add debug output function.
[Emacs mode] Add a semaphore block.