Use a nicer, cleaner syntax calling #'make-glyph master
authorSteve Youngs <steve@emchat.org>
Sun, 31 May 2015 08:57:19 +0000 (18:57 +1000)
committerSteve Youngs <steve@emchat.org>
Sun, 31 May 2015 08:57:19 +0000 (18:57 +1000)
* emchat-buddy.el (emchat-buddy-make-avatar): Use nice, better
syntax with #'make-glyph.

* emchat-log.el (emchat-log-show-buffer): Ditto.

* emchat-xwem.el (emchat-xwem-osd-show-message): Ditto.

* emchat.el (emchat-donation): Ditto.

Signed-off-by: Steve Youngs <steve@emchat.org>
emchat-buddy.el
emchat-log.el
emchat-xwem.el
emchat.el

index bd5ab12..05fff49 100644 (file)
@@ -158,18 +158,18 @@ EXTENT is the extent to add the glyph to.
 DATA is the image data from BBDB."
   (cond
    ((eq type 'cface)
-    (set-extent-begin-glyph
-     extent
-     (make-glyph (list (vector 'png
-                              :data (emchat-face-to-png data))))))
+    (let ((glyph (emchat-face-to-png data)))
+      (set-extent-begin-glyph
+       extent
+       (make-glyph `([png :data ,glyph])))))
    ((eq type 'xface)
-    (set-extent-begin-glyph
-     extent
-     (make-glyph
-      (list (vector 'xface
-                   :data (concat "X-Face: " data)
-                   :foreground emchat-buddy-xface-foreground
-                   :background emchat-buddy-xface-background)))))
+    (let ((glyph (concat "X-Face: " data)))
+      (set-extent-begin-glyph
+       extent
+       (make-glyph
+       `([xface :data ,glyph
+                :foreground ,emchat-buddy-xface-foreground
+                :background ,emchat-buddy-xface-background])))))
    (t nil)))
 
 ;;;###autoload
index 208848a..8b51b8c 100644 (file)
@@ -345,10 +345,10 @@ See `emchat-log-filename'."
              (let ((ext (make-extent (point) (point))))
                (set-extent-begin-glyph
                 ext
-                (make-glyph (list (vector 'png ':file emchat-log-logo))))
+                (make-glyph `([png :file ,emchat-log-logo])))
                (set-extent-end-glyph
                 ext
-                (make-glyph (list (vector 'xbm ':file emchat-log-header))))
+                (make-glyph `([xbm :file ,emchat-log-header])))
                (insert "\n\n")))
          (insert "===========================================\n"
                  "Welcome to EMchat - The (S)XEmacs IM Client\n\n"
index f433e48..d64327a 100644 (file)
@@ -361,7 +361,7 @@ Each element is cons in form (GROUP . COLOR)."
     (xwem-osd-text-add
      emchat-xwem-osd
      (if emchat-xwem-osd-show-icon
-        (glyph-width (make-glyph (vector 'xpm :data emchat-xwem-osd-icon)))
+        (glyph-width (make-glyph `[xpm :data ,emchat-xwem-osd-icon]))
        0) 0
      (encode-coding-string
       (format "%s: %s" nick message)
index 89df916..2bab474 100644 (file)
--- a/emchat.el
+++ b/emchat.el
@@ -716,9 +716,9 @@ EXpLhkaHlpUI4zweHNiNrPmTs2I3Stt3XhJfN8TeewlyXACmFbndDGTM6gSvaT+/UgJ7vpfZ
        (donate-help "Make a donation to the EMchat team.")
        (cancel-help
         "Thank you for considering a donation... maybe another time.")
-       donate-glyph-ext
-       cancel-glyph-ext
-       donate-text-ext
+       (donate-glyph (base64-decode-string emchat-paypal-glyph))
+       (cancel-glyph (base64-decode-string emchat-maybe-later-glyph))
+       donate-glyph-ext cancel-glyph-ext donate-text-ext
        cancel-text-ext)
     (switch-to-buffer buf)
     (erase-buffer)
@@ -728,22 +728,12 @@ EXpLhkaHlpUI4zweHNiNrPmTs2I3Stt3XhJfN8TeewlyXACmFbndDGTM6gSvaT+/UgJ7vpfZ
       (setq donate-glyph-ext (make-extent (point-max) (point-max)))
       (set-extent-begin-glyph
        donate-glyph-ext
-       (make-glyph
-       (list (vector 'png ':data (with-temp-buffer
-                                    (insert emchat-paypal-glyph)
-                                    (base64-decode-region (point-min)
-                                                          (point-max))
-                                    (buffer-string))))))
+       (make-glyph `([png :data ,donate-glyph])))
       (insert "\t\t\t")
       (setq cancel-glyph-ext (make-extent (point-max) (point-max)))
       (set-extent-begin-glyph
        cancel-glyph-ext
-       (make-glyph
-       (list (vector 'png ':data (with-temp-buffer
-                                    (insert emchat-maybe-later-glyph)
-                                    (base64-decode-region (point-min)
-                                                          (point-max))
-                                    (buffer-string))))))
+       (make-glyph `([png :data ,cancel-glyph])))
       (set-extent-property donate-glyph-ext 'keymap emchat-donation-map)
       (set-extent-property donate-glyph-ext 'help-echo donate-help)
       (set-extent-property donate-glyph-ext 'balloon-help donate-help)