Add gnus-bound-and-true-p macro for XEmacs compatibility and use it in nnir.el and...
authorTed Zlatanov <tzz@lifelogs.com>
Tue, 18 Oct 2011 13:33:39 +0000 (09:33 -0400)
committerTed Zlatanov <tzz@lifelogs.com>
Tue, 18 Oct 2011 13:33:39 +0000 (09:33 -0400)
lisp/ChangeLog
lisp/gnus-util.el
lisp/nnir.el
lisp/nnmairix.el

index e2a51cc..433c34c 100644 (file)
@@ -1,5 +1,10 @@
 2011-10-18  Teodor Zlatanov  <tzz@lifelogs.com>
 
+       * gnus-util.el (gnus-bound-and-true-p): Macro for XEmacs compatibility.
+       * nnir.el (nnir-mode): Use it.
+       * nnmairix.el (nnmairix-determine-original-group-from-registry): Use
+       it.
+
        * nnir.el (gnus-registry-enabled): Defvar to keep the compiler happy.
        * nnmairix.el (gnus-registry-enabled): Ditto.
 
index e9d6ba4..9c5e6e8 100644 (file)
@@ -1986,6 +1986,14 @@ definitions to shadow the loaded ones for use in file byte-compilation."
              (gnus-macroexpand-all expanded environment)))
        form))))
 
+(eval-when-compile
+  ;; This is unnecessary in the compiled version as it is a macro.
+  (if (fboundp 'bound-and-true-p)
+      (defalias 'gnus-bound-and-true-p 'bound-and-true-p)
+    (defmacro gnus-bound-and-true-p (var)
+      "Return the value of symbol VAR if it is bound, else nil."
+      `(and (boundp (quote ,var)) ,var))))
+
 (provide 'gnus-util)
 
 ;;; gnus-util.el ends here
index b03c9e4..2d3c058 100644 (file)
@@ -1742,7 +1742,7 @@ environment unless `not-global' is non-nil."
   (when (eq (car (gnus-find-method-for-group gnus-newsgroup-name)) 'nnir)
     (setq gnus-summary-line-format
          (or nnir-summary-line-format gnus-summary-line-format))
-    (when (bound-and-true-p gnus-registry-enabled)
+    (when (gnus-bound-and-true-p gnus-registry-enabled)
       (remove-hook 'gnus-summary-article-delete-hook 'gnus-registry-action t)
       (remove-hook 'gnus-summary-article-move-hook 'gnus-registry-action t)
       (remove-hook 'gnus-summary-article-expire-hook 'gnus-registry-action t)
index 17b42fa..1bf28c5 100644 (file)
@@ -1638,7 +1638,7 @@ search in raw mode."
 
 (defun nnmairix-determine-original-group-from-registry (mid)
   "Try to determinale original group for message-id MID from the registry."
-  (when (bound-and-true-p gnus-registry-enabled)
+  (when (gnus-bound-and-true-p gnus-registry-enabled)
     (unless (string-match "^<" mid)
       (set mid (concat "<" mid)))
     (unless (string-match ">$" mid)