]> git.eshelyaron.com Git - emacs.git/commitdiff
[Gnus] Silence XEmacs compilation warnings
authorLars Ingebrigtsen <larsi@gnus.org>
Mon, 3 Sep 2012 22:12:02 +0000 (22:12 +0000)
committerKatsumi Yamaoka <yamaoka@jpl.org>
Mon, 3 Sep 2012 22:12:02 +0000 (22:12 +0000)
lisp/gnus/ChangeLog
lisp/gnus/gnus-fun.el
lisp/gnus/gnus-notifications.el

index a4e3d9bde2beb22dac818f3ce52724ebaf9d5030..37d89ba8cad789dd8fdc550ec970a140841e863f 100644 (file)
@@ -1,3 +1,12 @@
+2012-09-03  Lars Ingebrigtsen  <larsi@gnus.org>
+
+       * dgnushack.el: XEmacs 21.5 compilation fix.
+
+       * gnus-notifications.el (gnus-notifications-notify): Use it.
+
+       * gnus-fun.el (gnus-funcall-no-warning): New function to silence
+       warnings on XEmacs.
+
 2012-09-01  Paul Eggert  <eggert@cs.ucla.edu>
 
        Better seeds for (random).
index f33eb910c6a7816135fb6447c9a1e594ca724ad0..f5e1c5ad69142a198ca088c62735e2065ee03919 100644 (file)
@@ -278,6 +278,10 @@ colors of the displayed X-Faces."
          values))
   (mapconcat 'identity values " ")))
 
+(defun gnus-funcall-no-warning (function &rest args)
+  (when (fboundp function)
+    (apply function args)))
+
 (provide 'gnus-fun)
 
 ;;; gnus-fun.el ends here
index c5129958997262f6a3c957ff1dc7b8fc8f23f6b0..f9c2d309a3513af2bd7e694655732b1c9eae9a35 100644 (file)
 
 ;;; Code:
 
-(require 'notifications nil t)
+(ignore-errors
+  (require 'notifications))
 (require 'gnus-sum)
 (require 'gnus-group)
 (require 'gnus-int)
 (require 'gnus-art)
 (require 'gnus-util)
-(require 'google-contacts nil t)        ; Optional
+(ignore-errors
+  (require 'google-contacts))        ; Optional
+(require 'gnus-fun)
 
 (defgroup gnus-notifications nil
   "Send notifications on new message in Gnus."
@@ -81,12 +84,14 @@ not get notifications."
   "Send a notification about a new mail.
 Return a notification id if any, or t on success."
   (if (fboundp 'notifications-notify)
-      (notifications-notify
+      (gnus-funcall-no-warning
+       'notifications-notify
        :title from
        :body subject
        :actions '("read" "Read")
        :on-action 'gnus-notifications-action
-       :app-icon (image-search-load-path "gnus/gnus.png")
+       :app-icon (gnus-funcall-no-warning
+                 'image-search-load-path "gnus/gnus.png")
        :app-name "Gnus"
        :category "email.arrived"
        :timeout gnus-notifications-timeout
@@ -100,7 +105,8 @@ Return a notification id if any, or t on success."
   (let ((google-photo (when (and gnus-notifications-use-google-contacts
                                  (fboundp 'google-contacts-get-photo))
                         (ignore-errors
-                          (google-contacts-get-photo mail-address)))))
+                          (gnus-funcall-no-warning
+                          'google-contacts-get-photo mail-address)))))
     (if google-photo
         google-photo
       (when gnus-notifications-use-gravatar