GNU bug report logs -
#55716
29.0.50; latex-mode overrides my `comment-style` choice
Previous Next
Reported by: Stefan Monnier <monnier <at> iro.umontreal.ca>
Date: Sun, 29 May 2022 21:59:01 UTC
Severity: normal
Found in version 29.0.50
Fixed in version 29.1
Done: Lars Ingebrigtsen <larsi <at> gnus.org>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
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 <larsi <at> gnus.org>
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
This bug report was last modified 3 years and 70 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.