   :ensure t
   :config
   ;; run markdown-mode on files ending in .md
-  (set 'auto-mode-alist
-       (append auto-mode-alist '((".md" . markdown-mode)
-                                 (".markdown" . markdown-mode))))
+  (validate-setq auto-mode-alist
+                 (append auto-mode-alist '((".md" . markdown-mode)
+                                           (".markdown" . markdown-mode))))
   (defun markdown-mode-keys ()
     (interactive)
 

;; ===============================================================

;; Save into a helpfully named file
(set 'savehist-file "~/.emacs.d/savehist")

;; Save other things as well
(set 'savehist-additional-variables '(kill-ring
                                      search-ring
                                      regexp-search-ring
                                      compile-command
                                      compilation-directory))

;; Enable save history (must be done after changing any variables).
(savehist-mode 1)

;; Long history for everything
(set 'history-length (* 10 1000)) ;; default value for histories without
;; their own variable
(set 'kill-ring-max (* 10 1000))
(set 'search-ring-max (* 10 1000))
(set 'regexp-search-ring-max (* 10 1000))
(set 'history-delete-duplicates t)


;; Compile mode settings



;; Don't indent string blocks
(define-minor-mode suppress-multiline-string-indent-mode
  "Prevent indent commands from indenting multiline strings"

  (defun ds/line-in-string-block? (&rest args)
    "Does this line either end or start as a string?"
    (save-excursion
      (or (progn (beginning-of-line) (nth 3 (syntax-ppss)))
          (progn (end-of-line) (nth 3 (syntax-ppss))))))

  (let ((indent-functions (list #'indent-for-tab-command
                                #'indent-region
                                #'indent-according-to-mode)))
    (if suppress-multiline-string-indent-mode
        (-each indent-functions (lambda (f) (advice-add f :before-until #'ds/line-in-string-block?)))
      (-each indent-functions (lambda (f) (advice-remove f #'ds/line-in-string-block?))))))

(add-hook 'c++-mode-hook #'suppress-multiline-string-indent-mode)
(add-hook 'js-mode-hook #'suppress-multiline-string-indent-mode)
(add-hook 'typescript-mode-hook #'suppress-multiline-string-indent-mode)


(use-package crux
