mylisp-obsolete/iar4-linker-config-mode.el
author Oleksandr Gavenko <gavenkoa@gmail.com>
Sun, 14 May 2023 16:40:00 +0300
changeset 1771 e60fb6cd150e
parent 1718 9d72f4424570
permissions -rw-r--r--
In Emacs 28 it loads files referenced by diff-mode, polluting buffer list & recentf, and significantly slowing Emacs in Cygwin. https://debbugs.gnu.org/cgi/bugreport.cgi?bug=62749 https://emacs.stackexchange.com/questions/76728/modern-emacs-keeps-opening-related-file-from-vc-diff-buffer/

;;; iar-linker-config-mode.el --- major mode for highlighting IAR Embedded Workbench 4.x linker scripts

;;; Commentary:
;;
;; Very poor highlighting, not all syntax is covered.

;;; Code:

;;;###autoload
(define-generic-mode iar4-linker-config-mode
  '("// " ("/*" . "*/"))
  nil
  '(
    ("^\\(-c\\)\\([_a-zA-Z]+\\)"
     (1 font-lock-keyword-face)
     (2 font-lock-variable-name-face) )
    ("^\\(-D\\)\\([_a-zA-Z0-9]+\\)=\\(\\(0x\\)?[0-9a-fA-F]+\\|.[0-9]+\\)"
     (1 font-lock-keyword-face)
     (2 font-lock-variable-name-face)
     (3 font-lock-constant-face) )
    ("^\\(-Q\\)\\([_a-zA-Z]+\\)=\\([_a-zA-Z]+\\)"
     (1 font-lock-keyword-face)
     (2 font-lock-variable-name-face)
     (3 font-lock-variable-name-face) )
    ("^\\(-Z\\|-P\\|-b\\)(\\([_a-zA-Z]+\\))\\([_a-zA-Z]+\\)="
     (1 font-lock-keyword-face)
     (2 font-lock-variable-name-face)
     (3 font-lock-variable-name-face) )
    ("^\\(-Z\\|-P\\|-b\\)(\\([_a-zA-Z]+\\))\\([_a-zA-Z]+\\)\\+\\([_a-zA-Z]+\\)="
     (1 font-lock-keyword-face)
     (2 font-lock-variable-name-face)
     (3 font-lock-variable-name-face)
     (4 font-lock-variable-name-face) )
    )
  (list "\\.\\(xcl\\)\\'")
  (list
   (lambda () (setq comment-start "// " comment-end ""))
   )
  "Generic mode for iar linker config files.")

(provide 'iar4-linker-config-mode)

;;; iar4-linker-config-mode.el ends here