 (when (fboundp 'menu-bar-mode) (menu-bar-mode -1))
 (when (fboundp 'tool-bar-mode) (tool-bar-mode -1))
 (when (fboundp 'toggle-scroll-bar) (toggle-scroll-bar -1))
+
+;; https://oremacs.com/2015/01/17/setting-up-ediff
+;; Macro  for setting custom variables.
+;; Similar to custom-set-variables, but more like setq.
+(defmacro csetq (variable value)
+  `(funcall (or (get ',variable 'custom-set)
+                'set-default)
+            ',variable ,value))
 
 ;; Get rid of splash screens.
 ;; From http://www.emacswiki.org/emacs/EmacsNiftyTricks

;; If eclim is your cup of tea.
;; (require 'eclim)
;; (global-eclim-mode)
;; (custom-set-variables
;;  '(eclim-eclipse-dirs '("~/tools/eclipse"))
;;  '(eclim-executable "~/tools/eclipse/eclim"))
;; (require 'eclimd)
;; (require 'company-emacs-eclim)
;; (company-emacs-eclim-setup)


(use-package ediff
  :config
  (csetq ediff-window-setup-function #'ediff-setup-windows-plain)
  (csetq ediff-split-window-function #'split-window-horizontally)

  ;; Automatically highlight first change.
  (add-hook 'ediff-startup-hook 'ediff-next-difference)

  ;; Expand org files when ediffing.
  (add-hook 'ediff-prepare-buffer-hook
            (lambda ()
              (when (eq major-mode 'org-mode)
                (visible-mode 1)  ; default 0
                (setq-local truncate-lines nil)  ; no `org-startup-truncated' in hook
                (setq-local org-hide-leading-stars t)))))

;; ediff-revision cleanup.
;; From http://www.emacswiki.org/emacs/DavidBoon#toc8
