aboutsummaryrefslogtreecommitdiff
path: root/tw/home/files/emacs-packages/bemscript-mode.el
diff options
context:
space:
mode:
authorTimo Wilken2024-03-09 14:52:56 +0100
committerTimo Wilken2024-03-10 16:19:00 +0100
commitde20fc8d904643ffe6957febfc6a24e57c12b512 (patch)
tree8177459e40786bd432a37c5833f26350fb689356 /tw/home/files/emacs-packages/bemscript-mode.el
parentda5e9d5ee98dfc216eb7e3b1559c09f4bf868bf6 (diff)
Separate home service into PIM, dev env and graphical parts
This means we only instantiate Shepherd and mcron services if we really need them, to avoid annoyance on servers.
Diffstat (limited to 'tw/home/files/emacs-packages/bemscript-mode.el')
-rw-r--r--tw/home/files/emacs-packages/bemscript-mode.el92
1 files changed, 0 insertions, 92 deletions
diff --git a/tw/home/files/emacs-packages/bemscript-mode.el b/tw/home/files/emacs-packages/bemscript-mode.el
deleted file mode 100644
index f46c858b..00000000
--- a/tw/home/files/emacs-packages/bemscript-mode.el
+++ /dev/null
@@ -1,92 +0,0 @@
-;;; bemscript-mode.el --- Syntax highlighting for MERRILL BEMScript files.
-;;; Commentary:
-;;; Based on the MERRILL manual. Some commands may have been missed.
-;;; Code:
-
-(defconst bemscript-mode-keywords
- '("set" "setsubdomain" "magnetite" "iron" "tm54" "resize" "cubic anisotropy"
- "uniaxial anisotropy" "cubicrotation" "easy axis" "external field strength"
- "external field direction" "readmesh" "loadmesh" "readmagnetization"
- "uniform magnetization" "randomize magnetization" "randomize all moments"
- "remesh" "conjugategradient" "steepestdescent" "minimize" "energylog"
- "closelogfile" "writeloopdata" "writemagnetization" "writedemag" "writehyst"
- "writeboxdata" "appenddemagzone" "magnetizationtopath" "pathtomagnetization"
- "renewpath" "refinepathto" "writetecplotpath" "readtecplotpath"
- "readtecplotzone" "keypause" "makeinitialpath" "pathminimize" "pathlogfile"
- "systemcommand" "pathstructureenergies" "reportenergy" "stop" "end" "loop"
- "endloop" "define" "addto" "undefine" "generatecubemesh" "zonename")
- "List of keywords for BEMScript mode. Intended for case folding.")
-
-(defconst bemscript-mode-builtins
- '("Aex" "CurvatureWeight" "ExchangeCalculator" "K1" "K2" "Ls" "Ms" "mu"
- "MaxEnergyEvaluations" "MaxPathEvaluations" "MaxRestart" "MaxMeshNumber"
- "NEBSpring" "PathN" "Zone" "ZoneIncrement")
- "List of built-in variable names for BEMScript.")
-
-(defconst bemscript-mode-special
- '("patran" "tecplot" "POINT" "BLOCK" "SD" "muT" "mT" "T" "C")
- "Variables with special meanings and units in BEMScript.")
-
-;; Available font-lock-*-faces: doc type string builtin comment keyword warning
-;; constant (reference) preprocessor syntactic-function function-name
-;; negation-char variable-name comment-delimiter
-(defconst bemscript-mode-font-lock-defaults
- `((;; See font-lock-keywords docs. Earlier lines seem to override later ones,
- ;; except if both have OVERRIDE? t.
- ;; Format: (REGEXP (GROUPNUM FACENAME OVERRIDE? LAXMATCH?)...)
- ;; Comments
- ("!\\(.*\\)" 1 font-lock-comment-face t t)
- ("!" 0 font-lock-comment-delimiter-face t)
- ("!!.*$" 0 font-lock-doc-face t)
-
- ;; Equals signs need spaces around them.
- ("\\s-=\\s-" 0 font-lock-type-face t) ; there is no "operator" etc face
- ("=" . font-lock-warning-face)
-
- ;; Numbers and variables
- ("\\<[0-9]*\\.?[0-9]+\\(e[-+]?\\)?[0-9]*\\>" . font-lock-constant-face)
- ("\\(\\<[#%][A-Z_a-z][0-9A-Z_a-z]*\\>\\|\\$[A-Z_a-z][0-9A-Za-z_]*\\$\\)"
- . font-lock-variable-name-face)
-
- ;; Preprocessor (&-substitution)
- (,(concat "\\([^&]\\|^\\)\\(&&\\)*" ; && escapes &
- "\\(&\\([_a-zA-Z][_a-zA-Z0-9]*\\|{[_a-zA-Z][_a-zA-Z0-9]*}\\)\\)")
- 3 font-lock-preprocessor-face)
- (,(concat "\\([^&]\\|^\\)\\(&&\\)*" ; && escapes &
- "\\(&\\($" ; bare &
- "\\|[^&{_a-zA-Z]\\|{[^_a-zA-Z]" ; invalid char following & or &{
- ; invalid name or unclosed {
- "\\|{[_a-zA-Z][_0-9a-zA-Z]*\\([^_0-9a-zA-Z}]\\|$\\)\\)\\)")
- 3 font-lock-warning-face t)
-
- ;; Variable definitions
- ("\\<\\(loop\\|define\\)\\s-+\\([_a-zA-Z][_a-zA-Z0-9]*\\)\\>"
- 2 font-lock-function-name-face)
- ("\\<\\(addto\\|undefine\\)\\s-+\\([_a-zA-Z][_a-zA-Z0-9]*\\)\\>"
- 2 font-lock-variable-name-face)
-
- ;; Keywords
- (,(regexp-opt bemscript-mode-special 'words) . font-lock-string-face)
- (,(regexp-opt bemscript-mode-keywords 'words) . font-lock-keyword-face)
- (,(regexp-opt bemscript-mode-builtins 'words) . font-lock-builtin-face))
-
- ;; KEYWORDS-ONLY: if t, no syntactic fontification (strings and comments)
- nil
- ;; CASE-FOLD: if t, make keywords case-insensitive.
- t)
- "Font lock settings for BEMScript mode.")
-
-(define-derived-mode bemscript-mode prog-mode "BEMScript"
- "BEMScript-mode is used for editing MERRILL scripts."
- (setq comment-start "!"
- comment-end ""
- tab-width 2
- font-lock-defaults bemscript-mode-font-lock-defaults)
- ;; Only word syntax entries are highlighted; add needed chars.
- (modify-syntax-entry ?# "w")
- ;; Strings in BEMScript are not quoted.
- (modify-syntax-entry ?\" "w"))
-
-(add-to-list 'auto-mode-alist '("\\.bem\\'" . bemscript-mode))
-(provide 'bemscript-mode)
-;;; bemscript-mode.el ends here