* lisp/emacs-lisp/lisp-mode.el (lisp-mode-variables):
Add block-comment-start and block-comment-end from here...
* lisp/newcomment.el (block-comment-start, block-comment-end):...
* lisp/nxml/nxml-mode.el (nxml-mode):...
* lisp/progmodes/c-ts-common.el (c-ts-common-comment-setup):...
* lisp/progmodes/go-ts-mode.el (go-work-ts-mode):...
* lisp/progmodes/js.el (js--mode-setup):...
* lisp/progmodes/json-ts-mode.el (json-ts-mode):...
* lisp/progmodes/lua-ts-mode.el (lua-ts-mode):...
* lisp/progmodes/opascal.el (opascal-mode):...
* lisp/progmodes/pascal.el (pascal-mode):...
* lisp/progmodes/typescript-ts-mode.el (tsx-ts-mode):...
* lisp/textmodes/css-mode.el (css-base-mode, scss-mode):...
* lisp/textmodes/sgml-mode.el (sgml-mode): ... to here.
(Bug#77424)
(cherry picked from commit
4c6b1712a4d67ae40ccc087c7946de4cb14e8cc7)
(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)
;; - spill auto-fill of comments onto the end of the next line.
;; - uncomment-region with a consp (for blocks) or somehow make the
;; deletion of continuation markers less dangerous.
-;; - drop block-comment-<foo> unless it's really used.
;; - uncomment-region on a subpart of a comment.
;; - support gnu-style "multi-line with space in continue".
;; - somehow allow comment-dwim to use the region even if transient-mark-mode
Applicable at least in modes for languages like fixed-format Fortran where
comments always start in column zero.")
-;; ?? never set
-(defvar block-comment-start nil)
-(defvar block-comment-end nil)
+(defvar block-comment-start nil
+ "String to insert to start a new block comment, or nil if no supported.")
+
+(defvar block-comment-end nil
+ "String to insert to end a new block comment, or nil if no supported.")
(defvar comment-quote-nested t
"Non-nil if nested comments should be quoted.
(setq-local comment-start-skip "<!--[ \t\r\n]*")
(setq-local comment-end "-->")
(setq-local comment-end-skip "[ \t\r\n]*-->")
+ (setq-local block-comment-start "<!--")
+ (setq-local block-comment-end "-->")
(setq-local comment-line-break-function #'nxml-newline-and-indent)
(setq-local comment-quote-nested-function #'nxml-comment-quote-nested)
(setq-local comment-continue "") ; avoid double-hyphens as a padding
- `comment-end'
- `comment-start-skip'
- `comment-end-skip'
+ - `block-comment-start'
+ - `block-comment-end'
- `adaptive-fill-mode'
- `adaptive-fill-first-line-regexp'
- `paragraph-start'
(rx (* (syntax whitespace))
(group (or (syntax comment-end)
(seq (+ "*") "/")))))
+ (setq-local block-comment-start "/*")
+ (setq-local block-comment-end "*/")
(setq-local adaptive-fill-mode t)
(setq-local adaptive-fill-function #'c-ts-common--adaptive-fill-prefix)
;; Always accept * or | as prefix, even if there's only one line in
(setq-local comment-start "// ")
(setq-local comment-end "")
(setq-local comment-start-skip (rx "//" (* (syntax whitespace))))
+ (setq-local block-comment-start "/*")
+ (setq-local block-comment-end "*/")
;; Indent.
(setq-local indent-tabs-mode t
(setq-local comment-start "// ")
(setq-local comment-start-skip "\\(?://+\\|/\\*+\\)\\s *")
(setq-local comment-end "")
+ (setq-local block-comment-start "/*")
+ (setq-local block-comment-end "*/")
(setq-local fill-paragraph-function #'js-fill-paragraph)
(setq-local normal-auto-fill-function #'js-do-auto-fill)
(setq-local comment-start "// ")
(setq-local comment-start-skip "\\(?://+\\|/\\*+\\)\\s *")
(setq-local comment-end "")
+ (setq-local block-comment-start "/*")
+ (setq-local block-comment-end "*/")
;; Electric
(setq-local electric-indent-chars
(setq-local comment-start "--")
(setq-local comment-start-skip "--\\s-*")
(setq-local comment-end "")
+ (setq-local block-comment-start "--[[" )
+ (setq-local block-comment-end "]]"))
;; Font-lock.
(setq-local treesit-font-lock-settings lua-ts--font-lock-settings)
(setq-local comment-start "// ")
(setq-local comment-start-skip "\\(?://\\|(\\*\\|{\\)[ \t]*")
- (setq-local comment-end-skip "[ \t]*\\(?:\n\\|\\*)\\|}\\)"))
+ (setq-local comment-end-skip "[ \t]*\\(?:\n\\|\\*)\\|}\\)")
+ (setq-local block-comment-start "(*")
+ (setq-local block-comment-end "*)"))
(provide 'opascal)
;;; opascal.el ends here
(setq-local comment-start "{")
(setq-local comment-start-skip "(\\*+ *\\|{ *")
(setq-local comment-end "}")
+ (setq-local block-comment-start "(*")
+ (setq-local block-comment-end "*)")
(add-hook 'completion-at-point-functions 'pascal-completions-at-point nil t)
;; Font lock support
(setq-local font-lock-defaults '(pascal-font-lock-keywords nil t))
;; Comments.
(setq-local comment-start "// ")
(setq-local comment-end "")
+ (setq-local block-comment-start "/*")
+ (setq-local block-comment-end "*/")
(setq-local comment-start-skip (rx (or (seq "/" (+ "/"))
(seq "/" (+ "*")))
(* (syntax whitespace))))
(setq-local comment-start-skip "/\\*+[ \t]*")
(setq-local comment-end "*/")
(setq-local comment-end-skip "[ \t]*\\*+/")
+ (setq-local block-comment-start "/*")
+ (setq-local block-comment-end "*/")
(setq-local electric-indent-chars
(append css-electric-keys electric-indent-chars))
;; The default "." creates ambiguity with class selectors.
"Major mode to edit \"Sassy CSS\" files."
(setq-local comment-start "// ")
(setq-local comment-end "")
+ (setq-local block-comment-start "/*")
+ (setq-local block-comment-end "*/")
(setq-local comment-continue " *")
(setq-local comment-start-skip "/[*/]+[ \t]*")
(setq-local comment-end-skip "[ \t]*\\(?:\n\\|\\*+/\\)")
(setq-local indent-line-function #'sgml-indent-line)
(setq-local comment-start "<!-- ")
(setq-local comment-end " -->")
+ (setq-local block-comment-start "<!--")
+ (setq-local block-comment-end "-->")
(setq-local comment-indent-function #'sgml-comment-indent)
(setq-local comment-line-break-function #'sgml-comment-indent-new-line)
(setq-local skeleton-further-elements '((completion-ignore-case t)))