-;; Time-stamp: <2015-07-24 17:48:37 kmodi>
+;; Time-stamp: <2015-07-26 17:36:56 kmodi>
 
 ;; https://github.com/abo-abo/tiny
 

                                    "[eg: %x | 0x%x | %c | %s | %(+ x x) | "
                                    "%014.2f | %03d; parentheses required "
                                    "here for sexps]: ")))))
      (when (null current-prefix-arg)
        (let ((tiny-key-binding (substitute-command-keys "\\[tiny-expand]"))
              (begin-val-num (string-to-number begin-val))
              (end-val-num (string-to-number end-val))
              tiny-expr
              tiny-expr-concise)
          ;; Begin and end values cannot be same
          (when (= end-val-num begin-val-num)
            (if (zerop end-val-num) ; if both are zero, set the end value to 9

          (when (not (string= fmt ""))
            ;; When non-nil, prefix `fmt' with the `|' char for reading clarity
            (setq fmt (concat "|" fmt)))
          (when (string= begin-val "0")
            (setq begin-val "") ; it's OK to not specify begin-val if it is 0
            (when (string= sep " ")
              (setq sep "")))
          (setq tiny-expr (concat "m" begin-val sep end-val op fmt))
          (message "%s" (concat "This "
                                (propertize "tiny"
                                            'face 'font-lock-function-name-face)
                                " expansion can also be done by typing "
                                (propertize tiny-expr
                                            'face 'font-lock-keyword-face)
                                " and then "
                                (propertize tiny-key-binding
                                            'face 'font-lock-keyword-face)
                                (when (null tiny-key-binding)
                                  (concat
                                   (propertize "M-x modi/tiny-helper"
                                               'face 'font-lock-keyword-face)
                                   " or "
                                   (propertize "M-x tiny-expand"
                                               'face 'font-lock-keyword-face)))
                                "."))
          (insert tiny-expr)
          (undo-boundary)))
      (tiny-expand))

    (bind-key "C-c \\" #'modi/tiny-helper modi-mode-map)
    (key-chord-define-global "]\\" #'modi/tiny-helper)))


(provide 'setup-tiny)
