Commits

Paul Sexton committed dd204cb Merge

Merged in denkapparat/org-gamify/format-symbol (pull request #1)

fix printing of default currency name

Comments (0)

Files changed (1)

 a message in the minibuffer notifying the user that the balance has
 changed. Returns the message as a string."
   (let* ((currency-plist (org-gamify-get-currency-plist currency))
-         (cname (plist-get currency-plist :name))
+         (cname (or (plist-get currency-plist :name) currency))
          (balance-function (or (plist-get currency-plist :balance-function)
                                (lambda (b) (format "%d" b))))
          (msg (cond
                         cname))
                (t
                 (format "%+d %s!  Balance now %s" (- new-balance old-balance)
-                        (or cname currency)
+                        cname
                         (funcall balance-function new-balance))))))
     (cond
      ((and org-gamify-use-notify-p
 
 (defun org-gamify-currency-blocked-message (currency old-balance new-balance)
   (let* ((currency-plist (org-gamify-get-currency-plist currency))
-         (cname (or (plist-get currency-plist :name) (string currency)))
+         (cname (or (plist-get currency-plist :name) currency))
          (balance-function (or (plist-get currency-plist :balance-function)
                                (lambda (b) (format "%d" b))))
          (msg (cond
                                                     :balance-function)
                                          (lambda (b) (format "%d" b))))
                    (cname (or (plist-get currency-plist :name)
-                              (string currency)))
+                              currency))
                    (fg-color (or (plist-get currency-plist :fg-color)
                                  (face-foreground 'default)))
                    (bg-color (or (plist-get currency-plist :bg-color)
               (cond
                ((plist-get currency-plist :hide-amount)
                 (if (plusp balance)
-                    (insert (format "%s\n" (capitalize cname)))))
+                    (insert (capitalize (format "%s\n" cname)))))
                (t
                 (insert (format "  %-26s %20s\n"
-                                (capitalize (propertize cname 'face
+                                (capitalize (propertize (format "%s" cname) 'face
                                                         `(:foreground
                                                           ,fg-color
                                                           :background