 (use-package elixir-mode :pin melpa)
 ;; (use-package elixir-mix :pin melpa)
 (use-package flycheck-elixir :pin melpa)
-(use-package flycheck-rust :pin melpa)
+
+(use-package flycheck-rust :pin melpa
+  :config (add-hook 'flycheck-mode-hook #'flycheck-rust-setup))
+
+(use-package gnuplot :pin melpa)
 
 (use-package flycheck-gradle :pin melpa
   :ensure t

(use-package org-tree-slide :pin melpa :ensure t)
(use-package verb :pin melpa :ensure t)

(use-package org-bullets
  :config
  (add-hook 'org-mode-hook (lambda () (org-bullets-mode 1))))


;; (add-hook 'server-after-make-frame-hook '((let* ((variable-tuple (cond ((x-list-fonts "Source Sans Pro") '(:font "Source Sans Pro"))
;;                                                                        ((x-list-fonts "Lucida Grande")   '(:font "Lucida Grande"))
;;                                                                        ((x-list-fonts "Verdana")         '(:font "Verdana"))
;;                                                                        ((x-family-fonts "Sans Serif")    '(:family "Sans Serif"))
;;                                                                        (nil (warn "Cannot find a Sans Serif Font.  Install Source Sans Pro."))))
;;                                                  (base-font-color     (face-foreground 'default nil 'default))
;;                                                  (headline           `(:inherit default :weight bold :foreground ,base-font-color)))
;;                                             (custom-theme-set-faces 'user
;;                                                                     `(org-level-8 ((t (,@headline ,@variable-tuple))))
;;                                                                     `(org-level-7 ((t (,@headline ,@variable-tuple))))
;;                                                                     `(org-level-6 ((t (,@headline ,@variable-tuple))))
;;                                                                     `(org-level-5 ((t (,@headline ,@variable-tuple))))
;;                                                                     `(org-level-4 ((t (,@headline ,@variable-tuple :height 1.1))))
;;                                                                     `(org-level-3 ((t (,@headline ,@variable-tuple :height 1.25))))
;;                                                                     `(org-level-2 ((t (,@headline ,@variable-tuple :height 1.5))))
;;                                                                     `(org-level-1 ((t (,@headline ,@variable-tuple :height 1.75))))
;;                                                                     `(org-document-title ((t (,@headline ,@variable-tuple :height 1.5 :underline nil))))))))

(use-package doct :ensure t :commands (doct))

(use-package gitlab-ci-mode :pin melpa :ensure t)
(use-package gitlab-ci-mode-flycheck :pin melpa :ensure t)

(use-package orgit :ensure t :pin melpa)

;; (setq org-export-latex-listings 'minted)
;; (add-to-list 'org-export-latex-packages-alist '("" "minted"))

(defun org-blog-prepare (project-plist)
  "With help from `https://github.com/howardabrams/dot-files'.
  Touch `index.org' to rebuilt it.
  Argument `PROJECT-PLIST' contains information about the current project."
  (let* ((base-directory (plist-get project-plist :base-directory))
         (buffer (find-file-noselect (expand-file-name "index.org" base-directory) t)))
    (with-current-buffer buffer
      (set-buffer-modified-p t)
      (save-buffer 0))
    (kill-buffer buffer)))

(defun org-blog-sitemap-format-entry (entry _style project)
  "Return string for each ENTRY in PROJECT."
  (when (s-starts-with-p "posts/" entry)
    (format "@@html:<span class=\"archive-item\"><span class=\"archive-date\">@@ %s @@html:</span>@@ [[file:%s][%s]] @@html:</span>@@"
            (format-time-string "%h %d, %Y" (org-publish-find-date entry project))
            entry
            (org-publish-find-title entry project))))


(defun org-blog-sitemap-function (title list)
  "Return sitemap using TITLE and LIST returned by `org-blog-sitemap-format-entry'."
  (concat "#+TITLE: " title "\n\n"
          "\n#+begin_archive\n"
          (mapconcat (lambda (li)
                       (format "@@html:<li>@@ %s @@html:</li>@@" (car li)))
                     (seq-filter #'car (cdr list))
                     "\n")
          "\n#+end_archive\n"))

(setenv "LC_ALL" "en_US.UTF-8")
(prefer-coding-system 'utf-8)
(set-language-environment "UTF-8")
(setenv "GO111MODULE" "on")

;; end envs setup
