(autoload 'tiurl-mode "tinyurl" t t) ;;; ---------------------------------------------------------------------- ;;; (defun my-gnus-browse-and-cache (URL) "Browse the URL if online, else use TinyUrl" (interactive) (setq URL (gnus-strip-whitespace URL)) (if (string= (second gnus-agent-mode-status) " Plugged") (funcall browse-url-browser-function URL) (when (fboundp 'tiurl-mode) ;Let this handle offline URL (cache) (require 'tinyurl) (tiurl-cache-url URL) ))) ;;; ---------------------------------------------------------------------- ;;; (defun my-gnus-art-load-hook () "Override article settings." ;; Replace functions. (defalias 'gnus-button-url 'my-gnus-browse-and-cache) (defalias 'gnus-button-embedded-url 'my-gnus-browse-and-cache) ;; TM occupies Gnus buffers too, redirect the "push" button. (if (featurep 'tm-setup) (defalias 'tm:browse-url 'my-gnus-browse-and-cache)) ) (add-hook 'gnus-art-load-hook 'my-gnus-art-load-hook) (if (featurep 'gnus-art) (my-gnus-art-load-hook)) ;Reload now