diff options
| author | Joel Klinghed <the_jk@opera.com> | 2017-09-21 16:15:16 +0200 |
|---|---|---|
| committer | Joel Klinghed <the_jk@opera.com> | 2017-09-21 16:15:16 +0200 |
| commit | 9f60ebc23f04c409d89a379b69cf0b5116310aa4 (patch) | |
| tree | 29227ead0ecbee5c870e652996eeceaf49ece999 /emacs-stark | |
| parent | 6a742f3fcff1387105e98c23d63788275492d0c2 (diff) | |
Merge some fixes between the emacs files
Diffstat (limited to 'emacs-stark')
| -rw-r--r-- | emacs-stark | 70 |
1 files changed, 34 insertions, 36 deletions
diff --git a/emacs-stark b/emacs-stark index c2a47b9..37d1709 100644 --- a/emacs-stark +++ b/emacs-stark @@ -247,35 +247,6 @@ '("common c" (c-basic-offset . 2))) -(add-hook 'c++-mode-hook - (lambda() - (make-local-variable 'flycheck-clang-language-standard) - (setq flycheck-clang-language-standard "c++11") - (c-set-style "default c++"))) - -;; Opera Java hook -(add-hook 'java-mode-hook - (lambda() - (when (and buffer-file-name - (string-match "/opera/head" buffer-file-name)) - (require 'flycheck-android-experimental) - (setq flycheck-android-java-checkstyle-jar - "../../chromium/src/third_party/checkstyle/checkstyle-6.5-all.jar" - flycheck-android-java-checkstyle-path - "tools/checkstyle" - flycheck-android-java-checkstyle-config - "checkstyle-config-android.xml" - flycheck-android-java-checkstyle-properties - "checkstyle.properties") - (require 'google-c-style) - (google-set-c-style) - (setq c-file-style "Google") - (c-set-offset 'arglist-intro '++) - (c-set-offset 'arglist-cont nil) - (c-set-offset 'arglist-cont-nonempty '++) - (setq indent-tabs-mode nil) - (setq c-basic-offset 4)))) - (defun get-base-dir (path needle) "Get base directory for PATH using NEEDLE to cut." (let ((parts (split-string path "/" t))) @@ -284,14 +255,20 @@ (concat "/" (mapconcat 'identity (seq-take parts (+ index 1)) "/")) path)))) -;; Chromium hook +(make-variable-buffer-local 'flycheck-clang-definitions) +(make-variable-buffer-local 'flycheck-clang-include-path) +(make-variable-buffer-local 'flycheck-clang-language-standard) + (add-hook 'c++-mode-hook (lambda() + (make-local-variable 'flycheck-clang-language-standard) + (setq flycheck-clang-language-standard "c++11") + (c-set-style "default c++") + ;; Chromium hook (when (and buffer-file-name (string-match "/chromium/src/" buffer-file-name)) (let ((base (get-base-dir (file-name-directory buffer-file-name) "src"))) (make-local-variable 'flycheck-clang-language-standard) - (make-local-variable 'flycheck-clang-definitions) (make-local-variable 'flycheck-clang-include-path) (setq flycheck-clang-language-standard "c++11" flycheck-clang-definitions (list "OS_ANDROID") @@ -299,11 +276,8 @@ (concat base "/out_wam_armv7/Debug/gen") (concat base "/out_wam_armv7/Release/gen")))) (require 'google-c-style) - (c-add-style "Google" google-c-style t)))) - -;; ofa hook -(add-hook 'c++-mode-hook - (lambda() + (c-add-style "Google" google-c-style t)) + ;; ofa hook (when (and buffer-file-name (string-match "/mobile/mobile/" buffer-file-name)) (let ((base (get-base-dir (file-name-directory buffer-file-name) "mobile"))) @@ -318,3 +292,27 @@ (require 'google-c-style) (c-add-style "Google" google-c-style t)))) +;; Opera Java hook +(add-hook 'java-mode-hook + (lambda() + (when (and buffer-file-name + (string-match "/opera/head" buffer-file-name)) + (require 'flycheck-android-experimental) + (setq flycheck-android-java-checkstyle-jar + "../../chromium/src/third_party/checkstyle/checkstyle-6.5-all.jar" + flycheck-android-java-checkstyle-path + "tools/checkstyle" + flycheck-android-java-checkstyle-config + "checkstyle-config-android.xml" + flycheck-android-java-checkstyle-properties + "checkstyle.properties") + (require 'google-c-style) + (google-set-c-style) + (setq c-file-style "Google") + (c-set-offset 'arglist-intro '++) + (c-set-offset 'arglist-cont nil) + (c-set-offset 'arglist-cont-nonempty '++) + (setq indent-tabs-mode nil) + (setq c-basic-offset 4)))) + +;;; |
