Subject: bug#55716: 29.0.50; latex-mode overrides my `comment-style` choice

From: Stefan Monnier <[email-masked]>
Date: Sun, 29 May 2022 17:57:46 -0400

Package: Emacs
Version: 29.0.50

latex-mode started to impose the old `plain` comment-style a few months
ago, which I find rather annoying and not very user-friendly.
At first, I thought it was a bug somewhere in my config, but I now see
that it comes from:

    commit 0870ebb3cbfcb097d85eea5eacaf992dd88ed204
    Author: Lars Ingebrigtsen <[email-masked]>
    Date:   Thu Jan 28 07:09:18 2021 +0100
    
        Allow commenting out white space lines in latex-mode
        
        * lisp/newcomment.el (comment-region-default-1): Allow commenting
        out whitespace-only regions (bug#41793).
        
        * lisp/textmodes/tex-mode.el (latex--comment-region): Use it.
        (latex-mode): Set a comment style shim.

    diff --git a/lisp/textmodes/tex-mode.el b/lisp/textmodes/tex-mode.el
    index c4e4864da17..ce665e61656 100644
    --- a/lisp/textmodes/tex-mode.el
    +++ b/lisp/textmodes/tex-mode.el
    @@ -1169,7 +1169,12 @@ latex-mode
       (setq-local outline-regexp latex-outline-regexp)
       (setq-local outline-level #'latex-outline-level)
       (setq-local forward-sexp-function #'latex-forward-sexp)
    -  (setq-local skeleton-end-hook nil))
    +  (setq-local skeleton-end-hook nil)
    +  (setq-local comment-region-function #'latex--comment-region)
    +  (setq-local comment-style 'plain))
    +
    +(defun latex--comment-region (beg end &optional arg)
    +  (comment-region-default-1 beg end arg t))
     
     ;;;###autoload
     (define-derived-mode slitex-mode latex-mode "SliTeX"

The commit message doesn't explain why it changes `comment-style`.
Was that an oversight?

        Stefan