diff options
| author | Elías Gabriel Pérez | 2025-04-13 12:26:08 -0600 |
|---|---|---|
| committer | Eli Zaretskii | 2025-04-15 16:16:34 +0300 |
| commit | 74842b4cb2c164ceed5cbe6ee5ad578ee46fe012 (patch) | |
| tree | 7322e004bffdd61aa6d24c12d31e22ac855a1aa8 | |
| parent | 788c9cfb62c7fd50b171a9209dd7453bd03f14bf (diff) | |
| download | emacs-74842b4cb2c164ceed5cbe6ee5ad578ee46fe012.tar.gz emacs-74842b4cb2c164ceed5cbe6ee5ad578ee46fe012.zip | |
Add block-comment variables to cc-mode.
* 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)
| -rw-r--r-- | lisp/emacs-lisp/lisp-mode.el | 4 | ||||
| -rw-r--r-- | lisp/progmodes/cc-cmds.el | 1 | ||||
| -rw-r--r-- | lisp/progmodes/cc-mode.el | 2 |
3 files changed, 5 insertions, 2 deletions
diff --git a/lisp/emacs-lisp/lisp-mode.el b/lisp/emacs-lisp/lisp-mode.el index ce79393fb90..f27baae1b36 100644 --- a/lisp/emacs-lisp/lisp-mode.el +++ b/lisp/emacs-lisp/lisp-mode.el | |||
| @@ -701,8 +701,6 @@ font-lock keywords will not be case sensitive." | |||
| 701 | (setq-local add-log-current-defun-function #'lisp-current-defun-name) | 701 | (setq-local add-log-current-defun-function #'lisp-current-defun-name) |
| 702 | (setq-local comment-start ";") | 702 | (setq-local comment-start ";") |
| 703 | (setq-local comment-start-skip ";+ *") | 703 | (setq-local comment-start-skip ";+ *") |
| 704 | (setq-local block-comment-start "#|") | ||
| 705 | (setq-local block-comment-end "|#") | ||
| 706 | (setq-local comment-add 1) ;default to `;;' in comment-region | 704 | (setq-local comment-add 1) ;default to `;;' in comment-region |
| 707 | (setq-local comment-column 40) | 705 | (setq-local comment-column 40) |
| 708 | (setq-local comment-use-syntax t) | 706 | (setq-local comment-use-syntax t) |
| @@ -830,6 +828,8 @@ or to switch back to an existing one." | |||
| 830 | "\\(\\(^\\|[^\\\n]\\)\\(\\\\\\\\\\)*\\)\\(;+\\|#|\\) *") | 828 | "\\(\\(^\\|[^\\\n]\\)\\(\\\\\\\\\\)*\\)\\(;+\\|#|\\) *") |
| 831 | (setq-local comment-end-skip "[ \t]*\\(\\s>\\||#\\)") | 829 | (setq-local comment-end-skip "[ \t]*\\(\\s>\\||#\\)") |
| 832 | (setq-local font-lock-comment-end-skip "|#") | 830 | (setq-local font-lock-comment-end-skip "|#") |
| 831 | (setq-local block-comment-start "#|") | ||
| 832 | (setq-local block-comment-end "|#") | ||
| 833 | (setq imenu-case-fold-search t)) | 833 | (setq imenu-case-fold-search t)) |
| 834 | 834 | ||
| 835 | (defun lisp-find-tag-default () | 835 | (defun lisp-find-tag-default () |
diff --git a/lisp/progmodes/cc-cmds.el b/lisp/progmodes/cc-cmds.el index 9230faa56da..06397d23321 100644 --- a/lisp/progmodes/cc-cmds.el +++ b/lisp/progmodes/cc-cmds.el | |||
| @@ -5015,6 +5015,7 @@ If a fill prefix is specified, it overrides all the above." | |||
| 5015 | (setq comment-start "/* " comment-end " */")) | 5015 | (setq comment-start "/* " comment-end " */")) |
| 5016 | (unless (string-match "[ \t]*//" comment-start) | 5016 | (unless (string-match "[ \t]*//" comment-start) |
| 5017 | (setq comment-start "// " comment-end ""))) | 5017 | (setq comment-start "// " comment-end ""))) |
| 5018 | (setq block-comment-start "/*" block-comment-end "*/") | ||
| 5018 | (setq col (save-excursion | 5019 | (setq col (save-excursion |
| 5019 | (back-to-indentation) | 5020 | (back-to-indentation) |
| 5020 | (current-column))) | 5021 | (current-column))) |
diff --git a/lisp/progmodes/cc-mode.el b/lisp/progmodes/cc-mode.el index efeb6c1005a..fa3788ba383 100644 --- a/lisp/progmodes/cc-mode.el +++ b/lisp/progmodes/cc-mode.el | |||
| @@ -610,6 +610,8 @@ that requires a literal mode spec at compile time." | |||
| 610 | (make-local-variable 'comment-start) | 610 | (make-local-variable 'comment-start) |
| 611 | (make-local-variable 'comment-end) | 611 | (make-local-variable 'comment-end) |
| 612 | (make-local-variable 'comment-start-skip) | 612 | (make-local-variable 'comment-start-skip) |
| 613 | (make-local-variable 'block-comment-start) | ||
| 614 | (make-local-variable 'block-comment-end) | ||
| 613 | 615 | ||
| 614 | (make-local-variable 'paragraph-start) | 616 | (make-local-variable 'paragraph-start) |
| 615 | (make-local-variable 'paragraph-separate) | 617 | (make-local-variable 'paragraph-separate) |