 (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


(use-package ediff
  :config
  (validate-setq ediff-window-setup-function #'ediff-setup-windows-plain)
  (validate-setq ediff-split-window-function #'split-window-horizontally)
  ;; Expand org files when ediffing.
  (add-hook 'ediff-prepare-buffer-hook
            (lambda ()
              (eq major-mode 'org-mode)
              (visible-mode 1)  ; default 0
              (validate-setq truncate-lines nil)  ; no `org-startup-truncated' in hook
              (validate-setq org-hide-leading-stars t))))

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

        (shell-pop-out)
      (shell-pop-up shell-pop-last-shell-buffer-index)))

  (csetq shell-pop-window-position "full")
  (csetq shell-pop-shell-type '("eshell" "*eshell*" (lambda () (eshell shell-pop-term-shell))))

  (validate-setq shell-pop-shell-type '("eshell" "*eshell*" (lambda () (eshell))))

