]> git.eshelyaron.com Git - emacs.git/commitdiff
Add block-comment variables to cc-mode.
authorElías Gabriel Pérez <eg642616@gmail.com>
Sun, 13 Apr 2025 18:26:08 +0000 (12:26 -0600)
committerEshel Yaron <me@eshelyaron.com>
Wed, 16 Apr 2025 07:35:18 +0000 (09:35 +0200)
* lisp/progmodes/cc-cmds.el (c-indent-new-comment-line):
Add block-comment-start and block-comment-end
* lisp/progmodes/cc-mode.el (c-basic-common-init):
Declare block-comment-start and block-comment-end buffer-local.
* lisp/emacs-lisp/lisp-mode.el (lisp-mode-variables): Move
block-comment variables ...
(lisp-mode): ... to here.  (Bug#77424)

(cherry picked from commit 74842b4cb2c164ceed5cbe6ee5ad578ee46fe012)

lisp/emacs-lisp/lisp-mode.el
lisp/progmodes/cc-cmds.el
lisp/progmodes/cc-mode.el

index 41f9f74e711d3db8b74e640f748aeb501d09d451..39425e1c983a0af5be4c0d1c5b4ff706d38369ff 100644 (file)
@@ -695,8 +695,6 @@ font-lock keywords will not be case sensitive."
   (setq-local add-log-current-defun-function #'lisp-current-defun-name)
   (setq-local comment-start ";")
   (setq-local comment-start-skip ";+ *")
-  (setq-local block-comment-start "#|")
-  (setq-local block-comment-end "|#")
   (setq-local comment-add 1)           ;default to `;;' in comment-region
   (setq-local comment-column 40)
   (setq-local comment-use-syntax t)
@@ -1161,6 +1159,8 @@ or to switch back to an existing one."
              "\\(\\(^\\|[^\\\n]\\)\\(\\\\\\\\\\)*\\)\\(;+\\|#|\\) *")
   (setq-local comment-end-skip "[ \t]*\\(\\s>\\||#\\)")
   (setq-local font-lock-comment-end-skip "|#")
+  (setq-local block-comment-start "#|")
+  (setq-local block-comment-end "|#")
   (setq imenu-case-fold-search t))
 
 (defun lisp-find-tag-default ()
index 9230faa56daafec0bc45ee6d620f17ca9f809102..06397d2332195c5a610c10d72ab38316d7d53074 100644 (file)
@@ -5015,6 +5015,7 @@ If a fill prefix is specified, it overrides all the above."
                      (setq comment-start "/* " comment-end " */"))
                  (unless (string-match "[ \t]*//" comment-start)
                    (setq comment-start "// " comment-end "")))
+               (setq block-comment-start "/*" block-comment-end "*/")
                (setq col (save-excursion
                            (back-to-indentation)
                            (current-column)))
index d500fb299594f7e8ce02769c5ab72ba01bbcca31..ae7d27c0ae69c06c390680c59030bba3703725fe 100644 (file)
@@ -610,6 +610,8 @@ that requires a literal mode spec at compile time."
   (make-local-variable 'comment-start)
   (make-local-variable 'comment-end)
   (make-local-variable 'comment-start-skip)
+  (make-local-variable 'block-comment-start)
+  (make-local-variable 'block-comment-end)
 
   (make-local-variable 'paragraph-start)
   (make-local-variable 'paragraph-separate)