 ;;   :config
 ;;   (csetq alert-default-style 'osx-notifier))
 
-(defun ar/java-mode-hook-function ()
-  "Called when entering `java-mode'."
-  (bind-key [f6] java-mode-map)
-  ;; 2-char indent for java.
-  (defvar c-basic-offset)
-  (validate-setq c-basic-offset 2)
-  (set-fill-column 100))
-
-(add-hook 'java-mode-hook #'ar/java-mode-hook-function)
+(use-package cc-mode
+  :init
+  (defun ar/java-mode-hook-function ()
+    "Called when entering `java-mode'."
+    ;; 2-char indent for java.
+    (defvar c-basic-offset)
+    (validate-setq c-basic-offset 2)
+    (set-fill-column 100))
+  :hook (java-mode . ar/java-mode-hook-function))
 
 (use-package immortal-scratch :ensure t
   :config


;; Work in progress.
(use-package web-mode :ensure t
  :config
  (validate-setq web-mode-code-indent-offset 2)
  (defadvice web-mode-highlight-part (around tweak-jsx activate)
    (if (equal web-mode-content-type "jsx")
        (let ((web-mode-enable-part-face nil))
          ad-do-it)
      ad-do-it))
  (add-hook #'web-mode-hook #'ar/web-mode-hook-function))

(defun ar/tern-delete-process ()
  "Delete tern.jsp process."

;; More expected region behaviour.
(transient-mark-mode t)

(use-package executable
  ;;  Make a shell script executable automatically on save.
  ;;  From https://github.com/bbatsov/prelude
  :hook (after-save . executable-make-buffer-file-executable-if-script-p))

;;  Automatically indent yanked code
;;  From http://www.emacswiki.org/emacs/AutoIndentation#toc3
