 
 ;; Ensure ELPA org is prioritized above built-in org.
 (when-let (path (locate-library "org" nil doom--package-load-path))
-  (push (file-name-directory path) load-path))
+  (cl-pushnew (file-name-directory path) load-path))
 
 (load! +agenda)
 (load! +attach)

                                              'default)
                                          :background nil t)))

  ;; Use ivy/helm if either is available
  (when (or (featurep! :completion ivy)
            (featurep! :completion helm))
    (setq-default org-completion-use-ido nil
                  org-outline-path-complete-in-steps nil))

  (let ((ext-regexp (regexp-opt '("GIF" "JPG" "JPEG" "SVG" "TIF" "TIFF" "BMP" "XPM"
                                  "gif" "jpg" "jpeg" "svg" "tif" "tiff" "bmp" "xpm"))))
    (setq iimage-mode-image-regex-alist
          `((,(concat "\\(`?file://\\|\\[\\[\\|<\\|`\\)?\\([-+./_0-9a-zA-Z]+\\."
                      ext-regexp "\\)\\(\\]\\]\\|>\\|'\\)?") . 2)
            (,(concat "<\\(http://.+\\." ext-regexp "\\)>") . 1))))



  ;;; Custom fontification
  (defun +org--tag-face (n)
    (let ((kwd (match-string n)))
      (or (and (equal kwd "#") 'org-tag)
          (and (equal kwd "@") 'org-special-keyword))))

                 ("\\s-\\(\\([#@]\\)[^ \n]+\\)" 1 (+org--tag-face 2)))))))
  (add-hook 'org-font-lock-set-keywords-hook #'+org|adjust-faces)

  ;; The standard unicode characters are usually misaligned depending on the
  ;; font. This bugs me. Personally, markdown #-marks for headlines are more
  ;; elegant, so we use those.
  (def-package! org-bullets
    :commands org-bullets-mode
    :init (add-hook 'org-mode-hook #'org-bullets-mode)
    :config (setq org-bullets-bullet-list '("#"))))

(defun +org|init-keybinds ()
  "Initialize my `org-mode' keybindings."
  (map! (:map org-mode-map
          "RET" #'org-return-indent
          "C-j" nil
