 ;;;; Dired (directory listing)
 
 (use-package dired+
-  ;;  Redo/undo system for Emacs
+  ;; Better directory browser
   :ensure nil
   :quelpa ((dired+ :fetcher url
 		   :url "https://raw.githubusercontent.com/emacsmirror/dired-plus/master/dired+.el"))

;; Turn off (by default) function signatures popping up in minibuffer
(add-hook 'emacs-lisp-mode-hook
	  (lambda ()
	    (eldoc-mode 0)))

;;; ..:: LaTeX ::..


  (flycheck-error-list-highlight-errors 'preserve-pos))
(advice-add 'flycheck-jump-in-buffer :around #'danylo/flycheck-jump-in-buffer)

;;;; >> Spell checking <<

(use-package speck
  ;; Minor mode for spell checking
  :ensure nil
  :quelpa ((speck :fetcher url
		  :url "https://raw.githubusercontent.com/emacsmirror/emacswiki.org/master/speck.el"))
  :bind (:map speck-mode-map
	      ("C-c s w" . speck-popup-menu-at-point)
	      ("C-c s r" . speck-replace-next)
	      ("C-c s a" . speck-add-next))
  :init
  (add-hook 'speck-mode-hook
	    (lambda () (set-face-attribute 'speck-mouse nil
					   :background `,danylo/faded))))

(defun danylo/toggle-spellcheck ()
  "Turn on spell checking."
  (interactive)
  (if (bound-and-true-p speck-mode)
      ;; Turn off spellcheck
      (progn (flycheck-mode -1)
	     (speck-mode -1))
    ;; Turn on spellcheck
    (speck-mode +1)))

(general-define-key
 "C-c s s" 'danylo/toggle-spellcheck)

;;; ..:: Completion ::..

