diff options
| author | Thomas Voss <mail@thomasvoss.com> | 2026-03-22 17:05:21 +0100 |
|---|---|---|
| committer | Thomas Voss <mail@thomasvoss.com> | 2026-03-22 17:05:21 +0100 |
| commit | f0e047b0674817c3fba38386a151c0b2ed620f50 (patch) | |
| tree | 38598c348f7f536c2f0c302693856349639295d6 /.config/emacs/modules/mm-editing.el | |
| parent | 9a40ca3f9f198cb14c64c25edcf7c325ca2b8e5e (diff) | |
| parent | cb6831070008c56d3f287c4c754526d2c9d735a2 (diff) | |
Diffstat (limited to '.config/emacs/modules/mm-editing.el')
| -rw-r--r-- | .config/emacs/modules/mm-editing.el | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/.config/emacs/modules/mm-editing.el b/.config/emacs/modules/mm-editing.el index 2ae4107..e15e739 100644 --- a/.config/emacs/modules/mm-editing.el +++ b/.config/emacs/modules/mm-editing.el @@ -136,22 +136,29 @@ those should be listed in `mm-editing-indentation-settings'." ;;; Code Commenting -(defun mm-c-comment-no-continue () +(defun mm-newcomment-c-config () (setq-local comment-continue " ")) -(defun mm-mhtml-comment-no-continue () +(defun mm-newcomment-html-config () (setq-local comment-continue " ")) +(defun mm-newcomment-rust-config () + (setq-local comment-start "/* " + comment-end " */" + comment-continue " * " ; rustfmt doesn’t play nice + comment-quote-nested nil)) + (use-package newcomment :custom (comment-style 'multi-line) :config (dolist (mode '(c-mode c++-mode)) - (add-hook (mm-mode-to-hook mode) #'mm-c-comment-no-continue) + (add-hook (mm-mode-to-hook mode) #'mm-newcomment-c-config) (when-let ((ts-mode (mm-mode-to-ts-mode mode)) ((fboundp ts-mode))) - (add-hook (mm-mode-to-hook ts-mode) #'mm-c-comment-no-continue))) - (add-hook 'mhtml-mode #'mm-mhtml-comment-no-continue)) + (add-hook (mm-mode-to-hook ts-mode) #'mm-newcomment-c-config))) + (add-hook 'mhtml-mode #'mm-newcomment-html-config) + (add-hook 'rust-ts-mode #'mm-newcomment-rust-config)) ;;; Multiple Cursors |