summaryrefslogtreecommitdiffstats
path: root/emacs
diff options
context:
space:
mode:
Diffstat (limited to 'emacs')
-rw-r--r--emacs/.emacs.d/drobillized-theme.el49
-rw-r--r--emacs/.emacs.d/init.el363
-rw-r--r--emacs/.emacs.d/site-lisp/clang-format.el222
-rw-r--r--emacs/.emacs.d/site-lisp/glsl-mode.el451
-rw-r--r--emacs/.emacs.d/site-lisp/n3-mode.el44
-rw-r--r--emacs/.emacs.d/site-lisp/ppindent.el138
-rw-r--r--emacs/.emacs.d/site-lisp/ttl-mode.el209
m---------emacs/.emacs.d/site-lisp/turtle-mode0
8 files changed, 938 insertions, 538 deletions
diff --git a/emacs/.emacs.d/drobillized-theme.el b/emacs/.emacs.d/drobillized-theme.el
index 3fda628..b1ce414 100644
--- a/emacs/.emacs.d/drobillized-theme.el
+++ b/emacs/.emacs.d/drobillized-theme.el
@@ -56,22 +56,23 @@ Reload the theme after changing anything in this group."
(custom-theme-set-faces
'drobillized
+ `(Man-overstrike ((t (:inherit bold :foreground ,green))))
+ `(Man-underline ((t (:foreground ,yellow))))
`(bold ((t (:weight bold))))
`(compilation-column-number ((t (:foreground "grey40"))))
`(cursor ((t (:background "grey80"))))
- `(custom-button ((t (:background "#2D3232" :foreground "#DDD" :box (:line-width 2 :style released-button)))))
+ `(custom-button ((t (:background "#2D3232" :foreground "#CCC" :box (:line-width 2 :style released-button)))))
`(custom-state ((t (:foreground ,green))))
- `(default ((t (:inherit nil :stipple nil :background "#141414" :foreground "#C3D1D1" :inverse-video nil :box nil :strike-through nil :overline nil :underline nil :slant normal :weight normal :height 90 :width normal :foundry "unknown" :family "DejaVu Sans Mono"))))
+ `(default ((t (:inherit nil :stipple nil :background "#141414" :foreground "#EEE" :inverse-video nil :box nil :strike-through nil :overline nil :underline nil :slant normal :weight normal :height 90 :width normal :foundry "unknown" :family "DejaVu Sans Mono"))))
`(diff-added ((t (:foreground ,green))))
`(diff-file-header ((((class color) (min-colors 88) (background dark)) (:weight bold))))
`(diff-header ((((class color) (min-colors 88) (background dark)) (:foreground ,violet))))
`(diff-hl-change ((t (:background "#263059" :foreground ,violet))))
`(diff-hl-delete ((t (:inherit diff-removed :background "#660713" :foreground ,red))))
`(diff-hl-insert ((t (:inherit diff-added :background "#314000" :foreground ,green))))
- `(diff-refine-added ((t (:inherit diff-refine-change :foreground ,green))))
- `(diff-refine-change ((t (:background "grey10"))) t)
- `(diff-refine-changed ((t (:background "grey10"))))
- `(diff-refine-removed ((t (:inherit diff-refine-change :foreground ,red))))
+ `(diff-refine-added ((t (:inherit diff-refine-changed :foreground ,green))))
+ `(diff-refine-changed ((t (:background "grey15"))))
+ `(diff-refine-removed ((t (:inherit diff-refine-changed :foreground ,red))))
`(diff-removed ((t (:foreground ,red-d))))
`(dired-directory ((t (:foreground ,blue))))
`(diredp-compressed-file-suffix ((t (:foreground "grey50"))))
@@ -104,21 +105,21 @@ Reload the theme after changing anything in this group."
`(font-latex-math-face ((t (:foreground ,red))))
`(font-latex-sectioning-5-face ((t (:inherit nil :foreground ,yellow :weight bold))))
`(font-latex-sedate-face ((t (:foreground ,cyan-d))))
- `(font-latex-string-face ((t (:foreground ,orange))))
+ `(font-latex-string-face ((t (:foreground ,base1))))
`(font-latex-warning-face ((t (:inherit bold :foreground ,red))))
`(font-lock-builtin-face ((t (:foreground ,green))))
`(font-lock-comment-delimiter-face ((t (:inherit font-lock-comment-face))))
`(font-lock-comment-face ((t (:foreground ,violet :slant normal))))
`(font-lock-constant-face ((t (:foreground ,base1))))
`(font-lock-doc-face ((t (:inherit font-lock-string-face :foreground ,violet))))
- `(font-lock-function-name-face ((t (:inherit default :foreground "#C3D1D1"))))
- `(font-lock-keyword-face ((t (:foreground ,base00 :weight bold))))
- `(font-lock-preprocessor-face ((nil (:foreground ,magenta))))
- `(font-lock-string-face ((t (:foreground ,orange))))
+ `(font-lock-function-name-face ((t (:inherit default))))
+ `(font-lock-keyword-face ((t (:foreground ,base1))))
+ `(font-lock-preprocessor-face ((nil (:foreground ,base00))))
+ `(font-lock-string-face ((t (:foreground ,magenta))))
`(font-lock-type-face ((t (:foreground ,green :weight normal))))
- `(font-lock-variable-name-face ((t (:foreground "#E3F1F1" :weight normal))))
+ `(font-lock-variable-name-face ((t (:inherit default))))
`(font-lock-warning-face ((t (:foreground ,red))))
- `(fringe ((((class color) (background dark)) (:background "grey15"))))
+ `(fringe ((t (:background "#202020" :foreground "#444"))))
`(git-gutter:added ((t (:inherit diff-added))))
`(git-gutter:deleted ((t (:inherit diff-removed))))
`(git-gutter:modified ((t (:foreground ,magenta))))
@@ -201,17 +202,15 @@ Reload the theme after changing anything in this group."
`(magit-tag ((t (:foreground ,yellow))))
`(magit-section-highlight ((t (:background "grey15"))))
`(minibuffer-prompt ((((background dark)) (:foreground "white"))))
- `(mode-line ((t (:background "#2D3232" :foreground "#AFB3B2" :box nil))))
+ `(mode-line ((t (:background "#282828" :foreground "#AAA"))))
`(mode-line-buffer-id ((t (:weight bold))))
`(mode-line-buffer-id-inactive ((t (:inherit mode-line-buffer-id :foreground "gray30"))))
- `(mode-line-inactive ((t (:inherit mode-line :background "#222727" :foreground "gray30"))))
+ `(mode-line-inactive ((t (:inherit mode-line :background "#181818" :foreground "#666"))))
`(nobreak-space ((((class color) (min-colors 88)) (:inherit escape-glyph :underline t))))
- `(powerline-active0 ((t (:inherit mode-line :background "#151A1C"))))
- `(powerline-active1 ((t (:inherit mode-line :background "#1B2022"))))
- `(powerline-active2 ((t (:inherit mode-line :background "#141414"))))
- `(powerline-inactive0 ((t (:inherit mode-line-inactive :background "#03080A"))))
- `(powerline-inactive1 ((t (:inherit mode-line-inactive :background "#0B1012"))))
- `(powerline-inactive2 ((t (:inherit mode-line-inactive :background "#141414"))))
+ `(powerline-active1 ((t (:inherit mode-line :background "#202020"))))
+ `(powerline-active2 ((t (:inherit mode-line :background "#181818"))))
+ `(powerline-inactive1 ((t (:inherit mode-line-inactive :background "#101010"))))
+ `(powerline-inactive2 ((t (:inherit mode-line-inactive :background "#181818"))))
`(rainbow-delimiters-depth-1-face ((t (:inherit rainbow-delimiters-base-face :foreground "#93A1A1"))))
`(rainbow-delimiters-depth-2-face ((t (:inherit rainbow-delimiters-base-face :foreground "#8BA898"))))
`(rainbow-delimiters-depth-3-face ((t (:inherit rainbow-delimiters-base-face :foreground "#8391A1"))))
@@ -223,8 +222,7 @@ Reload the theme after changing anything in this group."
`(rainbow-delimiters-depth-9-face ((t (:inherit rainbow-delimiters-base-face :foreground "#536171"))))
`(region ((t (:background "#152900"))))
`(secondary-selection ((t (:background "#344E00"))))
- `(smerge-refined-change ((t (:background "grey10"))) t)
- `(smerge-refined-changed ((t (:background "grey10"))))
+ `(smerge-refined-changed ((t (:background "grey20"))))
`(smerge-refined-removed ((t (:inherit smerge-refined-change :foreground ,red))))
`(smerge-base ((t (:foreground ,green))) t)
`(smerge-lower ((t (:foreground ,orange))) t)
@@ -243,6 +241,9 @@ Reload the theme after changing anything in this group."
`(widget-field ((t (:background "#222" :box (:line-width 2 :color "#555")))))
`(woman-addition ((t (:inherit font-lock-builtin-face :foreground ,blue))))
`(woman-bold ((t (:inherit bold :foreground ,green))))
- `(woman-italic ((t (:inherit italic :slant italic)))))
+ `(woman-italic ((t (:inherit italic :slant italic))))
+ `(window-divider ((t (:foreground "#151A1C"))))
+ `(window-divider-first-pixel ((t (:foreground "#444"))))
+ `(window-divider-last-pixel ((t (:foreground "#444")))))
(provide-theme 'drobillized)
diff --git a/emacs/.emacs.d/init.el b/emacs/.emacs.d/init.el
index 1e64e8b..3a9b01b 100644
--- a/emacs/.emacs.d/init.el
+++ b/emacs/.emacs.d/init.el
@@ -15,7 +15,7 @@
(scroll-bar-mode (quote right))))
(setq-default
- gc-cons-threshold 10000000
+ gc-cons-threshold 100000000
backup-by-copying t
backup-directory-alist `((".*" . ,temporary-file-directory))
auto-save-file-name-transforms `((".*" ,temporary-file-directory t))
@@ -23,41 +23,120 @@
browse-url-generic-program (executable-find "sensible-browser")
browse-url-browser-function 'browse-url-generic)
+(add-hook 'dired-mode-hook (lambda () (dired-hide-details-mode)))
+
+;;; Code formatting
+
+(require 'clang-format)
+
+(defun get-clang-format-option (config-str field is-num)
+ "Retrieve a config option from a clang-format config."
+ (cond (is-num
+ (let ((primary-match (s-match (concat "^" field ":[ \t]*[0-9]+") config-str)))
+ (if primary-match
+ (string-to-number (car (s-match "[0-9]+" (car primary-match))))
+ 0)))
+ (t
+ (let ((primary-match (s-match (concat "^" field ":[ \t]*[A-Za-z]+") config-str)))
+ (if primary-match
+ (car (s-match "[A-Za-z]+$" (car primary-match)))
+ "")))))
+
+(defun clang-format-c-mode-hook ()
+ "Load C family configuration from clang-format configuration."
+ (let* ((clang-format-config
+ (shell-command-to-string "clang-format -dump-config"))
+ (c-offset (get-clang-format-option clang-format-config "IndentWidth" t))
+ (tabs-str (get-clang-format-option clang-format-config "UseTab" nil))
+ (base-style
+ (get-clang-format-option clang-format-config "BasedOnStyle" nil)))
+ (progn
+ (if (> c-offset 0)
+ (setq-local c-basic-offset c-offset)
+ (if (not (equal "" base-style))
+ (cond ((or (equal "LLVM" base-style)
+ (equal "Google" base-style)
+ (equal "Chromium" base-style)
+ (equal "Mozilla" base-style))
+ (setq-local c-basic-offset 2))
+ ((equal "WebKit" base-style)
+ (setq-local c-basic-offset 4)))))
+ (if (not (equal "" tabs-str))
+ (if (not (string-equal "Never" tabs-str))
+ (setq-local indent-tabs-mode t)
+ (setq-local indent-tabs-mode nil))
+ (if (not (equal "" base-style))
+ (cond ((or (equal "LLVM" base-style)
+ (equal "Google" base-style)
+ (equal "Chromium" base-style)
+ (equal "Mozilla" base-style)
+ (equal "WebKit" base-style))
+ (setq-local indent-tabs-mode nil))))))))
+
;;; Packages
(require 'package)
-(add-to-list 'package-archives '("melpa" . "http://melpa.org/packages/"))
+(add-to-list 'package-archives '("melpa" . "https://stable.melpa.org/packages/"))
(package-initialize)
(unless (package-installed-p 'use-package)
(progn
(package-refresh-contents)
(package-install 'use-package)))
-(require 'use-package)
-
(setq use-package-always-ensure t)
-(use-package clang-format :commands (c-mode c++-mode))
+
+;(use-package ansi-color :commands compile :after (ivy) :config (counsel-mode))
+
+(use-package clang-format
+ :after (s)
+ :commands (clang-format-buffer clang-format-region)
+ :hook (c-mode-common . clang-format-c-mode-hook))
+
+(use-package clang-format :commands (clang-format-buffer clang-format-region))
(use-package counsel :after (ivy) :config (counsel-mode))
(use-package counsel-gtags :commands ggtags-mode)
(use-package counsel-projectile :after (counsel projectile))
+(use-package diff-hl)
(use-package diminish)
-(use-package dired-rainbow :after (dired+))
+(use-package dpkg-dev-el :commands debian-changelog-mode)
(use-package flyspell :commands flyspell-mode)
(use-package flyspell-correct-ivy :after (flyspell ivy) :commands flyspell-mode)
(use-package ggtags :commands ggtags-mode)
+(use-package glsl-mode :commands glsl-mode)
(use-package ivy :config (ivy-mode))
-(use-package magit :commands magit-status :bind ("C-c m" . magit-status) :config (define-key magit-mode-map (kbd "C-<tab>") nil))
+(use-package json-mode :commands json-mode)
+(use-package llvm-mode :commands llvm-mode)
+
+;; (use-package lsp-mode
+;; :config
+;; (progn
+;; (setq lsp-clients-clangd-args '("-j=4" "-background-index" "-log=error"))
+;; (lsp-register-client
+;; (make-lsp-client :new-connection (lsp-tramp-connection "clangd")
+;; :major-modes '(c-mode c++-mode)
+;; :remote? t
+;; :server-id 'clangd-remote))))
+
+(use-package magit
+ :commands magit-status
+ :after (diff-hl)
+ :bind ("C-c m" . magit-status)
+ :config (define-key magit-mode-map (kbd "C-<tab>") nil))
+
(use-package markdown-mode :commands markdown-mode)
+(use-package meson-mode :commands meson-mode)
(use-package pdf-tools :magic ("%PDF" . pdf-view-mode) :config (pdf-tools-install))
-(use-package projectile :config (projectile-global-mode))
+(use-package prettier :commands prettier-prettify)
+(use-package projectile :config (projectile-mode))
+(use-package quack :commands scheme-mode)
(use-package rainbow-delimiters :commands prog-mode)
-(use-package smart-tabs-mode :commands (c-mode c++-mode))
(use-package spaceline)
(use-package swiper :commands swiper)
-(use-package ttl-mode :commands ttl-mode)
(use-package tramp)
+(use-package yaml-mode :commands yaml-mode)
(require 'spaceline-config)
+(require 'turtle-mode "turtle-mode/turtle-mode.el")
;;; Basic editor configuration
@@ -75,7 +154,9 @@
(diminish 'counsel-mode "")
(diminish 'flyspell-mode "✓")
(diminish 'ggtags-mode "☚")
+(diminish 'eldoc-mode "?")
(diminish 'ivy-mode "")
+
(setq spaceline-minor-modes-separator " ")
(spaceline-define-segment version-control
@@ -97,9 +178,20 @@
(spaceline-define-segment buffer-position
"Buffer position in percent"
- (format "%3d%%%% " (/ (* 100 (- (line-number-at-pos) 1))
+ (format "%3d%%%% " (/ (* 100 (- (line-number-at-pos) 1))
(max 1 (count-lines (point-min) (point-max))))))
+(spaceline-define-segment line-column
+ "The current line and column numbers."
+ (if (eq major-mode 'pdf-view-mode)
+ ;; Show page number and count for PDF documents
+ (concat (number-to-string (pdf-view-current-page))
+ "/"
+ (number-to-string (pdf-cache-number-of-pages)))
+ mode-line-position
+ "%l :%2c"))
+
+(add-hook 'magit-pre-refresh-hook 'diff-hl-magit-pre-refresh)
(add-hook 'magit-post-refresh-hook 'diff-hl-magit-post-refresh)
;;; Variables
@@ -109,68 +201,69 @@
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
+ '(Man-switches "--nj")
+ '(auth-source-save-behavior nil)
'(auto-revert-interval 1)
'(backup-by-copying t)
- '(backup-directory-alist (\` ((".*" \, temporary-file-directory))))
+ '(backup-directory-alist `((".*" \, temporary-file-directory)))
+ '(browse-url-browser-function 'browse-url-firefox)
'(browse-url-firefox-new-window-is-tab t)
+ '(browse-url-generic-program "firefox")
'(column-number-mode t)
+ '(compilation-error-screen-columns nil)
'(compilation-scroll-output t)
- '(cursor-in-non-selected-windows (quote hollow))
- '(custom-enabled-themes (quote (drobillized)))
+ '(css-indent-offset 2)
+ '(cursor-in-non-selected-windows 'hollow)
+ '(custom-enabled-themes '(drobillized))
'(custom-safe-themes
- (quote
- ("b3f9e6023ab4297a337987e6be4ff3f2abe07b562fdc644ca68f9779c3d6c3f4" default)))
+ '("6882409e05d462b9dd7cc649c30f9b5784e20d3728fbeab13f3f7a7c31e81023" default))
'(delete-old-versions t)
'(delete-selection-mode t)
'(dired-omit-files "^\\.?#\\|^\\.$\\|^\\.\\.\\|^\\..*$")
'(diredp-hide-details-initially-flag t)
'(diredp-wrap-around-flag nil)
'(erc-autojoin-channels-alist
- (quote
- ((".*\\.freenode.net" "#ardour-dev" "#ingen" "#lv2"))))
+ '((".*\\.oftc.net" "#mesonbuild")
+ (".*\\.libera.chat" "#ardour-dev" "#ingen" "#lv2" "#lobsters")))
'(erc-autojoin-mode t)
- '(erc-insert-timestamp-function (quote ks-timestamp) t)
- '(erc-join-buffer (quote bury))
+ '(erc-insert-timestamp-function 'ks-timestamp t)
+ '(erc-join-buffer 'bury)
'(erc-log-channels-directory "~/.erc/logs")
'(erc-log-insert-log-on-open t)
'(erc-log-mode t)
'(erc-mode-hook
- (quote
- (erc-munge-invisibility-spec erc-move-to-prompt-setup pcomplete-erc-setup erc-button-setup erc-imenu-setup toggle-word-wrap)))
+ '(erc-munge-invisibility-spec erc-move-to-prompt-setup pcomplete-erc-setup erc-button-setup erc-imenu-setup toggle-word-wrap))
'(erc-mode-line-format "%t")
'(erc-modules
- (quote
- (autojoin button completion irccontrols list match menu move-to-prompt netsplit networks noncommands readonly ring stamp track)))
+ '(autojoin button completion irccontrols list log match menu move-to-prompt netsplit networks noncommands readonly ring stamp track))
+ '(erc-nick-uniquifier "")
'(erc-prompt ">")
- '(erc-stamp-mode t)
- '(erc-timestamp-format "%H:%M ")
- '(erc-timestamp-only-if-changed-flag t)
- '(erc-timestamp-use-align-to nil)
+ '(erc-server "irc.libera.chat")
'(erc-track-exclude-server-buffer t)
'(erc-track-exclude-types
- (quote
- ("JOIN" "NICK" "PART" "QUIT" "MODE" "333" "353" "324" "329" "332" "477")))
+ '("JOIN" "NICK" "PART" "QUIT" "MODE" "333" "353" "324" "329" "332" "477"))
+ '(erc-try-new-nick-p nil)
'(fill-column 79)
'(font-lock-maximum-decoration t)
- '(frame-background-mode (quote dark))
- '(fringe-mode (quote (nil . 0)) nil (fringe))
+ '(frame-background-mode 'dark)
+ '(frame-inhibit-implied-resize t)
+ '(fringe-mode '(nil . 0) nil (fringe))
'(gc-cons-threshold 10000000)
'(global-diff-hl-mode t)
'(grep-find-command
"find . -type f -not -name \"*.svn-base\" -print0 | xargs -0 grep -I -n -s -F ")
'(indicate-empty-lines t)
'(inhibit-startup-screen t)
+ '(initial-major-mode 'fundamental-mode)
'(ivy-magic-tilde nil)
'(jabber-account-list
- (quote
- (("david.e.robillard@gmail.com"
+ '(("david.e.robillard@gmail.com"
(:network-server . "talk.google.com")
(:port . 5223)
- (:connection-type . ssl)))))
+ (:connection-type . ssl))))
'(jabber-chat-buffer-show-avatar nil)
'(jabber-chat-header-line-format
- (quote
- (""
+ '(""
(:eval
(jabber-jid-displayname jabber-chatting-with))
" "
@@ -182,60 +275,66 @@
(or
(cdr
(assoc
- (get buddy
- (quote show))
+ (get buddy 'show)
jabber-presence-strings))
- (get buddy
- (quote show)))
- (quote face)
+ (get buddy 'show))
+ 'face
(or
(cdr
(assoc
- (get buddy
- (quote show))
+ (get buddy 'show)
jabber-presence-faces))
- (quote jabber-roster-user-online)))))
+ 'jabber-roster-user-online))))
" "
(:eval
(jabber-fix-status
(get
(jabber-jid-symbol jabber-chatting-with)
- (quote status))))
- " " jabber-events-message " " jabber-chatstates-message)))
+ 'status)))
+ " " jabber-events-message " " jabber-chatstates-message))
'(jabber-roster-line-format " %c %-25n %u %-8s %S")
+ '(js-indent-level 2)
'(jshint-mode-node-program "nodejs")
'(magit-auto-revert-mode nil)
- '(magit-diff-refine-hunk (quote all))
+ '(magit-commit-show-diff nil)
+ '(magit-diff-refine-hunk 'all)
'(menu-bar-mode nil)
'(ns-use-srgb-colorspace nil)
'(package-selected-packages
- (quote
- (apache-mode auctex clang-format cmake-mode counsel-gtags counsel-projectile diff-hl diminish dired-rainbow dockerfile-mode flyspell-correct-ivy ggtags git-gutter-fringe glsl-mode ivy jinja2-mode json-mode llvm-mode magit markdown-mode meson-mode n3-mode pdf-tools pkgbuild-mode projectile rainbow-delimiters rust-mode smart-tabs-mode spaceline swift-mode ttl-mode use-package yaml-mode)))
- '(pdf-view-midnight-colors (quote ("#C3D1D1" . "#141414")))
- '(powerline-default-separator (quote arrow-fade))
- '(projectile-completion-system (quote ivy))
+ '(debian-el dpkg-dev-el scss-mode typescript-mode prettier vue-mode python-black quack vterm ace-window cython-mode groovy-mode jenkins qml-mode ninja-mode bison-mode csv-mode apache-mode auctex clang-format cmake-mode counsel-gtags counsel-projectile diff-hl diminish dired-rainbow dockerfile-mode flyspell-correct-ivy ggtags git-gutter-fringe glsl-mode ivy jinja2-mode json-mode llvm-mode magit markdown-mode meson-mode n3-mode pdf-tools pkgbuild-mode projectile rainbow-delimiters rust-mode spaceline swift-mode ttl-mode use-package yaml-mode))
+ '(pdf-view-midnight-colors '("#C3D1D1" . "#141414"))
+ '(powerline-default-separator nil)
+ '(projectile-completion-system 'ivy)
'(projectile-enable-caching t)
- '(projectile-mode-line nil)
'(projectile-mode-line-function
(lambda nil
- (format "%s:%s" projectile-mode-line-prefix
+ (format "%s%s" projectile-mode-line-prefix
(or
(projectile-project-name)
"-"))))
- '(projectile-mode-line-prefix "P")
+ '(projectile-mode-line-prefix "")
'(projectile-use-git-grep t)
+ '(python-black-extra-args '("-l 79"))
'(quack-pretty-lambda-p t)
- '(quack-run-scheme-always-prompts-p nil)
+ '(quack-run-scheme-always-prompts-p t)
'(savehist-mode t)
+ '(scroll-bar-mode nil)
'(scroll-conservatively 5)
- '(send-mail-function (quote sendmail-send-it))
+ '(send-mail-function 'sendmail-send-it)
'(show-paren-mode t)
'(speedbar-use-images nil)
- '(split-window-preferred-function (quote split-window-horizontally))
+ '(split-window-preferred-function 'split-window-horizontally)
'(tool-bar-mode nil)
+ '(ttl-electric-punctuation t)
+ '(typescript-indent-level 2)
'(version-control t)
'(visible-bell nil)
- '(winner-mode t))
+ '(window-divider-default-bottom-width 1)
+ '(window-divider-default-right-width 1)
+ '(window-divider-mode t))
+
+(if (eq system-type 'windows-nt)
+ (setq diff-command "C:/Program Files/Git/usr/bin/diff.exe"))
(setq ring-bell-function
(lambda ()
@@ -252,7 +351,7 @@
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
- )
+ '(default ((t (:background "#141414" :foreground "#C3D1D1" :height 140 :family "DejaVu Sans Mono")))))
;;; Windows
@@ -261,7 +360,6 @@
(cond ((and (string-match "compilation" (buffer-name buffer))
(string-match "finished" string))
(bury-buffer "*compilation*")
- (winner-undo)
(message "Build successful."))
(t
(message "Compilation exited abnormally: %s" string))))
@@ -287,7 +385,8 @@
(setq split-height-threshold nil)
(setq split-width-threshold 0)
-(setq compilation-finish-functions 'compile-autoclose)
+
+(add-hook 'compilation-finish-functions #'compile-autoclose)
;; Remove slow Maven regexp that makes the compilation buffer clunky
(setq compilation-error-regexp-alist
@@ -300,36 +399,40 @@
;;; Key bindings
+(windmove-default-keybindings)
+
(define-key projectile-mode-map (kbd "C-c p") 'projectile-command-map)
-(global-set-key (kbd "C-<left>") 'previous-buffer)
-(global-set-key (kbd "C-<right>") 'next-buffer)
-(global-set-key (kbd "C-<tab>") 'other-window)
-(global-set-key (kbd "C-b") 'compile)
-(global-set-key (kbd "C-m") 'newline-and-indent)
-(global-set-key (kbd "C-n") 'next-error)
-(global-set-key (kbd "C-p") 'previous-error)
-(global-set-key (kbd "C-s") 'swiper)
-
-(global-set-key (kbd "C-c <") 'first-error)
-(global-set-key (kbd "C-c =") 'set-variable)
-(global-set-key (kbd "C-c I") 'clang-format-region)
-(global-set-key (kbd "C-c R") 'replace-regexp)
-(global-set-key (kbd "C-c a") 'align)
-(global-set-key (kbd "C-c b") 'magit-blame)
-(global-set-key (kbd "C-c c") 'comment-region)
-(global-set-key (kbd "C-c d") 'svn-status-show-svn-diff)
-(global-set-key (kbd "C-c e") 'erc-track-switch-buffer)
-(global-set-key (kbd "C-c f") 'ff-find-other-file)
-(global-set-key (kbd "C-c g") 'grep-find)
-(global-set-key (kbd "C-c h") 'mark-defun)
-(global-set-key (kbd "C-c i") 'clang-format-buffer)
-(global-set-key (kbd "C-c m") 'magit-status)
-(global-set-key (kbd "C-c r") 'replace-string)
-(global-set-key (kbd "C-c s") 'sort-lines)
-(global-set-key (kbd "C-c t") 'toggle-truncate-lines)
-(global-set-key (kbd "C-c u") 'uncomment-region)
-(global-set-key (kbd "C-c w") 'rotate-windows)
+(global-set-key (kbd "C-<left>") 'previous-buffer)
+(global-set-key (kbd "C-<right>") 'next-buffer)
+(global-set-key (kbd "C-<tab>") 'next-window-any-frame)
+(global-set-key (kbd "C-<iso-lefttab>") 'previous-window-any-frame)
+(global-set-key (kbd "C-b") 'compile)
+(global-set-key (kbd "C-m") 'newline-and-indent)
+(global-set-key (kbd "C-n") 'next-error)
+(global-set-key (kbd "C-p") 'previous-error)
+(global-set-key (kbd "C-s") 'swiper)
+(global-set-key (kbd "C-c <") 'first-error)
+(global-set-key (kbd "C-c =") 'set-variable)
+(global-set-key (kbd "C-c I") 'clang-format-region)
+(global-set-key (kbd "C-c P") 'prettier-prettify)
+(global-set-key (kbd "C-c R") 'replace-regexp)
+(global-set-key (kbd "C-c a") 'align)
+(global-set-key (kbd "C-c b") 'magit-blame)
+(global-set-key (kbd "C-c c") 'comment-region)
+(global-set-key (kbd "C-c d") 'svn-status-show-svn-diff)
+(global-set-key (kbd "C-c e") 'erc-track-switch-buffer)
+(global-set-key (kbd "C-c f") 'ff-find-other-file)
+(global-set-key (kbd "C-c g") 'grep-find)
+(global-set-key (kbd "C-c h") 'mark-defun)
+(global-set-key (kbd "C-c i") 'clang-format-buffer)
+(global-set-key (kbd "C-c m") 'magit-status)
+(global-set-key (kbd "C-c o") 'ace-window)
+(global-set-key (kbd "C-c r") 'replace-string)
+(global-set-key (kbd "C-c s") 'sort-lines)
+(global-set-key (kbd "C-c t") 'toggle-truncate-lines)
+(global-set-key (kbd "C-c u") 'uncomment-region)
+(global-set-key (kbd "C-c w") 'rotate-windows)
;;; File modes
@@ -398,16 +501,13 @@
(defun my-c-mode-common-hook ()
"C mode for people with taste."
- (require 'smart-tabs-mode)
(auto-fill-mode 1)
(abbrev-mode -1)
(set-fill-column 79)
- (smart-tabs-mode-enable)
(setq tab-width 4)
(setq indent-tabs-mode t)
(setq truncate-lines t)
(setq show-trailing-whitespace t)
- (smart-tabs-advice c-indent-line c-basic-offset)
(c-set-style "drobilla"))
(add-hook 'c-mode-common-hook 'my-c-mode-common-hook)
@@ -419,7 +519,21 @@
(lambda ()
(setq tab-width 4)
(setq indent-tabs-mode nil)
- (setq show-trailing-whitespace)))
+ (setq show-trailing-whitespace t)))
+
+;; Turtle
+
+(add-hook 'turtle-mode-hook
+ (lambda ()
+ (setq tab-width 4)
+ (setq indent-tabs-mode t)
+ (setq show-trailing-whitespace t)))
+
+;; Dired
+
+(add-hook 'dired-mode-hook
+ (lambda ()
+ (dired-hide-details-mode)))
;; IRC
@@ -446,37 +560,40 @@
(add-hook 'doc-view-mode-hook 'my-doc-view-hook)
(add-hook 'pdf-view-mode-hook 'my-doc-view-hook)
-(spaceline-define-segment line-column
- "The current line and column numbers."
- (if (eq major-mode 'pdf-view-mode)
- ;; Show page number and count for PDF documents
- (concat (number-to-string (pdf-view-current-page))
- "/"
- (number-to-string (pdf-cache-number-of-pages)))
- mode-line-position
- "%l:%c"))
+;; Shell
+
+(add-hook 'shell-mode-hook 'ansi-color-for-comint-mode-on)
+(add-to-list 'comint-output-filter-functions 'ansi-color-process-output)
+
+;; Compilation
+
+(defun colorize-compilation-buffer ()
+ (let ((inhibit-read-only t))
+ (ansi-color-apply-on-region (point-min) (point-max))))
+
+;; (add-hook 'compilation-filter-hook 'colorize-compilation-buffer)
;; Associations
-(add-to-list 'auto-mode-alist '("\\.ipp" . c++-mode))
-(add-to-list 'auto-mode-alist '("\\.pl\\'" . prolog-mode))
-(add-to-list 'auto-mode-alist '("\\.n3" . ttl-mode))
-(add-to-list 'auto-mode-alist '("\\.ttl" . ttl-mode))
-(add-to-list 'auto-mode-alist '("\\.owl" . ttl-mode))
-(add-to-list 'auto-mode-alist '("\\.ll" . llvm-mode))
-(add-to-list 'auto-mode-alist '("\\.md" . markdown-mode))
-(add-to-list 'auto-mode-alist '("\\.pdf" . pdf-view-mode))
-(add-to-list 'auto-mode-alist '("\\.gyp" . python-mode))
-(add-to-list 'auto-mode-alist '("\\.gypi" . python-mode))
-(add-to-list 'auto-mode-alist '("\\.jsonld" . json-mode))
-
-;;; Projectile
-
-(defun my-projectile-mode-line ()
- "Report project name in the modeline."
- (format "%s[%s%s]"
- projectile-mode-line-prefix
- (or (projectile-project-name) "-")))
+(add-to-list 'auto-mode-alist '("\\.ipp\\'" . c++-mode))
+(add-to-list 'auto-mode-alist '("\\.pl\\'" . prolog-mode))
+(add-to-list 'auto-mode-alist '("\\.n3\\'" . turtle-mode))
+(add-to-list 'auto-mode-alist '("\\.ttl\\'" . turtle-mode))
+(add-to-list 'auto-mode-alist '("\\.owl\\'" . turtle-mode))
+(add-to-list 'auto-mode-alist '("\\.ll\\'" . llvm-mode))
+(add-to-list 'auto-mode-alist '("\\.md\\'" . markdown-mode))
+(add-to-list 'auto-mode-alist '("\\.pdf\\'" . pdf-view-mode))
+(add-to-list 'auto-mode-alist '("\\.gyp\\'" . python-mode))
+(add-to-list 'auto-mode-alist '("\\.gypi\\'" . python-mode))
+(add-to-list 'auto-mode-alist '("\\.jsonld\\'" . json-mode))
+(add-to-list 'auto-mode-alist '("\\.tesc\\'" . glsl-mode))
+(add-to-list 'auto-mode-alist '("\\.tese\\'" . glsl-mode))
+(add-to-list 'auto-mode-alist '("\\.m\\'" . objc-mode))
+(add-to-list 'auto-mode-alist '("\\.mm\\'" . objc-mode))
+(add-to-list 'auto-mode-alist '("\\.ipp\\'" . c++-mode))
+(add-to-list 'auto-mode-alist '("\\.clang-format\\'" . yaml-mode))
+(add-to-list 'auto-mode-alist '("\\.clang-tidy\\'" . yaml-mode))
+(add-to-list 'auto-mode-alist '("\\NEWS" . debian-changelog-mode))
;;; Launch
diff --git a/emacs/.emacs.d/site-lisp/clang-format.el b/emacs/.emacs.d/site-lisp/clang-format.el
new file mode 100644
index 0000000..4abafcb
--- /dev/null
+++ b/emacs/.emacs.d/site-lisp/clang-format.el
@@ -0,0 +1,222 @@
+;;; clang-format.el --- Format code using clang-format -*- lexical-binding: t; -*-
+
+;; Keywords: tools, c
+;; Package-Version: 20191106.950
+;; Package-Commit: e48ff8ae18dc7ab6118c1f6752deb48cb1fc83ac
+;; Package-Requires: ((cl-lib "0.3"))
+;; SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+
+;;; Commentary:
+
+;; This package allows to filter code through clang-format to fix its formatting.
+;; clang-format is a tool that formats C/C++/Obj-C code according to a set of
+;; style options, see <http://clang.llvm.org/docs/ClangFormatStyleOptions.html>.
+;; Note that clang-format 3.4 or newer is required.
+
+;; clang-format.el is available via MELPA and can be installed via
+;;
+;; M-x package-install clang-format
+;;
+;; when ("melpa" . "http://melpa.org/packages/") is included in
+;; `package-archives'. Alternatively, ensure the directory of this
+;; file is in your `load-path' and add
+;;
+;; (require 'clang-format)
+;;
+;; to your .emacs configuration.
+
+;; You may also want to bind `clang-format-region' to a key:
+;;
+;; (global-set-key [C-M-tab] 'clang-format-region)
+
+;;; Code:
+
+(require 'cl-lib)
+(require 'xml)
+
+(defgroup clang-format nil
+ "Format code using clang-format."
+ :group 'tools)
+
+(defcustom clang-format-executable
+ (or (executable-find "clang-format")
+ "clang-format")
+ "Location of the clang-format executable.
+
+A string containing the name or the full path of the executable."
+ :group 'clang-format
+ :type '(file :must-match t)
+ :risky t)
+
+(defcustom clang-format-style nil
+ "Style argument to pass to clang-format.
+
+By default clang-format will load the style configuration from
+a file named .clang-format located in one of the parent directories
+of the buffer."
+ :group 'clang-format
+ :type '(choice (string) (const nil))
+ :safe #'stringp)
+(make-variable-buffer-local 'clang-format-style)
+
+(defcustom clang-format-fallback-style "none"
+ "Fallback style to pass to clang-format.
+
+This style will be used if clang-format-style is set to \"file\"
+and no .clang-format is found in the directory of the buffer or
+one of parent directories. Set to \"none\" to disable formatting
+in such buffers."
+ :group 'clang-format
+ :type 'string
+ :safe #'stringp)
+(make-variable-buffer-local 'clang-format-fallback-style)
+
+(defun clang-format--extract (xml-node)
+ "Extract replacements and cursor information from XML-NODE."
+ (unless (and (listp xml-node) (eq (xml-node-name xml-node) 'replacements))
+ (error "Expected <replacements> node"))
+ (let ((nodes (xml-node-children xml-node))
+ (incomplete-format (xml-get-attribute xml-node 'incomplete_format))
+ replacements
+ cursor)
+ (dolist (node nodes)
+ (when (listp node)
+ (let* ((children (xml-node-children node))
+ (text (car children)))
+ (cl-case (xml-node-name node)
+ ('replacement
+ (let* ((offset (xml-get-attribute-or-nil node 'offset))
+ (length (xml-get-attribute-or-nil node 'length)))
+ (when (or (null offset) (null length))
+ (error "<replacement> node does not have offset and length attributes"))
+ (when (cdr children)
+ (error "More than one child node in <replacement> node"))
+
+ (setq offset (string-to-number offset))
+ (setq length (string-to-number length))
+ (push (list offset length text) replacements)))
+ ('cursor
+ (setq cursor (string-to-number text)))))))
+
+ ;; Sort by decreasing offset, length.
+ (setq replacements (sort (delq nil replacements)
+ (lambda (a b)
+ (or (> (car a) (car b))
+ (and (= (car a) (car b))
+ (> (cadr a) (cadr b)))))))
+
+ (list replacements cursor (string= incomplete-format "true"))))
+
+(defun clang-format--replace (offset length &optional text)
+ "Replace the region defined by OFFSET and LENGTH with TEXT.
+OFFSET and LENGTH are measured in bytes, not characters. OFFSET
+is a zero-based file offset, assuming ‘utf-8-unix’ coding."
+ (let ((start (clang-format--filepos-to-bufferpos offset 'exact 'utf-8-unix))
+ (end (clang-format--filepos-to-bufferpos (+ offset length) 'exact
+ 'utf-8-unix)))
+ (goto-char start)
+ (delete-region start end)
+ (when text
+ (insert text))))
+
+;; ‘bufferpos-to-filepos’ and ‘filepos-to-bufferpos’ are new in Emacs 25.1.
+;; Provide fallbacks for older versions.
+(defalias 'clang-format--bufferpos-to-filepos
+ (if (fboundp 'bufferpos-to-filepos)
+ 'bufferpos-to-filepos
+ (lambda (position &optional _quality _coding-system)
+ (1- (position-bytes position)))))
+
+(defalias 'clang-format--filepos-to-bufferpos
+ (if (fboundp 'filepos-to-bufferpos)
+ 'filepos-to-bufferpos
+ (lambda (byte &optional _quality _coding-system)
+ (byte-to-position (1+ byte)))))
+
+;;;###autoload
+(defun clang-format-region (start end &optional style assume-file-name)
+ "Use clang-format to format the code between START and END according to STYLE.
+If called interactively uses the region or the current statement if there is no
+no active region. If no STYLE is given uses `clang-format-style'. Use
+ASSUME-FILE-NAME to locate a style config file, if no ASSUME-FILE-NAME is given
+uses the function `buffer-file-name'."
+ (interactive
+ (if (use-region-p)
+ (list (region-beginning) (region-end))
+ (list (point) (point))))
+
+ (unless style
+ (setq style clang-format-style))
+
+ (unless assume-file-name
+ (setq assume-file-name buffer-file-name))
+
+ (let ((file-start (clang-format--bufferpos-to-filepos start 'approximate
+ 'utf-8-unix))
+ (file-end (clang-format--bufferpos-to-filepos end 'approximate
+ 'utf-8-unix))
+ (cursor (clang-format--bufferpos-to-filepos (point) 'exact 'utf-8-unix))
+ (temp-buffer (generate-new-buffer " *clang-format-temp*"))
+ (temp-file (make-temp-file "clang-format"))
+ ;; Output is XML, which is always UTF-8. Input encoding should match
+ ;; the encoding used to convert between buffer and file positions,
+ ;; otherwise the offsets calculated above are off. For simplicity, we
+ ;; always use ‘utf-8-unix’ and ignore the buffer coding system.
+ (default-process-coding-system '(utf-8-unix . utf-8-unix)))
+ (unwind-protect
+ (let ((status (apply #'call-process-region
+ nil nil clang-format-executable
+ nil `(,temp-buffer ,temp-file) nil
+ `("-output-replacements-xml"
+ ;; Guard against a nil assume-file-name.
+ ;; If the clang-format option -assume-filename
+ ;; is given a blank string it will crash as per
+ ;; the following bug report
+ ;; https://bugs.llvm.org/show_bug.cgi?id=34667
+ ,@(and assume-file-name
+ (list "-assume-filename" assume-file-name))
+ ,@(and style (list "-style" style))
+ "-fallback-style" ,clang-format-fallback-style
+ "-offset" ,(number-to-string file-start)
+ "-length" ,(number-to-string (- file-end file-start))
+ "-cursor" ,(number-to-string cursor))))
+ (stderr (with-temp-buffer
+ (unless (zerop (cadr (insert-file-contents temp-file)))
+ (insert ": "))
+ (buffer-substring-no-properties
+ (point-min) (line-end-position)))))
+ (cond
+ ((stringp status)
+ (error "(clang-format killed by signal %s%s)" status stderr))
+ ((not (zerop status))
+ (error "(clang-format failed with code %d%s)" status stderr)))
+
+ (cl-destructuring-bind (replacements cursor incomplete-format)
+ (with-current-buffer temp-buffer
+ (clang-format--extract (car (xml-parse-region))))
+ (save-excursion
+ (dolist (rpl replacements)
+ (apply #'clang-format--replace rpl)))
+ (when cursor
+ (goto-char (clang-format--filepos-to-bufferpos cursor 'exact
+ 'utf-8-unix)))
+ (if incomplete-format
+ (message "(clang-format: incomplete (syntax errors)%s)" stderr)
+ (message "(clang-format: success%s)" stderr))))
+ (delete-file temp-file)
+ (when (buffer-name temp-buffer) (kill-buffer temp-buffer)))))
+
+;;;###autoload
+(defun clang-format-buffer (&optional style assume-file-name)
+ "Use clang-format to format the current buffer according to STYLE.
+If no STYLE is given uses `clang-format-style'. Use ASSUME-FILE-NAME
+to locate a style config file. If no ASSUME-FILE-NAME is given uses
+the function `buffer-file-name'."
+ (interactive)
+ (clang-format-region (point-min) (point-max) style assume-file-name))
+
+;;;###autoload
+(defalias 'clang-format 'clang-format-region)
+
+(provide 'clang-format)
+;;; clang-format.el ends here
diff --git a/emacs/.emacs.d/site-lisp/glsl-mode.el b/emacs/.emacs.d/site-lisp/glsl-mode.el
new file mode 100644
index 0000000..8068b75
--- /dev/null
+++ b/emacs/.emacs.d/site-lisp/glsl-mode.el
@@ -0,0 +1,451 @@
+;;; glsl-mode.el --- major mode for Open GLSL shader files
+
+;; Copyright (C) 1999, 2000, 2001 Free Software Foundation, Inc.
+;; Copyright (C) 2011, 2014, 2019 Jim Hourihan
+;;
+;; Authors: Xavier.Decoret@imag.fr,
+;; Jim Hourihan <jimhourihan ~at~ gmail.com> (updated for 4.6, etc)
+;; Keywords: languages OpenGL GPU SPIR-V Vulkan
+;; Version: 2.4
+;; X-URL: https://github.com/jimhourihan/glsl-mode
+;;
+;; Original X-URL http://artis.inrialpes.fr/~Xavier.Decoret/resources/glsl-mode/
+
+;; This file 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 3, or (at your option)
+;; any later version.
+
+;; This file 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.
+
+;; For a full copy of the GNU General Public License
+;; see <http://www.gnu.org/licenses/>.
+
+;;; Commentary:
+
+;; Major mode for editing OpenGLSL grammar files, usually files ending with
+;; `.vert', `.frag', `.glsl', `.geom'. Is is based on c-mode plus some
+;; features and pre-specified fontifications.
+;;
+;; Modifications from the 1.0 version of glsl-mode (jimhourihan):
+;; * Removed original optimized regexps for font-lock-keywords and
+;; replaced with keyword lists for easier maintenance
+;; * Added customization group and faces
+;; * Preprocessor faces
+;; * Updated to GLSL 4.6
+;; * Separate deprecated symbols
+;; * Made _ part of a word
+;; * man page lookup at opengl.org
+
+;; This package provides the following features:
+;; * Syntax coloring (via font-lock) for grammar symbols and
+;; builtin functions and variables for up to GLSL version 4.6
+;; * Indentation for the current line (TAB) and selected region (C-M-\).
+;; * Switching between file.vert and file.frag
+;; with S-lefttab (via ff-find-other-file)
+;; * interactive function glsl-find-man-page prompts for glsl built
+;; in function, formats opengl.org url and passes to browse-url
+
+;;; Installation:
+
+;; This file requires Emacs-20.3 or higher and package cc-mode.
+
+;; If glsl-mode is not part of your distribution, put this file into your
+;; load-path and the following into your ~/.emacs:
+;; (autoload 'glsl-mode "glsl-mode" nil t)
+;; (add-to-list 'auto-mode-alist '("\\.glsl\\'" . glsl-mode))
+;; (add-to-list 'auto-mode-alist '("\\.vert\\'" . glsl-mode))
+;; (add-to-list 'auto-mode-alist '("\\.frag\\'" . glsl-mode))
+;; (add-to-list 'auto-mode-alist '("\\.geom\\'" . glsl-mode))
+
+;; Reference:
+;; https://www.khronos.org/registry/OpenGL/specs/gl/GLSLangSpec.4.60.pdf
+
+;;; Code:
+
+(provide 'glsl-mode)
+
+(eval-when-compile ; required and optional libraries
+ (require 'cc-mode)
+ (require 'find-file))
+
+(require 'align)
+
+(defgroup glsl nil
+ "OpenGL Shading Language Major Mode"
+ :group 'languages)
+
+(defconst glsl-language-version "4.6"
+ "GLSL language version number.")
+
+(defconst gl-version "4.6"
+ "OpenGL major mode version number.")
+
+(defvar glsl-mode-menu nil "Menu for GLSL mode")
+
+(defvar glsl-mode-hook nil "GLSL mode hook")
+
+(defvar glsl-type-face 'glsl-type-face)
+(defface glsl-type-face
+ '((t (:inherit font-lock-type-face))) "glsl: type face"
+ :group 'glsl)
+
+(defvar glsl-builtin-face 'glsl-builtin-face)
+(defface glsl-builtin-face
+ '((t (:inherit font-lock-builtin-face))) "glsl: builtin face"
+ :group 'glsl)
+
+(defvar glsl-deprecated-builtin-face 'glsl-deprecated-builtin-face)
+(defface glsl-deprecated-builtin-face
+ '((t (:inherit font-lock-warning-face))) "glsl: deprecated builtin face"
+ :group 'glsl)
+
+(defvar glsl-qualifier-face 'glsl-qualifier-face)
+(defface glsl-qualifier-face
+ '((t (:inherit font-lock-keyword-face))) "glsl: qualifier face"
+ :group 'glsl)
+
+(defvar glsl-keyword-face 'glsl-keyword-face)
+(defface glsl-keyword-face
+ '((t (:inherit font-lock-keyword-face))) "glsl: keyword face"
+ :group 'glsl)
+
+(defvar glsl-deprecated-keyword-face 'glsl-deprecated-keyword-face)
+(defface glsl-deprecated-keyword-face
+ '((t (:inherit font-lock-warning-face))) "glsl: deprecated keyword face"
+ :group 'glsl)
+
+(defvar glsl-variable-name-face 'glsl-variable-name-face)
+(defface glsl-variable-name-face
+ '((t (:inherit font-lock-variable-name-face))) "glsl: variable face"
+ :group 'glsl)
+
+(defvar glsl-deprecated-variable-name-face 'glsl-deprecated-variable-name-face)
+(defface glsl-deprecated-variable-name-face
+ '((t (:inherit font-lock-warning-face))) "glsl: deprecated variable face"
+ :group 'glsl)
+
+(defvar glsl-reserved-keyword-face 'glsl-reserved-keyword-face)
+(defface glsl-reserved-keyword-face
+ '((t (:inherit glsl-keyword-face))) "glsl: reserved keyword face"
+ :group 'glsl)
+
+(defvar glsl-preprocessor-face 'glsl-preprocessor-face)
+(defface glsl-preprocessor-face
+ '((t (:inherit font-lock-preprocessor-face))) "glsl: preprocessor face"
+ :group 'glsl)
+
+(defcustom glsl-additional-types nil
+ "List of additional keywords to be considered types. These are
+added to the `glsl-type-list' and are fontified using the
+`glsl-type-face'. Examples of existing types include \"float\", \"vec4\",
+ and \"int\"."
+ :type '(repeat (string :tag "Type Name"))
+ :group 'glsl)
+
+(defcustom glsl-additional-qualifiers nil
+ "List of additional keywords to be considered qualifiers. These
+are added to the `glsl-qualifier-list' and are fontified using
+the `glsl-qualifier-face'. Examples of existing qualifiers
+include \"const\", \"in\", and \"out\"."
+ :type '(repeat (string :tag "Qualifier Name"))
+ :group 'glsl)
+
+(defcustom glsl-additional-keywords nil
+ "List of additional GLSL keywords. These are added to the
+`glsl-keyword-list' and are fontified using the
+`glsl-keyword-face'. Example existing keywords include \"while\",
+\"if\", and \"return\"."
+ :type '(repeat (string :tag "Keyword"))
+ :group 'glsl)
+
+(defcustom glsl-additional-built-ins nil
+ "List of additional functions to be considered built-in. These
+are added to the `glsl-builtin-list' and are fontified using the
+`glsl-builtin-face'."
+ :type '(repeat (string :tag "Keyword"))
+ :group 'glsl)
+
+(defvar glsl-mode-hook nil)
+
+(defvar glsl-mode-map
+ (let ((glsl-mode-map (make-sparse-keymap)))
+ (define-key glsl-mode-map [S-iso-lefttab] 'ff-find-other-file)
+ glsl-mode-map)
+ "Keymap for GLSL major mode.")
+
+(defcustom glsl-browse-url-function 'browse-url
+ "Function used to display GLSL man pages. E.g. browse-url, eww, w3m, etc"
+ :type 'function
+ :group 'glsl)
+
+(defcustom glsl-man-pages-base-url "http://www.opengl.org/sdk/docs/man/html/"
+ "Location of GL man pages."
+ :type 'string
+ :group 'glsl)
+
+;;;###autoload
+(progn
+ (add-to-list 'auto-mode-alist '("\\.vert\\'" . glsl-mode))
+ (add-to-list 'auto-mode-alist '("\\.frag\\'" . glsl-mode))
+ (add-to-list 'auto-mode-alist '("\\.geom\\'" . glsl-mode))
+ (add-to-list 'auto-mode-alist '("\\.glsl\\'" . glsl-mode)))
+
+(eval-and-compile
+ ;; These vars are useful for completion so keep them around after
+ ;; compile as well. The goal here is to have the byte compiled code
+ ;; have optimized regexps so its not done at eval time.
+ (defvar glsl-type-list
+ '("float" "double" "int" "void" "bool" "true" "false" "mat2" "mat3"
+ "mat4" "dmat2" "dmat3" "dmat4" "mat2x2" "mat2x3" "mat2x4" "dmat2x2"
+ "dmat2x3" "dmat2x4" "mat3x2" "mat3x3" "mat3x4" "dmat3x2" "dmat3x3"
+ "dmat3x4" "mat4x2" "mat4x3" "mat4x4" "dmat4x2" "dmat4x3" "dmat4x4" "vec2"
+ "vec3" "vec4" "ivec2" "ivec3" "ivec4" "bvec2" "bvec3" "bvec4" "dvec2"
+ "dvec3" "dvec4" "uint" "uvec2" "uvec3" "uvec4" "atomic_uint"
+ "sampler1D" "sampler2D" "sampler3D" "samplerCube" "sampler1DShadow"
+ "sampler2DShadow" "samplerCubeShadow" "sampler1DArray" "sampler2DArray"
+ "sampler1DArrayShadow" "sampler2DArrayShadow" "isampler1D" "isampler2D"
+ "isampler3D" "isamplerCube" "isampler1DArray" "isampler2DArray"
+ "usampler1D" "usampler2D" "usampler3D" "usamplerCube" "usampler1DArray"
+ "usampler2DArray" "sampler2DRect" "sampler2DRectShadow" "isampler2DRect"
+ "usampler2DRect" "samplerBuffer" "isamplerBuffer" "usamplerBuffer"
+ "sampler2DMS" "isampler2DMS" "usampler2DMS" "sampler2DMSArray"
+ "isampler2DMSArray" "usampler2DMSArray" "samplerCubeArray"
+ "samplerCubeArrayShadow" "isamplerCubeArray" "usamplerCubeArray"
+ "image1D" "iimage1D" "uimage1D" "image2D" "iimage2D" "uimage2D" "image3D"
+ "iimage3D" "uimage3D" "image2DRect" "iimage2DRect" "uimage2DRect"
+ "imageCube" "iimageCube" "uimageCube" "imageBuffer" "iimageBuffer"
+ "uimageBuffer" "image1DArray" "iimage1DArray" "uimage1DArray"
+ "image2DArray" "iimage2DArray" "uimage2DArray" "imageCubeArray"
+ "iimageCubeArray" "uimageCubeArray" "image2DMS" "iimage2DMS" "uimage2DMS"
+ "image2DMSArray" "iimage2DMSArray" "uimage2DMSArray"))
+
+ (defvar glsl-qualifier-list
+ '("attribute" "const" "uniform" "varying" "buffer" "shared" "coherent"
+ "volatile" "restrict" "readonly" "writeonly" "layout" "centroid" "flat"
+ "smooth" "noperspective" "patch" "sample" "in" "out" "inout"
+ "invariant" "lowp" "mediump" "highp"))
+
+ (defvar glsl-keyword-list
+ '("break" "continue" "do" "for" "while" "if" "else" "subroutine"
+ "discard" "return" "precision" "struct" "switch" "default" "case"))
+
+ (defvar glsl-reserved-list
+ '("input" "output" "asm" "class" "union" "enum" "typedef" "template" "this"
+ "packed" "resource" "goto" "inline" "noinline"
+ "common" "partition" "active" "long" "short" "half" "fixed" "unsigned" "superp"
+ "public" "static" "extern" "external" "interface"
+ "hvec2" "hvec3" "hvec4" "fvec2" "fvec3" "fvec4"
+ "filter" "sizeof" "cast" "namespace" "using"
+ "sampler3DRect"))
+
+ (defvar glsl-deprecated-qualifier-list
+ '("varying" "attribute")) ; centroid is deprecated when used with varying
+
+ (defvar glsl-builtin-list
+ '("abs" "acos" "acosh" "all" "any" "anyInvocation" "allInvocations"
+ "allInvocationsEqual" "asin" "asinh" "atan" "atanh"
+ "atomicAdd" "atomicMin" "atomicMax" "atomicAnd" "atomicOr"
+ "atomicXor" "atomicExchange" "atomicCompSwap"
+ "atomicCounter" "atomicCounterDecrement" "atomicCounterIncrement"
+ "atomicCounterAdd" "atomicCounterSubtract" "atomicCounterMin"
+ "atomicCounterMax" "atomicCounterAnd" "atomicCounterOr"
+ "atomicCounterXor" "atomicCounterExchange" "atomicCounterCompSwap"
+ "barrier" "bitCount" "bitfieldExtract" "bitfieldInsert" "bitfieldReverse"
+ "ceil" "clamp" "cos" "cosh" "cross" "degrees" "determinant" "dFdx" "dFdy"
+ "dFdyFine" "dFdxFine" "dFdyCoarse" "dFdxCoarse" "distance" "dot"
+ "fwidthFine" "fwidthCoarse"
+ "EmitStreamVertex" "EmitStreamPrimitive" "EmitVertex" "EndPrimitive"
+ "EndStreamPrimitive" "equal" "exp" "exp2" "faceforward" "findLSB"
+ "findMSB" "floatBitsToInt" "floatBitsToUint" "floor" "fma" "fract"
+ "frexp" "fwidth" "greaterThan" "greaterThanEqual" "groupMemoryBarrier"
+ "imageAtomicAdd" "imageAtomicAnd" "imageAtomicCompSwap" "imageAtomicExchange"
+ "imageAtomicMax" "imageAtomicMin" "imageAtomicOr" "imageAtomicXor"
+ "imageLoad" "imageSize" "imageStore" "imulExtended" "intBitsToFloat"
+ "imageSamples" "interpolateAtCentroid" "interpolateAtOffset" "interpolateAtSample"
+ "inverse" "inversesqrt" "isinf" "isnan" "ldexp" "length" "lessThan"
+ "lessThanEqual" "log" "log2" "matrixCompMult" "max" "memoryBarrier"
+ "memoryBarrierAtomicCounter" "memoryBarrierBuffer"
+ "memoryBarrierShared" "memoryBarrierImage" "memoryBarrier"
+ "min" "mix" "mod" "modf" "normalize" "not" "notEqual" "outerProduct"
+ "packDouble2x32" "packHalf2x16" "packSnorm2x16" "packSnorm4x8"
+ "packUnorm2x16" "packUnorm4x8" "pow" "radians" "reflect" "refract"
+ "round" "roundEven" "sign" "sin" "sinh" "smoothstep" "sqrt" "step" "tan"
+ "tanh" "texelFetch" "texelFetchOffset" "texture" "textureGather"
+ "textureGatherOffset" "textureGatherOffsets" "textureGrad" "textureSamples"
+ "textureGradOffset" "textureLod" "textureLodOffset" "textureOffset"
+ "textureProj" "textureProjGrad" "textureProjGradOffset" "textureProjLod"
+ "textureProjLodOffset" "textureProjOffset" "textureQueryLevels" "textureQueryLod"
+ "textureSize" "transpose" "trunc" "uaddCarry" "uintBitsToFloat"
+ "umulExtended" "unpackDouble2x32" "unpackHalf2x16" "unpackSnorm2x16"
+ "unpackSnorm4x8" "unpackUnorm2x16" "unpackUnorm4x8" "usubBorrow"))
+
+ (defvar glsl-deprecated-builtin-list
+ '("noise1" "noise2" "noise3" "noise4"
+ "texture1D" "texture1DProj" "texture1DLod" "texture1DProjLod"
+ "texture2D" "texture2DProj" "texture2DLod" "texture2DProjLod"
+ "texture2DRect" "texture2DRectProj"
+ "texture3D" "texture3DProj" "texture3DLod" "texture3DProjLod"
+ "shadow1D" "shadow1DProj" "shadow1DLod" "shadow1DProjLod"
+ "shadow2D" "shadow2DProj" "shadow2DLod" "shadow2DProjLod"
+ "textureCube" "textureCubeLod"))
+
+ (defvar glsl-deprecated-variables-list
+ '("gl_FragColor" "gl_FragData" "gl_MaxVarying" "gl_MaxVaryingFloats"
+ "gl_MaxVaryingComponents"))
+
+ (defvar glsl-preprocessor-directive-list
+ '("define" "undef" "if" "ifdef" "ifndef" "else" "elif" "endif"
+ "error" "pragma" "extension" "version" "line"))
+
+ (defvar glsl-preprocessor-expr-list
+ '("defined" "##"))
+
+ (defvar glsl-preprocessor-builtin-list
+ '("__LINE__" "__FILE__" "__VERSION__"))
+
+ ) ; eval-and-compile
+
+(eval-and-compile
+ (defun glsl-ppre (re)
+ (format "\\<\\(%s\\)\\>" (regexp-opt re))))
+
+(defvar glsl-font-lock-keywords-1
+ (append
+ (list
+ (cons (eval-when-compile
+ (format "^[ \t]*#[ \t]*\\<\\(%s\\)\\>"
+ (regexp-opt glsl-preprocessor-directive-list)))
+ glsl-preprocessor-face)
+ (cons (eval-when-compile
+ (glsl-ppre glsl-type-list))
+ glsl-type-face)
+ (cons (eval-when-compile
+ (glsl-ppre glsl-deprecated-qualifier-list))
+ glsl-deprecated-keyword-face)
+ (cons (eval-when-compile
+ (glsl-ppre glsl-reserved-list))
+ glsl-reserved-keyword-face)
+ (cons (eval-when-compile
+ (glsl-ppre glsl-qualifier-list))
+ glsl-qualifier-face)
+ (cons (eval-when-compile
+ (glsl-ppre glsl-keyword-list))
+ glsl-keyword-face)
+ (cons (eval-when-compile
+ (glsl-ppre glsl-preprocessor-builtin-list))
+ glsl-keyword-face)
+ (cons (eval-when-compile
+ (glsl-ppre glsl-deprecated-builtin-list))
+ glsl-deprecated-builtin-face)
+ (cons (eval-when-compile
+ (glsl-ppre glsl-builtin-list))
+ glsl-builtin-face)
+ (cons (eval-when-compile
+ (glsl-ppre glsl-deprecated-variables-list))
+ glsl-deprecated-variable-name-face)
+ (cons "gl_[A-Z][A-Za-z_]+" glsl-variable-name-face)
+ )
+
+ (when glsl-additional-types
+ (list
+ (cons (glsl-ppre glsl-additional-types) glsl-type-face)))
+ (when glsl-additional-keywords
+ (list
+ (cons (glsl-ppre glsl-additional-keywords) glsl-keyword-face)))
+ (when glsl-additional-qualifiers
+ (list
+ (cons (glsl-ppre glsl-additional-qualifiers) glsl-qualifier-face)))
+ (when glsl-additional-built-ins
+ (list
+ (cons (glsl-ppre glsl-additional-built-ins) glsl-builtin-face)))
+ )
+ "Highlighting expressions for GLSL mode.")
+
+
+(defvar glsl-font-lock-keywords glsl-font-lock-keywords-1
+ "Default highlighting expressions for GLSL mode.")
+
+(defvar glsl-mode-syntax-table
+ (let ((glsl-mode-syntax-table (make-syntax-table)))
+ (modify-syntax-entry ?/ ". 124b" glsl-mode-syntax-table)
+ (modify-syntax-entry ?* ". 23" glsl-mode-syntax-table)
+ (modify-syntax-entry ?\n "> b" glsl-mode-syntax-table)
+ (modify-syntax-entry ?_ "w" glsl-mode-syntax-table)
+ glsl-mode-syntax-table)
+ "Syntax table for glsl-mode.")
+
+(defvar glsl-other-file-alist
+ '(("\\.frag$" (".vert"))
+ ("\\.vert$" (".frag"))
+ )
+ "Alist of extensions to find given the current file's extension.")
+
+(defun glsl-man-completion-list ()
+ "Return list of all GLSL keywords."
+ (append glsl-builtin-list glsl-deprecated-builtin-list))
+
+(defun glsl-find-man-page (thing)
+ "Collects and displays manual entry for GLSL built-in function THING."
+ (interactive
+ (let ((word (current-word nil t)))
+ (list
+ (completing-read
+ (concat "OpenGL.org GLSL man page: (" word "): ")
+ (glsl-man-completion-list)
+ nil nil nil nil word))))
+ (save-excursion
+ (apply glsl-browse-url-function
+ (list (concat glsl-man-pages-base-url thing ".xhtml")))))
+
+(easy-menu-define glsl-menu glsl-mode-map
+ "GLSL Menu"
+ `("GLSL"
+ ["Comment Out Region" comment-region
+ (c-fn-region-is-active-p)]
+ ["Uncomment Region" (comment-region (region-beginning)
+ (region-end) '(4))
+ (c-fn-region-is-active-p)]
+ ["Indent Expression" c-indent-exp
+ (memq (char-after) '(?\( ?\[ ?\{))]
+ ["Indent Line or Region" c-indent-line-or-region t]
+ ["Fill Comment Paragraph" c-fill-paragraph t]
+ "----"
+ ["Backward Statement" c-beginning-of-statement t]
+ ["Forward Statement" c-end-of-statement t]
+ "----"
+ ["Up Conditional" c-up-conditional t]
+ ["Backward Conditional" c-backward-conditional t]
+ ["Forward Conditional" c-forward-conditional t]
+ "----"
+ ["Backslashify" c-backslash-region (c-fn-region-is-active-p)]
+ "----"
+ ["Find GLSL Man Page" glsl-find-man-page t]
+ ))
+
+;;;###autoload
+(define-derived-mode glsl-mode prog-mode "GLSL"
+ "Major mode for editing GLSL shader files."
+ (c-initialize-cc-mode t)
+ (setq abbrev-mode t)
+ (c-init-language-vars-for 'c-mode)
+ (c-common-init 'c-mode)
+ (cc-imenu-init cc-imenu-c++-generic-expression)
+ (set (make-local-variable 'font-lock-defaults) '(glsl-font-lock-keywords))
+ (set (make-local-variable 'ff-other-file-alist) 'glsl-other-file-alist)
+ (set (make-local-variable 'comment-start) "// ")
+ (set (make-local-variable 'comment-end) "")
+ (set (make-local-variable 'comment-padding) "")
+ (easy-menu-add glsl-menu)
+ (add-to-list 'align-c++-modes 'glsl-mode)
+ (c-run-mode-hooks 'c-mode-common-hook)
+ (run-mode-hooks 'glsl-mode-hook)
+ :after-hook (progn (c-make-noise-macro-regexps)
+ (c-make-macro-with-semi-re)
+ (c-update-modeline))
+ )
+
+;;; glsl-mode.el ends here
diff --git a/emacs/.emacs.d/site-lisp/n3-mode.el b/emacs/.emacs.d/site-lisp/n3-mode.el
deleted file mode 100644
index 8beced6..0000000
--- a/emacs/.emacs.d/site-lisp/n3-mode.el
+++ /dev/null
@@ -1,44 +0,0 @@
-;;; n3-mode.el --- mode for Notation 3
-; $Id: n3-mode.el 4084 2007-12-15 17:10:13Z hugoh $
-
-;; Copyright (c) 2003-2007 Hugo Haas <hugo@larve.net>
-
-;; For documentation on Notation 3, see:
-;; http://www.w3.org/DesignIssues/Notation3.html
-
-;;; Comentary:
-
-;; Goals:
-;; - sytax highlighting
-;; - completion
-;; - indentation
-
-;; What it does now:
-;; - Syntax highlighting
-
-;;; Code:
-
-(require 'generic)
-
-(define-generic-mode 'n3-mode
- ;; comment char
- (list "# ")
- ;; keywords
- (list "this" "a")
- ;; additional font-lock'ing
- '(("\\(@prefix\\)\\>" 1 font-lock-keyword-face t)
- ("\\(\\S-*?:\\)" 1 font-lock-type-face t)
- (":\\(\\S-+?\\)\\>" 1 font-lock-constant-face t)
- ("\\(<.*?>\\)" 1 font-lock-function-name-face t)
- ("\\(\\\".*?\\\"\\)" 1 font-lock-string-face t)
-; Bug: some trailing characters are highlighted; restricting comments regexp
-; ("\\(#.*\\)" 1 font-lock-comment-face t)
- ("^\\s-*\\(#.*\\)" 1 font-lock-comment-face t)
- )
- ;; auto-mode
- (list "\\.n3$")
- ;; additional setup
- nil
- ;; description
- "Mode for Notation 3 documents."
- )
diff --git a/emacs/.emacs.d/site-lisp/ppindent.el b/emacs/.emacs.d/site-lisp/ppindent.el
deleted file mode 100644
index 84c9702..0000000
--- a/emacs/.emacs.d/site-lisp/ppindent.el
+++ /dev/null
@@ -1,138 +0,0 @@
-;;; ppindent.el --- Indents C preprocessor directives
-
-;; Copyright (C) 2007 Free Software Foundation, Inc.
-
-;; Author: Craig McDaniel <craigmcd@gmail.com>
-;; Keywords: languages, c
-;; Maintainer: Craig McDaniel <craigmcd@gmail.com>
-
-;; This file 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, or (at your option)
-;; any later version.
-
-;; This file 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 GNU Emacs; see the file COPYING. If not, write to
-;; the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-;; Boston, MA 02111-1307, USA.
-
-;;; Commentary:
-
-;; PPINDENT indents C-preprocessor statements depending on the current
-;; #if..., #el.., #endif level. It only modifies lines with "#" as the
-;; first non-blank character and therefore does not conflict with the
-;; normal C indentation. Unlike a true indent, it inserts the
-;; requisite number of spaces after, rather than before the "#"
-;; character. This type of preprocesor indent is commonly used to
-;; provide the most compatibility with different C-compilers.
-;;
-;; Example:
-
-;; #ifdef WOO
-;; ....
-;; #if defined(X) && !defined(Y)
-;; #ifdef Q8
-;; ...
-;; #else
-;; ...
-;; ....
-;; #elif defined (Z)
-;; ....
-;; #endif
-;; #endif
-;; #endif
-
-;; After "M-x ppindent-c" becomes:
-
-;; #ifdef WOO
-;; ....
-;; # if defined(X) && !defined(Y)
-;; # ifdef Q8
-;; ...
-;; # else
-;; ...
-;; ....
-;; # elif defined (Z)
-;; ....
-;; # endif
-;; # endif
-;; #endif
-
-;; Two functions are provided: PPINDENT-C indents as described
-;; above. PPINDENT-H does not indent the first level, assuming that
-;; .h/.hpp files use an #ifdef guard around the entire file.
-
-;; You can customize PPINDENT-INCREMENT if you want to use something
-;; other than 2 spaces for the indent.
-
-;;; History:
-
-;; 2007-01-19 WCM Initial version
-
-;;; Code:
-
-(provide 'ppindent)
-
-(defgroup pp-indent nil
- "Indent C preproccessor directives."
- :group 'c)
-
-(defcustom ppindent-increment 2
- "Number of spaces per indention level.
-
-Used in C pre-processor indent functions ppindent-c and ppindent-h"
- :type 'number
- :group 'pp-indent)
-
-(defun starts-withp (str prefix)
- "str starts with prefix"
- (eql (compare-strings prefix nil nil str nil (length prefix)) t))
-
-(defun my-make-string (length init)
- "just like make-string, but makes an empty string if length is negative"
- (when (minusp length)
- (setf length 0))
- (make-string length init))
-
-(defun ppindent-aux (start)
- (let ((cnt start))
- (goto-char (point-min))
- (while (re-search-forward "^[ \t]*#[ \t]*\\(.*\\)" nil t)
- (cond ((starts-withp (match-string-no-properties 1) "if")
- (replace-match (concat "#" (my-make-string cnt ?\s) "\\1"))
- (incf cnt ppindent-increment))
- ((starts-withp (match-string-no-properties 1) "el")
- (when (< (- cnt ppindent-increment) start)
- (throw 'err `(,(line-number-at-pos) "Unmatched #else or #elif")))
- (replace-match (concat "#" (my-make-string
- (- cnt ppindent-increment)
- ?\s) "\\1")))
- ((starts-withp (match-string-no-properties 1) "endif")
- (when (< (- cnt ppindent-increment) start)
- (throw 'err `(,(line-number-at-pos) "Unmatched #endif")))
- (decf cnt ppindent-increment)
- (replace-match (concat "#" (my-make-string cnt ?\s) "\\1")))
- (t
- (replace-match (concat "#" (my-make-string cnt ?\s) "\\1")))))))
-
-(defun ppindent-buffer (start)
- (let ((result (catch 'err (save-excursion (ppindent-aux start)))))
- (when result
- (goto-line (car result))
- (error "Error: %s" (cadr result)))))
-
-(defun ppindent-c ()
- "Indent all C pre-processor statements"
- (interactive)
- (ppindent-buffer 0))
-
-(defun ppindent-h ()
- "Indent C pre-processor statements, keeping first level #ifdef unindented"
- (interactive)
- (ppindent-buffer (- ppindent-increment)))
-
diff --git a/emacs/.emacs.d/site-lisp/ttl-mode.el b/emacs/.emacs.d/site-lisp/ttl-mode.el
deleted file mode 100644
index ee147de..0000000
--- a/emacs/.emacs.d/site-lisp/ttl-mode.el
+++ /dev/null
@@ -1,209 +0,0 @@
-;;; ttl-mode.el --- mode for Turtle(RDF)
-;; Based on n3-mode.el --- mode for Notation 3,
-;; at http://larve.net/people/hugo/2003/scratchpad/NotationThreeEmacsMode.html
-;; Also draws on http://dishevelled.net/elisp/turtle-mode.el (which is for the _other_ turtle!)
-
-;; Copyright (c) 2003-2007 Hugo Haas <hugo@larve.net>
-;; Extended 2011-2012, by Norman Gray <http://nxg.me.uk>
-;;
-;; See Hugo's commentary for original goals and further discussion.
-
-;; Project hosted at <https://bitbucket.org/nxg/ttl-mode>. See there for updates.
-
-;; To use:
-;;
-;; (autoload 'ttl-mode "ttl-mode" "Major mode for OWL or Turtle files" t)
-;; (add-hook 'ttl-mode-hook ; Turn on font lock when in ttl mode
-;; 'turn-on-font-lock)
-;; (setq auto-mode-alist
-;; (append
-;; (list
-;; '("\\.n3" . ttl-mode)
-;; '("\\.ttl" . ttl-mode))
-;; auto-mode-alist))
-
-;;; Code:
-
-(require 'generic)
-
-(define-generic-mode 'ttl
- ;; comment char
- (list "# ")
- ;; keywords
- (list "this" "a")
- ;; additional font-lock'ing
- '(("\\(@prefix\\)\\>" 1 font-lock-keyword-face t) ;keywords
- ("\\^\\^[^,;.]+" 0 font-lock-preprocessor-face t) ;literal types
- ("@[[:word:]_]+" 0 font-lock-preprocessor-face t) ;languages
- ("\\(\\S-*?:\\)" 1 font-lock-type-face nil) ;prefix
- (":\\([[:word:]_-]+\\)\\>" 1 font-lock-constant-face nil) ;suffix
- ("\\(<.*?>\\)" 1 font-lock-function-name-face t) ;resources
- ("\\(\\\".*?\\\"\\)" 1 font-lock-string-face t) ;strings
- ("\\(\\\"\\\"\\\".*?\\\"\\\"\\\"\\)" 1 font-lock-string-face t) ;doesn't work over newlines?
-; Bug: some trailing characters are highlighted; restricting comments regexp
-; ("\\(#.*\\)" 1 font-lock-comment-face t)
- ("^\\s-*\\(#.*\\)" 1 font-lock-comment-face t) ;comment
- )
- ;; auto-mode
- (list "\\.n3$" "\\.ttl")
- ;; additional setup
- nil
- ;; description
- "Mode for Turtle RDF documents."
- )
-
-(defun ttl-base ()
- (interactive)
- (generic-mode "ttl"))
-
-(defun ttl-indent-line ()
- (interactive)
- (indent-line-to
- (or (ignore-errors (ttl-calculate-indentation))
- 0)))
-
-(defun ttl-calculate-indentation ()
- (save-excursion
- (beginning-of-line) (skip-chars-forward "\t ")
- (cond ((ttl-in-string-p) 8)
- ((looking-at "$")
- ;; empty line -- use same indentation as previous line
- (save-excursion
- (forward-line -1)
- (skip-chars-forward "\t ")
- (current-column)))
- ((looking-at "@") 0) ;@prefix or @base
- ((looking-at "#") 0)
- ((looking-at "<");(looking-at "\\S-+\\s-*$")
- ;;only a single expression on the line -- a subject
- 0)
- ((save-excursion
- (forward-line -1)
- (end-of-line)
- (if (not (looking-back "\\["))
- nil
- (beginning-of-line)
- (skip-chars-forward "\t ")
- (+ (current-column) 4))))
- (t 4))))
-
-;; (defun turtle-indent-block ()
-;; (interactive)
-;; (indent-region (point)
-;; (save-excursion (forward-xxx) (point))))
-
-(defvar ttl-mode-map (make-sparse-keymap))
-(define-derived-mode ttl-mode ttl-base
- "Turtle RDF"
- (setq indent-tabs-mode t)
- (ttl-mode-variables)
-; (define-key ttl-mode-map (kbd "C-M-q")
-; 'turtle-indent-block)
- (define-key ttl-mode-map (kbd "\;") 'ttl-electric-semi)
- (define-key ttl-mode-map (kbd "\.") 'ttl-electric-dot)
- (define-key ttl-mode-map (kbd "RET") 'newline-and-indent)
- (define-key ttl-mode-map [backspace] 'ttl-hungry-delete-backwards)
- (use-local-map ttl-mode-map))
-
-(defcustom ttl-electric-semi-mode nil
- "*If non-nil, `\;' will self insert, reindent the line, and do a newline.
-If nil, just insert a `\;'. (To insert while t, do: \\[quoted-insert] \;)."
- :group 'ttl
- :type 'boolean)
-
-(defun beginning-of-stanza ()
- "Find the beginning of a stanza, indicated by non-whitespace at the beginning of a line."
- (re-search-backward "^\\S-" (point-min) t))
-
-(defun ttl-in-string-p ()
- "Is point inside a string or a long-string?"
- (save-excursion
- (let ((here (point))
- (in-p nil))
- (beginning-of-stanza)
- (condition-case nil
- (progn
- (while (<= (point) here)
- (if in-p
- (progn
- (search-forward in-p (point-max) nil)
- (setq in-p nil))
- (re-search-forward "\"\\(\"\"\\)?" (point-max) nil)
- (if (char-equal (char-before (- (point) 1)) ?\")
- (setq in-p "\"\"\"")
- (setq in-p "\""))))
- (not in-p))
- (search-failed ;reached EOF
- (if in-p ;this indicates that we're inside a string
- (message "Unbalanced quotes -- reached EOF inside string")
- nil))))))
-
-(defun *ttl-search-in-line-for-comment (limit)
- "Search for a comment character from the current position, before point LIMIT; changes current position. Return location of comment, or nil if none can be found"
- (let ((new-point (re-search-forward "[#<]" limit t)))
- (cond ((not new-point) nil)
- ((looking-back "#") new-point) ;found comment
- (t ;looking-back "<"
- (if (not (search-forward ">" limit t))
- nil ;starting point is within resource
- (*ttl-search-in-line-for-comment limit)))))) ;recurse
-
-(defun ttl-in-comment-p ()
- "Is point inside a comment?"
- (save-excursion
- (let ((here (point)))
- (beginning-of-line)
- (*ttl-search-in-line-for-comment here))))
-
-(defun ttl-in-resource-p ()
- "Is point within a resource, marked by <...>?"
- (save-excursion
- (and (re-search-backward "[<> ]" nil t)
- (looking-at "<"))))
-
-(defun ttl-skip-ws-backwards () ;adapted from cc-mode
- "Move backwards across whitespace."
- (while (progn
- (skip-chars-backward " \t\n\r\f\v")
- (and (eolp)
- (eq (char-before) ?\\)))
- (backward-char)))
-
-(defun ttl-hungry-delete-backwards ()
- "Delete backwards, either all of the preceding whitespace,
-or a single non-whitespace character if there is no whitespace before point."
- (interactive)
- (let ((here (point)))
- (ttl-skip-ws-backwards)
- (if (/= (point) here)
- (delete-region (point) here)
- (backward-delete-char-untabify 1))))
-
-(defun ttl-insulate ()
- "Return true if this location should not be electrified"
- (or (ttl-in-string-p)
- (ttl-in-comment-p)
- (ttl-in-resource-p)))
-
-(defun ttl-electric-semi ()
- "Insert a \;.
-If variable `ttl-electric-semi-mode' is t, indent the current line, insert
-a newline, and indent."
- (interactive)
- (insert "\;")
- (if (and ttl-electric-semi-mode
- (not (ttl-insulate)))
- (reindent-then-newline-and-indent)))
-
-(defun ttl-electric-dot ()
- "Insert a \..
-If variable `ttl-electric-semi-mode' is t, indent the current line, insert
-a newline, and indent."
- (interactive)
- (insert "\.")
- (if (and ttl-electric-semi-mode
- (not (ttl-insulate)))
- (reindent-then-newline-and-indent)))
-
-(defun ttl-mode-variables ()
- (set (make-local-variable 'indent-line-function) 'ttl-indent-line))
diff --git a/emacs/.emacs.d/site-lisp/turtle-mode b/emacs/.emacs.d/site-lisp/turtle-mode
new file mode 160000
+Subproject 8eb2ec3fee0a28f3716371c930b04be9cd63981