This is an old revision of the document!


Highlighting for Emacs

Thanks to Carlos Martin and Basile de Fleurian we can offer additional settings for Emacs (a GNU licenses text editor) for automatic highlighting of Solver Input File Syntax (SIF). Just add the following lines to your .emacs file (should reside in your home-directory):

(require 'generic-x) ;; we need this
(define-generic-mode
  'sif-mode                                                             ;; name of the mode to create
  '("!" "#")                                                            ;; comments start with '!' or "#'
  '("Header" "Constants" "Material" "End" "Boundary Condition"
    "Simulation" "Body" "Body Force" "Initial Condition" "Equation")    ;; some keywords
  '(("=" . 'font-lock-operator)                                         ;; This doesn't do anything!   
    ("Solver [0-9]+" . 'font-lock-keyword-face)                         ;; Highlights Solver sections 
    ("$$" . 'font-lock-builtin)                                         ;; or this!
    ("Real" "Logical" "String" "Integer" . 'font-lock-type-face)        ;; or this
    ("\\(\$[a-zA-Z]+\\)" . 'font-lock-function-name-face))
  '("\\.sif$")                                                          ;; files for which to activate this mode
  "A mode for sif files"                                                ;; doc string for this mode
  )
tips/editors.1445600780.txt.gz · Last modified: 2015/10/23 11:46 by gag
CC Attribution-Share Alike 4.0 International
www.chimeric.de Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0