-;; Time-stamp: <2015-06-24 08:59:54 kmodi>
+;; Time-stamp: <2015-07-06 10:25:21 kmodi>
 
 ;; Highlight stuff
 
 (global-hi-lock-mode 1)
 
 ;; Highlight Anything
+;; https://github.com/boyw165/hl-anything
 (use-package hl-anything
   :if (not (bound-and-true-p disable-pkg-hl-anything))
   ;; This package has known to cause issues with the `list-colors-display'

  (progn
    (hl-highlight-mode 1)

    (defun my/hl-anything (&optional arg)
      "Wrapper function to call functions to highlight the thing at point either
globally or locally (when called with prefix `C-u')."
      (interactive "p")
      (if (eq arg 4)
          (hl-highlight-thingatpt-local)
        (hl-highlight-thingatpt-global)))

    (defun my/unhl-anything (&optional arg)
      "Wrapper function to call functions to unhighlight all either
globally or locally (when called with prefix `C-u')."
      (interactive "p")
      (if (eq arg 4)
          (hl-unhighlight-all-local)
        (hl-unhighlight-all-global)))

    (defhydra hydra-hl-anything (:color red)
      "hl-anything"
      ("h" my/hl-anything             "hl-global")
      ("H" (my/hl-anything 4)         "hl-local")
      ("u" my/unhl-anything           "unhl-global" :color blue)
      ("U" (my/unhl-anything 4)       "unhl-local" :color blue)
      ("n" hl-find-next-thing         "next")
      ("p" hl-find-prev-thing         "prev")
      ("s" hl-save-highlights         "save" :color blue)
      ("r" hl-restore-highlights      "restore" :color blue)
      ("t" hl-global-highlight-on/off "toggle")
      ("q" nil                        "cancel" :color blue))
    (bind-to-modi-map "h" #'hydra-hl-anything/body)))

;; Alternative highlighting package when `hl-anything' has issues
(when (not (featurep 'hl-anything))
  (use-package highlight-global
    :load-path "elisp/highlight-global"
    :config
    (progn
      (bind-to-modi-map "h" #'highlight-frame-toggle)
      (bind-to-modi-map "H" #'clear-highlight-frame))))

;; Volatile Highlights
;; https://github.com/k-talo/volatile-highlights.el

      ("<C-kp-multiply>" . auto-highlight-symbol-mode))
    (bind-keys
     :map auto-highlight-symbol-mode-map
      ("M-<"     . ahs-backward)
      ("M->"     . ahs-forward)
      ("M--"     . ahs-back-to-start)
      ("C-x C-'" . ahs-change-range)
      ("C-x C-a" . ahs-edit-mode))))

(>=e "24.4"
    ;; Patch the `hi-lock-face-buffer' aka `highlight-regexp' to pick the
