;; Sjur si fil. ; Make Emacs UTF-8 compatible for both display and editing: (set-terminal-coding-system 'utf-8) (set-keyboard-coding-system 'utf-8) (prefer-coding-system 'utf-8) ; Turn on syntax colouring in all modes supporting it: (global-font-lock-mode t) ; The backspace and del issue ;(global-set-key [delete] 'delete-backward-char) ;(global-set-key [kp-delete] 'delete-backward-char) (global-set-key "\C-?" 'delete-backward-char) (global-set-key "\C-h" 'delete-backward-char) ; Sámi spell checker :-) (setq-default ispell-program-name "aspell") ; Set META to command key - according to http://members.shaw.ca/akochoi-emacs/stories/faq.html ; DOES NOT SEEM TO WORK!!! ;(setq-default mac-command-key-is-meta 1) ;(setq mac-pass-command-to-system nil) ; Enable wheelmouse support by default ;(require 'mwheel) ;Make nxml-mode available to emacs (load "~/emacs/nxml-mode-20041004/rng-auto.el") ; Load nxml-mode automatically for files with the following endings (add-to-list 'auto-mode-alist (cons (concat "\\." (regexp-opt '("xml" "xsd" "sch" "rng" "xslt" "svg" "rss") t) "\\'") 'nxml-mode)) ; Make Emacs UTF-8 compatible for both display and editing: (prefer-coding-system 'utf-8) (set-terminal-coding-system 'utf-8) (set-keyboard-coding-system 'utf-8) ; Turn on syntax colouring in all modes supporting it: (global-font-lock-mode t) ;; Goto line number (global-set-key "\C-xg" 'goto-line) ;; Name mode ; (load "~/gtsvn/gt/script/emacs/namelex") ;; Emacs xae xml mode ;(add-to-list 'load-path (expand-file-name "/Users/trond/emacs/xae-1.0beta8/lisp")) ;(require 'xae) ;; Emacs wikipedia mode (autoload 'wikipedia-mode "wikipedia-mode.el" "Major mode for editing documents in Wikipedia markup." t) (setq auto-mode-alist (cons '("\\.wiki\\'" . wikipedia-mode) auto-mode-alist)) ;; Emacs lkb mode (let ((root (getenv "DELPHINHOME"))) (if (file-exists-p (format "%s/lkb/etc/dot.emacs" root)) (load (format "%s/lkb/etc/dot.emacs" root) nil t t))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Experimenting here ;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; lexc-mode-el -- Major mode for editing LEXC files ; Author: W.P. McNeill ; Created: 7 November 2004 ; Keywords: LEXC major-mode ; This program is free software; you can redistribute it and/or ; modify it under the terms of the GNU General Public License as ; published by the Free Software Foundation; either version 2 of ; the License, or (at your option) any later version. ; This program is distributed in the hope that it will be ; useful, but WITHOUT ANY WARRANTY; without even the implied ; warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR ; PURPOSE. See the GNU General Public License for more details. ; You should have received a copy of the GNU General Public ; License along with this program; if not, write to the Free ; Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, ; MA 02111-1307 USA ; This was based on an emacs mode authoring tutorial located here: ; http://two-wugs.net/emacs/mode-tutorial.html ; Hook for overriding the functions defined in this file (defvar lexc-mode-hook nil) ; Associate .lexc extension with this mode. (add-to-list 'auto-mode-alist '("\\.lexc\\'" . lexc-mode)) (add-to-list 'auto-mode-alist '("\\-lex.txt\\'" . lexc-mode)) (add-to-list 'auto-mode-alist '("\\-morph.txt\\'" . lexc-mode)) ; Keywords for syntax highlighting (defconst lexc-font-lock-keywords (list '("\\<\\(Multichar_Symbols\\)\\>" . font-lock-keyword-face) '("\\<\\(LEXICON\\)\\>" . font-lock-function-name-face)) "Highlighting expressions for LEXC mode.") ; Define syntactic constituents (defvar lexc-mode-syntax-table (let ((lexc-mode-syntax-table (make-syntax-table))) ; The ! character is the comment delimiter (modify-syntax-entry ?! "<" lexc-mode-syntax-table) (modify-syntax-entry ?\n ">" lexc-mode-syntax-table) lexc-mode-syntax-table) "Syntax table for lexc-mode") ; Entry function called by emacs (defun lexc-mode () (interactive) (kill-all-local-variables) ; Define syntactic constituents (set-syntax-table lexc-mode-syntax-table) ; Set up font-lock (set (make-local-variable 'font-lock-defaults) '(lexc-font-lock-keywords)) ; Register our indentation function (setq major-mode 'lexc-mode) (setq mode-name "LEXC") (run-hooks 'lexc-mode-hook)) ; Expose this mode to the emacs environment (provide 'lexc-mode) ; xfst-mode-el -- Major mode for editing XFST files ; Author: W.P. McNeill ; Created: 7 November 2004 ; Keywords: XFST major-mode ; This program is free software; you can redistribute it and/or ; modify it under the terms of the GNU General Public License as ; published by the Free Software Foundation; either version 2 of ; the License, or (at your option) any later version. ; This program is distributed in the hope that it will be ; useful, but WITHOUT ANY WARRANTY; without even the implied ; warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR ; PURPOSE. See the GNU General Public License for more details. ; You should have received a copy of the GNU General Public ; License along with this program; if not, write to the Free ; Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, ; MA 02111-1307 USA ; This was based on an emacs mode authoring tutorial located here: ; http://two-wugs.net/emacs/mode-tutorial.html ; Hook for overriding the functions defined in this file (defvar xfst-mode-hook nil) ; Associate .xfst extension with this mode. (add-to-list 'auto-mode-alist '("\\.xfst\\'" . xfst-mode)) (add-to-list 'auto-mode-alist '("\\.-xfst.txt\\'" . xfst-mode)) ; Keywords for syntax highlighting (defconst xfst-font-lock-keywords (list '("\\<\\(define\\|read\\|save\\|clear\\|regex\\|stack\\)\\>" . font-lock-keyword-face) '() ) "Highlighting expressions for XFST mode.") ; Define syntactic constituents (defvar xfst-mode-syntax-table (let ((xfst-mode-syntax-table (make-syntax-table))) ; The ! character is the comment delimiter (modify-syntax-entry ?! "<" xfst-mode-syntax-table) (modify-syntax-entry ?\n ">" xfst-mode-syntax-table) xfst-mode-syntax-table) "Syntax table for xfst-mode") ; Entry function called by emacs (defun xfst-mode () (interactive) (kill-all-local-variables) ; Define syntactic constituents (set-syntax-table xfst-mode-syntax-table) ; Set up font-lock (set (make-local-variable 'font-lock-defaults) '(xfst-font-lock-keywords)) ; Register our indentation function (setq major-mode 'xfst-mode) (setq mode-name "XFST") (run-hooks 'xfst-mode-hook)) ; Expose this mode to the emacs environment (provide 'xfst-mode) ;;;;;;;;;;;;;;;;;;;; ; Hook for overriding the functions defined in this file (defvar vislcg-mode-hook nil) ; Associate .rle extension with this mode. (add-to-list 'auto-mode-alist '("\\.rle\\'" . vislcg-mode)) ; Keywords for syntax highlighting (defconst vislcg-font-lock-keywords (list '("\\<\\(DELIMITERS\\|SETS\\|MAPPINGS\\|CONSTRAINTS\\|IF\\|BARRIER\\|LINK\\)\\>" . font-lock-keyword-face) '("\\<\\(LIST\\|SET\\|MAP\\|ADD\\|SELECT\\|REMOVE\\)\\>" . font-lock-function-name-face) ) "Highlighting expressions for VISLCG mode.") ; Define syntactic constituents (defvar vislcg-mode-syntax-table (let ((vislcg-mode-syntax-table (make-syntax-table))) ; The # character is the comment delimiter (modify-syntax-entry ?# "<" vislcg-mode-syntax-table) (modify-syntax-entry ?\n ">" vislcg-mode-syntax-table) vislcg-mode-syntax-table) "Syntax table for vislcg-mode") ; Entry function called by emacs (defun vislcg-mode () (interactive) (kill-all-local-variables) ; Define syntactic constituents (set-syntax-table vislcg-mode-syntax-table) ; Set up font-lock (set (make-local-variable 'font-lock-defaults) '(vislcg-font-lock-keywords)) ; Register our indentation function (setq major-mode 'vislcg-mode) (setq mode-name "VISLCG") (run-hooks 'vislcg-mode-hook)) ; Expose this mode to the emacs environment (provide 'vislcg-mode) ;;;;;;;;;;;;;;;;;;;; ; Hook for overriding the functions defined in this file (defvar twol-mode-hook nil) ; Associate .rle extension with this mode. (add-to-list 'auto-mode-alist '("\\.twolc\\'" . twol-mode)) (add-to-list 'auto-mode-alist '("\\.twol\\'" . twol-mode)) (add-to-list 'auto-mode-alist '("\\twol*.txt\\'" . twol-mode)) ; Keywords for syntax highlighting (defconst twol-font-lock-keywords (list '("\\<\\(Alphabet\\|Sets\\|Definitions\\|Rules)\\>" . font-lock-keyword-face) '("\\<\\(in\\|matching\\|KEEPIF\\|ELSE\\|ENDKEEP)\\>" . font-lock-function-name-face) ) "Highlighting expressions for TWOL mode.") ; Define syntactic constituents (defvar twol-mode-syntax-table (let ((twol-mode-syntax-table (make-syntax-table))) ; The ! character is the comment delimiter (modify-syntax-entry ?! "<" twol-mode-syntax-table) (modify-syntax-entry ?\n ">" twol-mode-syntax-table) twol-mode-syntax-table) "Syntax table for twol-mode") ; Entry function called by emacs (defun twol-mode () (interactive) (kill-all-local-variables) ; Define syntactic constituents (set-syntax-table twol-mode-syntax-table) ; Set up font-lock (set (make-local-variable 'font-lock-defaults) '(twol-font-lock-keywords)) ; Register our indentation function (setq major-mode 'twol-mode) (setq mode-name "TWOL") (run-hooks 'twol-mode-hook)) ; Expose this mode to the emacs environment (provide 'twol-mode)