From 0ceefc7fe2dbe0a299b70c05bdc865f9de99e0bb Mon Sep 17 00:00:00 2001 From: kovan Date: Sat, 14 Feb 2026 00:31:17 +0100 Subject: [PATCH] fix(ocaml): don't prefix comment continuation lines with * tuareg sets comment-continue to " * ", causing comment-indent-new-line to insert ** on new lines inside comments. OCaml convention is to not prefix continuation lines with *. Set comment-continue to nil instead. The custom +ocaml/comment-indent-new-line wrapper is no longer needed. Fix: #5194 Co-authored-by: Claude Opus 4.6 --- modules/lang/ocaml/autoload.el | 10 ---------- modules/lang/ocaml/config.el | 2 +- 2 files changed, 1 insertion(+), 11 deletions(-) diff --git a/modules/lang/ocaml/autoload.el b/modules/lang/ocaml/autoload.el index 58de22d9c..04ab45209 100644 --- a/modules/lang/ocaml/autoload.el +++ b/modules/lang/ocaml/autoload.el @@ -1,11 +1 @@ ;;; lang/ocaml/autoload.el -*- lexical-binding: t; -*- - -;;;###autoload -(defun +ocaml/comment-indent-new-line (&optional _) - "Break line at point and indent, continuing comment if within one." - (interactive) - (comment-indent-new-line) - (when (eq (char-before) ?*) - (just-one-space)) - (unless (eq (char-after) 32) - (save-excursion (insert " ")))) diff --git a/modules/lang/ocaml/config.el b/modules/lang/ocaml/config.el index a270252f0..f451e8232 100644 --- a/modules/lang/ocaml/config.el +++ b/modules/lang/ocaml/config.el @@ -28,7 +28,7 @@ (setq tuareg-prettify-symbols-full t) (setq-hook! 'tuareg-mode-hook - comment-line-break-function #'+ocaml/comment-indent-new-line) + comment-continue nil) (map! :localleader :map tuareg-mode-map