[Date Prev][Date Next][Thread Prev][][Date Index][Thread Index]

Small sb-bbc.el patch


this patch just removes an incredible ugly image.  Actually the
image wouldn't be that ugly if it's not scaled to ∼ 400x400 px.

I found out that the "height" attribute of images is removed in
shimbun.el and i suspect emacs-w3m now thinks it should scale it
to width x width (Please correct me if I'm wrong).  Is it really
a that good idea?


2005-09-16  David Hansen  <david.hansen@physik.fu-berlin.de>

	* shimbun/sb-bbc.el: (shimbun-bbc-remove-junk) New function.
          (shimbun-make-contents): Remove junk image.

--- cvs-src/emacs-w3m/shimbun/sb-bbc.el	2005-09-16 00:05:19.000000000 +0200
+++ share/emacs/site-lisp/w3m/sb-bbc.el	2005-09-16 00:05:02.000000000 +0200
@@ -55,6 +55,17 @@
     (error "Cannot find message-id base")))
+(defun shimbun-bbc-remove-junk ()
+  (save-excursion
+    (goto-char (point-min))
+    (when (re-search-forward
+           "<img[^>]+src=\"http://newsimg.bbc.co.uk/shared/img/999999.gif\".*?>")
+      (delete-region (match-beginning 0) (match-end 0)))))
+(luna-define-method shimbun-make-contents
+  :before ((shimbun shimbun-bbc) header)
+  (shimbun-bbc-remove-junk))
 (provide 'sb-bbc)
 ;;; sb-bbc.el ends here