From: ueno Date: Sun, 6 Feb 2000 08:37:44 +0000 (+0000) Subject: * lisp/gnus-offline.el (gnus-group-get-new-news, X-Git-Tag: t-gnus-6_14_1-06~4 X-Git-Url: http://git.chise.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=dffab7cf3d8b618df2fddea860ce8bffc09c8f11;p=elisp%2Fgnus.git- * lisp/gnus-offline.el (gnus-group-get-new-news, gnus-agent-toggle-plugged,gnus-agent-expire, gnus-agent-mode): Check whether `gnus-ofsetup' is provided before redefining. --- diff --git a/lisp/gnus-offline.el b/lisp/gnus-offline.el index 76f4ac2..8fa6f2c 100644 --- a/lisp/gnus-offline.el +++ b/lisp/gnus-offline.el @@ -395,43 +395,44 @@ Please check your .emacs or .gnus.el to work nnspool fine.") (setq gnus-agent-handle-level gnus-level-subscribed) (gnus-agent-toggle-plugged t)))) -;; Advice to Gnus functions. -(defadvice gnus-group-get-new-news (before gnus-offline-advice - activate preactivate) - "When called interactively, dial up and get online automatically." - (when (interactive-p) - (run-hooks 'gnus-offline-before-online-hook) - (if (and (memq 'connect gnus-offline-auto-ppp) - (functionp gnus-offline-dialup-function)) - (funcall gnus-offline-dialup-function)) - (gnus-offline-get-new-news-function))) - -(defadvice gnus-agent-toggle-plugged (around gnus-offline-advice +(when (featurep 'gnus-ofsetup) + ;; Advice to Gnus functions. + (defadvice gnus-group-get-new-news (before gnus-offline-advice activate preactivate) - "Also toggle gnus-offline `connected--disconnected' status." - (interactive (list (not gnus-offline-connected))) - (cond ((ad-get-arg 0) - (setq gnus-offline-connected (ad-get-arg 0)) - ad-do-it - ;; Set send mail/news function to offline functions. - (gnus-offline-set-online-sendmail-function) - (gnus-offline-set-online-post-news-function)) - (t - ;; Set to offline status - (gnus-offline-set-unplugged-state)))) - -(defadvice gnus-agent-expire (around gnus-offline-advice activate preactivate) - "Advice not to delete new articles." - (cond ((eq 0 gnus-agent-expire-days) - (let (gnus-agent-expire-all) - ad-do-it)) - (t - ad-do-it))) + "When called interactively, dial up and get online automatically." + (when (interactive-p) + (run-hooks 'gnus-offline-before-online-hook) + (if (and (memq 'connect gnus-offline-auto-ppp) + (functionp gnus-offline-dialup-function)) + (funcall gnus-offline-dialup-function)) + (gnus-offline-get-new-news-function))) + + (defadvice gnus-agent-toggle-plugged (around gnus-offline-advice + activate preactivate) + "Also toggle gnus-offline `connected--disconnected' status." + (interactive (list (not gnus-offline-connected))) + (cond ((ad-get-arg 0) + (setq gnus-offline-connected (ad-get-arg 0)) + ad-do-it + ;; Set send mail/news function to offline functions. + (gnus-offline-set-online-sendmail-function) + (gnus-offline-set-online-post-news-function)) + (t + ;; Set to offline status + (gnus-offline-set-unplugged-state)))) + + (defadvice gnus-agent-expire (around gnus-offline-advice activate preactivate) + "Advice not to delete new articles." + (cond ((eq 0 gnus-agent-expire-days) + (let (gnus-agent-expire-all) + ad-do-it)) + (t + ad-do-it))) -(defadvice gnus-agent-mode (around gnus-offline-advice activate preactivate) - "Advice not to close PPP connection." - (let (gnus-offline-hangup-function) - ad-do-it)) + (defadvice gnus-agent-mode (around gnus-offline-advice activate preactivate) + "Advice not to close PPP connection." + (let (gnus-offline-hangup-function) + ad-do-it))) ;; ;; Setting up...