11; ;; sysml-mode.el --- Major mode for SysML v2 (Systems Modeling Language) -*- lexical-binding : t ; -*-
22
3+ ; ; Copyright (C) 2026 DeciSym, LLC
4+ ; ; SPDX-License-Identifier: ISC
5+ ; ;
36; ; Author: Donald Anthony Pellegrino Jr., Ph.D. <don@decisym.ai>
47; ; Assisted-by: GPT:gpt-5-5
58; ; Keywords: languages, modeling, systems engineering
@@ -516,7 +519,7 @@ Prompts to save the buffer if it has unsaved changes."
516519 " Validate SysML file on save if enabled."
517520 (when (and sysml-validate-on-save
518521 buffer-file-name
519- (eq major -mode 'sysml-mode ))
522+ (derived -mode-p 'sysml-mode ))
520523 (sysml-validate-buffer)))
521524
522525; ; Project-wide symbol search
@@ -637,10 +640,6 @@ Shows packages, parts, attributes, and other definition types."
637640
638641; ; Completion support
639642
640- (defvar sysml-all-keywords nil
641- " List of all SysML keywords for completion.
642- This is populated when the mode is loaded." )
643-
644643(defun sysml-build-keyword-list ()
645644 " Build the complete list of SysML keywords for completion."
646645 (append
@@ -666,8 +665,8 @@ This is populated when the mode is loaded.")
666665 " member" " multiplicity" " ordered" " nonunique" " sequence"
667666 " alias" " occurrence" " meta" " true" " false" )))
668667
669- ; ; Initialize the keyword list
670- ( setq sysml- all- keywords (sysml-build-keyword-list) )
668+ ( defconst sysml-all-keywords (sysml-build- keyword- list)
669+ " List of all SysML keywords for completion. " )
671670
672671(defun sysml-collect-buffer-symbols ()
673672 " Collect all defined symbols in the current buffer for completion."
@@ -1156,27 +1155,27 @@ on-the-fly checking.
11561155 (setq-local adaptive-fill-first-line-regexp adaptive-fill-regexp)
11571156
11581157 ; ; Use our fill-paragraph function that only acts in comments
1159- (setq-local fill-paragraph-function 'sysml-fill-paragraph )
1158+ (setq-local fill-paragraph-function # 'sysml-fill-paragraph )
11601159
11611160 ; ; Indentation
1162- (setq-local indent-line-function 'sysml-indent-line )
1161+ (setq-local indent-line-function # 'sysml-indent-line )
11631162 (setq-local tab-width 4 )
11641163
11651164 ; ; ElDoc support for inline documentation
1166- (setq-local eldoc-documentation-function 'sysml-eldoc-function )
1165+ (setq-local eldoc-documentation-function # 'sysml-eldoc-function )
11671166 (eldoc-mode 1 )
11681167
11691168 ; ; Completion support
11701169 (setq-local completion-at-point-functions
1171- (cons 'sysml-completion-at-point
1170+ (cons # 'sysml-completion-at-point
11721171 completion-at-point-functions))
11731172
11741173 ; ; Imenu support for code navigation
11751174 (setq-local imenu-generic-expression sysml-imenu-generic-expression)
11761175 (setq-local imenu-case-fold-search nil ) ; Case-sensitive for SysML
11771176
11781177 ; ; Which-function support (shows current definition in mode line)
1179- (setq-local which-func-functions '( sysml-which-function))
1178+ (setq-local which-func-functions ( list # ' sysml-which-function ))
11801179
11811180 ; ; Electric pairs - automatically insert matching delimiters
11821181 (setq-local electric-pair-pairs sysml-mode-electric-pairs)
@@ -1186,24 +1185,24 @@ on-the-fly checking.
11861185 ; ; Code folding with hideshow - prepare configuration but delay loading
11871186 (setq-local hs-block-start-regexp " {" )
11881187 (setq-local hs-block-end-regexp " }" )
1189- (setq-local hs-forward-sexp-func 'forward-sexp )
1188+ (setq-local hs-forward-sexp-func # 'forward-sexp )
11901189 (setq-local hs-special-modes-alist
11911190 `((sysml-mode
11921191 " {" ; block start
11931192 " }" ; block end
11941193 " /[*/]" ; comment start
1195- forward-sexp
1194+ ,# ' forward-sexp
11961195 nil ))) ; no adjust-block-beginning function
11971196
11981197 ; ; Schedule lazy initialization for heavy features
11991198 (run-with-idle-timer 0.1 nil #'sysml-mode-lazy-init (current-buffer ))
12001199
12011200 ; ; Spell checking configuration for flyspell-prog-mode. Batch spell
12021201 ; ; checking is provided by sysml-spell-check-buffer.
1203- (setq-local flyspell-generic-check-word-predicate 'sysml-flyspell-verify )
1202+ (setq-local flyspell-generic-check-word-predicate # 'sysml-flyspell-verify )
12041203
12051204 ; ; Validation on save
1206- (add-hook 'after-save-hook 'sysml-validate-on-save nil t ))
1205+ (add-hook 'after-save-hook # 'sysml-validate-on-save nil t ))
12071206
12081207; ; Auto-load for .sysml files
12091208;;;### autoload
0 commit comments