 ;; Display line numbers.
 (use-package linum
   :ensure t)
-(global-linum-mode)
 
 ;; Right-justify linum
 ;; From https://github.com/echosa/emacs.d#line-numbers

(setq shell-pop-window-position "bottom")
;; Do not auto cd to working directory.
(setq shell-pop-autocd-to-working-dir nil)

(defun ar/disable-non-prog-minor-modes ()
  "Disable non-programming minor modes, likely slowing things down."
  (centered-cursor-mode -1)
  (linum-mode -1))

;;  No need for linum under ansi-term, also avoids flickering.
(add-hook 'term-mode-hook #'ar/disable-non-prog-minor-modes)
(add-hook 'magit-mode-hook #'ar/disable-non-prog-minor-modes)

(global-set-key [f5] 'shell-pop)
(use-package shell-pop

  "Write the desktop save file to ~/.emacs.d."
  (desktop-save (expand-file-name "~/.emacs.d/")))

;; Is this what's locking things up?
;; (run-with-idle-timer 300 t 'ar/desktop-save)

(defun ar/load-all-files (pattern)
  "Load all files found by PATTERN, ie. (ar/load-all-files '~/*.el')."
