  ("M-j"     . comment-indent-new-line)
  ("<f9>"    . eval-region))
 
-(defhydra hydra-change-case(:color red)
-  "change-case"
-  ("c"   modi/capitalize       "Capitalize")
-  ("u"   modi/upcase           "UPCASE")
-  ("l"   modi/downcase         "downcase")
-  ("M-c" xah-cycle-letter-case "→Cap→UP→down→")
-  ("q"   nil                   "cancel" :color blue))
-
-(bind-keys
- :map modi-mode-map
- ("C-x C-u" . modi/upcase)
- ("C-x C-l" . modi/downcase)
- ("M-c"     . hydra-change-case/body))
-
-(bind-to-modi-map "x" eval-and-replace-last-sexp)
 ;; Bind `what-cursor-position' to `modi-mode-map' as I have overridden its
 ;; default binding `C-x =' with something else.
 (bind-to-modi-map "=" what-cursor-position)

        (remove-hook hook #'indent-guide-mode)))))

;; http://stackoverflow.com/q/12165205/1219634
(defun copy-with-linenum (beg end use-unicode)
  "Copy the selected region with file name, starting and ending
line numbers, date and user name.

When called with a prefix like `C-u', it will use unicode characters
instead of ASCII characters for adorning the copied snippet."
  (interactive "r\nP")
  (let* ((chars-start-of-code-block ",--------")
         (chars-end-of-code-block   "`--------")
         (chars-n-dash              "--")
         (chars-m-dash              "---")
         (chars-pipe                "|"))
    (save-excursion
      (when use-unicode
        ( setq chars-start-of-code-block "╭────────"
               chars-end-of-code-block   "╰────────"
               chars-n-dash              "─"
               chars-m-dash              "──"
               chars-pipe                "│" ))
      (goto-char end)
      (skip-chars-backward "\n \t")
      (setq end (point))
      (let* ((chunk (buffer-substring beg end)))
        (setq chunk (concat
                     (format "%s #%-d %s %s %s\n%s "
                             chars-start-of-code-block
                             (line-number-at-pos beg)
                             chars-n-dash
                             (or (buffer-file-name) (buffer-name))
                             chars-m-dash
                             chars-pipe)
                     (replace-regexp-in-string "\n"
                                               (format "\n%s "
                                                       chars-pipe)
                                               chunk)
                     (format "\n%s #%-d %s %s %s %s"
                             chars-end-of-code-block
                             (line-number-at-pos end)
                             chars-n-dash
                             (format-time-string "%Y/%m/%d")
                             chars-n-dash
                             (getenv "USER"))))
        (kill-new chunk)))
    (deactivate-mark)))

;; Convert the decimal values in the whole buffer to 16-bit 2's complement hex
(fset 'modi/convert-dec-to-twos-comp-16-bit-hex

(defun modi/downcase ()   (interactive) (xah-cycle-letter-case 16))
(defun modi/capitalize () (interactive) (xah-cycle-letter-case 64))

(when (featurep 'region-bindings-mode)
  (bind-keys
   :map region-bindings-mode-map
   ("~" . xah-cycle-letter-case)))

(defhydra hydra-change-case(:color red)
  "change-case"
  ("c"   modi/capitalize       "Capitalize")
  ("u"   modi/upcase           "UPCASE")
  ("l"   modi/downcase         "downcase")
  ("M-c" xah-cycle-letter-case "→Cap→UP→down→")
  ("q"   nil                   "cancel" :color blue))

(bind-keys
 :map modi-mode-map
 ("C-x C-u" . modi/upcase)
 ("C-x C-l" . modi/downcase)
 ("M-c"     . hydra-change-case/body))

;; http://www.emacswiki.org/emacs/SortWords
;; http://emacs.stackexchange.com/a/7550/115
(defun sort-words (reverse beg end)
