From abb04c520b7e68f4f05c3d65b012715a1cfc6365 Mon Sep 17 00:00:00 2001 From: Thomas Voss Date: Sat, 9 Nov 2024 11:50:22 +0100 Subject: emacs: Add commenting configuration --- .config/emacs/modules/mm-editing.el | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) (limited to '.config/emacs') diff --git a/.config/emacs/modules/mm-editing.el b/.config/emacs/modules/mm-editing.el index 6fbb44f..1b75649 100644 --- a/.config/emacs/modules/mm-editing.el +++ b/.config/emacs/modules/mm-editing.el @@ -118,15 +118,20 @@ those should be listed in `mm-editing-indentation-settings'." (set (make-local-variable extra) tabsize))))) -;;; Make Tab Not Suck +;;; Code Commenting -(use-package indent - :custom - (tab-always-indent t)) +(defun mm-c-comment-no-leading-stars () + (setq-local comment-continue " ")) -(use-package electric +(use-package newcomment + :custom + (comment-style 'multi-line) :config - (setq-default electric-indent-inhibit t)) + (dolist (mode '(c-mode c++-mode)) + (add-hook (mm-mode-to-hook mode) #'mm-c-comment-no-leading-stars) + (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-leading-stars)))) ;;; Multiple Cursors -- cgit v1.2.3