From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#55716: 29.0.50; latex-mode overrides my `comment-style` choice Date: Sun, 29 May 2022 17:57:46 -0400 Message-ID: Reply-To: Stefan Monnier Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="25515"; mail-complaints-to="usenet@ciao.gmane.io" To: 55716@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun May 29 23:59:59 2022 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nvQx5-0006ST-Cn for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 29 May 2022 23:59:59 +0200 Original-Received: from localhost ([::1]:41750 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nvQx4-0008HM-6z for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 29 May 2022 17:59:58 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:52778) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nvQwA-0008FK-22 for bug-gnu-emacs@gnu.org; Sun, 29 May 2022 17:59:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:48223) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nvQw9-0003Fz-NL for bug-gnu-emacs@gnu.org; Sun, 29 May 2022 17:59:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nvQw9-0001Pu-Lz for bug-gnu-emacs@gnu.org; Sun, 29 May 2022 17:59:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 29 May 2022 21:59:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 55716 X-GNU-PR-Package: emacs X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.16538614835333 (code B ref -1); Sun, 29 May 2022 21:59:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 29 May 2022 21:58:03 +0000 Original-Received: from localhost ([127.0.0.1]:42116 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nvQvD-0001Nx-4y for submit@debbugs.gnu.org; Sun, 29 May 2022 17:58:03 -0400 Original-Received: from lists.gnu.org ([209.51.188.17]:49218) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nvQvC-0001Nq-1q for submit@debbugs.gnu.org; Sun, 29 May 2022 17:58:02 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:52638) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nvQvB-0008BB-Q1 for bug-gnu-emacs@gnu.org; Sun, 29 May 2022 17:58:01 -0400 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:39058) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nvQv7-0003C6-Qo for bug-gnu-emacs@gnu.org; Sun, 29 May 2022 17:57:59 -0400 Original-Received: from pmg2.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 88480803E6 for ; Sun, 29 May 2022 17:57:56 -0400 (EDT) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 3D90380762 for ; Sun, 29 May 2022 17:57:55 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1653861475; bh=1ie5tPinU2bAC6R43RSvQxIPnsDA3vEuPt9+ZsbZWr4=; h=From:To:Subject:Date:From; b=gikjYZ4mxjND6nPrfWFbRROgncK6FFVg4P0ajR6RjUVj8aCguJUwEBMi1TBYaHXC+ X3Gt0N6iPpWF1fU/3x4cKE0+b9wZEx8ZtC4sCSqKWr5l76voY7txc+7LCbzAnJK33k uv2I721SveDwgZWbX0y3gKKX4QxGOkIqpT7WKNneUxsG6CJ74T4FZ0J498ZPD73SaF 97N0mbClufMddVAHH+rLoxSfvRcFGzmOBfkm9sUWeMgjaBS7NWPPfx2l3YWJNIjwSH UdVl4/Q249m4ci7wo/wW1mDQ+WCV1uMNEcjB0c41wgqkxoiICxxH7uNHqUX435+Ek9 avSZVNlKqvxPw== Original-Received: from pastel (unknown [45.72.221.51]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 1B652120189 for ; Sun, 29 May 2022 17:57:55 -0400 (EDT) Received-SPF: pass client-ip=132.204.25.50; envelope-from=monnier@iro.umontreal.ca; helo=mailscanner.iro.umontreal.ca X-Spam_score_int: -42 X-Spam_score: -4.3 X-Spam_bar: ---- X-Spam_report: (-4.3 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:233349 Archived-At: 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 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