X-Git-Url: http://cgit.sxemacs.org/?a=blobdiff_plain;f=lisp%2Fgnus-compat.el;h=3241cd1ae22931e067340a50edb78e7fa04257bf;hb=2df323a009ddd334ef992f32b7a8441daa6b6256;hp=130748853e68d3a8ef78389f2fe774f64f75ed41;hpb=28ac71eb9f37da5a6193a8e4dab61ab06b17f466;p=gnus diff --git a/lisp/gnus-compat.el b/lisp/gnus-compat.el index 130748853..3241cd1ae 100644 --- a/lisp/gnus-compat.el +++ b/lisp/gnus-compat.el @@ -97,6 +97,31 @@ TRASH is ignored." (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)))) + + +;; Emacs less than 24.3 +(unless (fboundp 'add-face) + (defun add-face (beg end face) + "Combine FACE BEG and END." + (let ((b beg)) + (while (< b end) + (let ((oldval (get-text-property b 'face))) + (put-text-property + b (setq b (next-single-property-change b 'face nil end)) + 'face (cond ((null oldval) + face) + ((and (consp oldval) + (not (keywordp (car oldval)))) + (cons face oldval)) + (t + (list face oldval))))))))) + (provide 'gnus-compat) ;; gnus-compat.el ends here