Last active
August 29, 2015 13:57
-
-
Save afeinberg/9879927 to your computer and use it in GitHub Desktop.
Revisions
-
afeinberg revised this gist
Apr 1, 2014 . 1 changed file with 2 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,3 +1,5 @@ ;; based on something I found online, but no longer have original link to. (defvar *per-dir-hook-alist* '(("/home/alex/dev/project" project-c-mode-hook))) -
afeinberg revised this gist
Apr 1, 2014 . 1 changed file with 10 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -2,6 +2,16 @@ '(("/home/alex/dev/project" project-c-mode-hook))) (defun af-directory-based-c-hook () (make-local-variable 'c-recognize-knr-p) (make-local-variable 'c-enable-xemacs-performance-kludge-p) (make-local-variable 'c-comment-only-line-offset) (make-local-variable 'c-hanging-braces-alist) (make-local-variable 'c-hanging-colons-alist) (make-local-variable 'c-hanging-semi&comma-criteria) (make-local-variable 'c-indent-comments-syntactically-p) (make-local-variable 'comment-column) (make-local-variable 'c-indent-comment-alist) (make-local-variable 'c-cleanup-list) (make-local-variable 'tab-width) (make-local-variable 'indent-tabs-mode) (make-local-variable 'fill-column) -
afeinberg renamed this gist
Mar 30, 2014 . 1 changed file with 0 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,4 +1,3 @@ (defvar *per-dir-hook-alist* '(("/home/alex/dev/project" project-c-mode-hook))) -
afeinberg created this gist
Mar 30, 2014 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,38 @@ (defvar *per-dir-hook-alist* '(("/home/alex/dev/project" project-c-mode-hook))) (defun af-directory-based-c-hook () (make-local-variable 'tab-width) (make-local-variable 'indent-tabs-mode) (make-local-variable 'fill-column) (make-local-variable 'tab-width) (make-local-variable 'c-tab-always-indent) (make-local-variable 'c-auto-hungry-initial-state) (make-local-variable 'c-default-style) (make-local-variable 'c-indent-level) (make-local-variable 'c-auto-hungry-initial-state) (make-local-variable 'c-block-comment-prefix) (make-local-variable 'c-basic-offset) (make-local-variable 'c-offsets-alist) (make-local-variable 'c-tab-always-indent) (make-local-variable 'fill-column) (dolist (dir-mode-pair *per-dir-hook-alist*) (let ((dir-name (concat (first dir-mode-pair) ".*")) (mode-is (car (last dir-mode-pair))) (match-dir-based (string-match (concat (first dir-mode-pair) ".*") (buffer-file-name)))) (if (and (numberp match-dir-based) (>= match-dir-based 0)) (funcall mode-is)))) (message ">>> done af-directory-based-c-hook...")) (add-to-list 'auto-mode-alist '("/home/alex/dev/project/src/.*\\.h$" . c++-mode)) (defun project-c-mode-hook () (google-set-c-style) (google-make-newline-indent) (message ">>> done project-c-mode-hook")) (add-hook 'c++-mode-hook 'af-directory-based-c-hook)