 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;;;; Dired
 
-;; Make C-x C-j jump to the current file in Dired. This binding is
-;; provided automatically by dired-x.el, which is automatically loaded
-;; by Helm. But if Helm is not enabled, then we have to bind the key
-;; manually. For some reason, the autoload for `dired-jump' does not
-;; appear to work correctly, so we have to autoload the functions
-;; explicitly.
-(when (radian-package-disabled-p 'helm)
-  (autoload 'dired-jump "dired-x")
-  (autoload 'dired-jump-other-window "dired-x")
-  (global-set-key (kbd "C-x C-j") #'dired-jump)
-  (global-set-key (kbd "C-x 4 C-j") #'dired-jump-other-window))
+;; Make C-x C-j jump to the current file in Dired. For some reason,
+;; the autoload for `dired-jump' does not appear to work correctly, so
+;; we have to autoload the functions explicitly.
+
+(autoload 'dired-jump "dired-x")
+(autoload 'dired-jump-other-window "dired-x")
+(global-set-key (kbd "C-x C-j") #'dired-jump)
+(global-set-key (kbd "C-x 4 C-j") #'dired-jump-other-window)
 
 ;; Suppress the 'ls does not support --dired' warning. Doing this instead
 ;; of installing a dired-compatibile ls is much easier, although it may

  :bind (;; Use smex for M-x.
         ("M-x" . smex)))

;; Provides a general-purpose completion and narrowing mechanism, and
;; enhanced versions of many standard Emacs commands that use it.
(use-package helm
  :demand t
  :config

  ;; Use Helm mode for many standard Emacs commands.
  (helm-mode 1)

  ;; Fix the unreadable default color for the prefix argument in the
  ;; Helm M-x buffer.
  (when radian-customize-tweak-colors
    (set-face-foreground 'helm-prefarg "#FFFF66"))

  ;; Use fuzzy matching for Helm.
  (setq helm-mode-fuzzy-match t)

  ;; Get rid of the awful background color for buffers corresponding to files
  ;; modified outside of Emacs.
  (when radian-customize-tweak-colors
    (set-face-background 'helm-buffer-saved-out nil))

  :bind (;; Use Helm mode for M-x.
         ("M-x" . helm-M-x))
  ;; Note that Helm has `helm-mode-line-string', but this only affects
  ;; what is shown in the mode line for a Helm buffer.
  :diminish helm-mode)

;; Provides enhanced versions of the Projectile commands that use
;; Helm.
(use-package helm-projectile
  :dependencies (helm)
  :demand t
  :config

  ;; Use Helm mode for Projectile commands. Using helm-projectile-toggle
  ;; instead of helm-projectile-on means we don't get a useless "Turn on
  ;; helm-projectile key bindings" message in the minibuffer during startup.
  ;;
  ;; The local binding of ad-redefinition works around a warning message
  ;; "ad-handle-definition: `tramp-read-passwd' got redefined", as per [1].
  ;;
  ;; [1]: https://github.com/emacs-helm/helm/issues/1498#issuecomment-218249480
  (let ((ad-redefinition-action 'accept))
    (helm-projectile-toggle 1)))

;; Provides an enhanced version of smex that uses Helm for completion.
(use-package helm-smex
  :dependencies (helm smex)
  :bind (;; Use helm-smex for M-x.
         ("M-x" . helm-smex)))

;; Provides intelligent fuzzy matching and sorting mechanisms that
;; can be used by various other packages, including Ivy.
(use-package flx)

(defvar radian-customize-tweak-colors nil)
(setq radian-customize-tweak-colors t)

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;; Optimization

