gnus-notifications: add actions support
[gnus] / lisp / gnus-compat.el
index ea8dd4d..2b25e45 100644 (file)
@@ -76,6 +76,34 @@ TRASH is ignored."
            (delete-file file))))
       (delete-directory directory))))
 
+;; Emacs 24.0.93
+(require 'url)
+(when (= (length (help-function-arglist 'url-retrieve)) 5)
+  (defvar gnus-compat-original-url-retrieve
+    (symbol-function 'url-retrieve))
+  (defun url-retrieve (url callback &optional cbargs silent inhibit-cookies)
+    "Retrieve URL asynchronously and call CALLBACK with CBARGS when finished."
+    (funcall gnus-compat-original-url-retrieve
+            url callback cbargs silent)))
+
+;; XEmacs
+(when (and (not (fboundp 'timer-set-function))
+          (fboundp 'set-itimer-function))
+  (defun timer-set-function (timer function &optional args)
+    "Make TIMER call FUNCTION with optional ARGS when triggering."
+    (lexical-let ((function function)
+                 (args args))
+      (set-itimer-function timer
+                          (lambda (process status)
+                            (apply function process status args))))))
+
+;; XEmacs 21.4
+(unless (fboundp 'bound-and-true-p)
+  (defmacro bound-and-true-p (var)
+    "Return the value of symbol VAR if it is bound, else nil."
+    (and (boundp var)
+        (symbol-value var))))
+
 (provide 'gnus-compat)
 
 ;; gnus-compat.el ends here