 (use-package cl-lib)
 (use-package subr-x)
 
-(use-package warnings
-  :config (cl-pushnew '(undo discard-info) warning-suppress-types
-                      :test #'equal))
-
 (set-default-coding-systems 'utf-8)
 (prefer-coding-system 'utf-8)
 (set-terminal-coding-system 'utf-8)

              diary-show-holidays-flag t
              calendar-view-holidays-initially-flag nil))

(setq-default font-lock-maximum-decoration '((t . t)))
(setq-default savehist-file (expand-file-name "savehist" emacs-d))

(setq tramp-save-ad-hoc-proxies t)

(use-package re-builder
  :commands (re-builder)
  :init (setq reb-re-syntax 'string))

(setq lisp-indent-function #'lisp-indent-function)

(setq custom-theme-directory (expand-file-name "themes/" emacs-d))

;; https://florian.adamsky.it/2016/03/31/emacs-calc-for-programmers-and-cs.html
(setq math-additional-units
      '((bit nil "Bit")
        (byte "8 * bit" "Byte")
        (bps "bit / s" "Bit per second"))
      math-units-table nil)

(setq default-input-method "TeX")

(setq browse-url-browser-function 'browse-url-generic
      browse-url-generic-program "firefox")


;; * Fixes

(with-eval-after-load 'enriched
  (defun enriched-decode-display-prop (start end &optional params)
    (ignore params)
    (list start end)))


;; * Basic Builtin Packages

(use-package misc
  :commands (zap-up-to-char zap-to-char))

(use-package grep
  :commands (rgrep zrgrep)
  :bind (:map grep-mode-map
              ("C-x C-q" . wgrep-change-to-wgrep-mode)
              ("C-c C-c" . wgrep-finish-edit)))

(use-package winner
  :commands (winner-mode winner-undo winner-redo))

(use-package abbrev
  :init (progn
          (setq save-abbrevs 'silently))
  :diminish abbrev-mode)

(use-package appt
  :commands (appt-activate)
  :init (setq appt-display-mode-line nil))

(use-package ediff
  :init (setq ediff-diff-options "-w"
              ediff-window-setup-function 'ediff-setup-windows-plain
              ediff-split-window-function 'split-window-horizontally
              ediff-show-clashes-only t)
  :config (progn
            (add-hook 'ediff-keymap-setup-hook
                      '(lambda ()
                        (bind-key "j" #'ediff-next-difference ediff-mode-map)
                        (bind-key "k" #'ediff-previous-difference ediff-mode-map)))

            (add-hook 'ediff-after-quit-hook-internal 'winner-undo)))

(use-package imenu
  :init (setq imenu-use-markers t
              imenu-auto-rescan t
              imenu-auto-rescan-maxout 600000
              imenu-max-item-length 100
              imenu-use-popup-menu nil
              imenu-eager-completion-buffer t))

(use-package ispell
  :commands (ispell-change-directory))

(use-package mailcap
  :config (progn
            ;; Remove doc-view so pdf will open with default viewer
            (setcdr
             (assoc "application" mailcap-mime-data)
             (remove '("pdf"
                       (viewer . doc-view-mode)
                       (type . "application/pdf")
                       (test eq window-system 'x))
                     (cdr (assoc "application" mailcap-mime-data))))))

(use-package quail
  :config (add-hook 'input-method-activate-hook
                    #'db/add-symbols-to-TeX-input-method))

(use-package isearch
  :init (setq isearch-allow-scroll t))

(use-package server
  :commands (server-running-p server-start)
  :init (setq server-log t))

(use-package bookmark
  :init (setq bookmark-default-file (expand-file-name "private/bookmarks"
                                                      emacs-d)))




;; * General Programming

(use-package ediff
  :init (setq ediff-diff-options "-w"
              ediff-window-setup-function 'ediff-setup-windows-plain
              ediff-split-window-function 'split-window-horizontally
              ediff-show-clashes-only t)
  :config (progn
            (add-hook 'ediff-keymap-setup-hook
                      '(lambda ()
                        (bind-key "j" #'ediff-next-difference ediff-mode-map)
                        (bind-key "k" #'ediff-previous-difference ediff-mode-map)))

            (add-hook 'ediff-after-quit-hook-internal 'winner-undo)))

(use-package git-commit
  :commands (global-git-commit-mode)
  :init (setq git-commit-style-convention-checks '(non-empty-second-line
