How to define comment syntax for main mode?

I would like to add comments to the main mode that I use, which currently does not support them. The only examples I can find on the Internet show how to write single-line comments , but I need pair separators.

What do i need to change?

+4
source share
1 answer

As a result, I moved to the elisp package I was working with. The problem is that if you add

(setq comment-start "FOO")
(setq comment-end "BAR")

your-mode-hook, , comment-start, comment-end, comment-end, . , python-mode :

# def my_func(): BAR

, . , :

(add-hook 'your-mode-hook
          (lambda ()
            (set (make-local-variable 'comment-start) "FOO")
            (set (make-local-variable 'comment-end) "BAR")))

'comment-end.

+1

All Articles