From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/55010 Path: main.gmane.org!not-for-mail From: Katsumi Yamaoka Newsgroups: gmane.emacs.gnus.general,gmane.emacs.w3m Subject: Re: View html source in gnus with emacs-w3m? Date: Mon, 01 Dec 2003 21:30:29 +0900 Organization: Emacsen advocacy group Sender: ding-owner@lists.math.uh.edu Message-ID: References: NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: sea.gmane.org 1070281848 18790 80.91.224.253 (1 Dec 2003 12:30:48 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 1 Dec 2003 12:30:48 +0000 (UTC) Cc: ding@gnus.org, emacs-w3m@namazu.org Original-X-From: ding-owner+M3550@lists.math.uh.edu Mon Dec 01 13:30:45 2003 Return-path: Original-Received: from malifon.math.uh.edu ([129.7.128.13]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1AQnCP-0005sp-00 for ; Mon, 01 Dec 2003 13:30:45 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.math.uh.edu) by malifon.math.uh.edu with smtp (Exim 3.20 #1) id 1AQnCH-0004KJ-00; Mon, 01 Dec 2003 06:30:37 -0600 Original-Received: from justine.libertine.org ([66.139.78.221] ident=postfix) by malifon.math.uh.edu with esmtp (Exim 3.20 #1) id 1AQnCA-0004JI-00 for ding@lists.math.uh.edu; Mon, 01 Dec 2003 06:30:30 -0600 Original-Received: from washington.hostforweb.net (washington.hostforweb.net [69.61.11.2]) by justine.libertine.org (Postfix) with ESMTP id 64CEA3A0025 for ; Mon, 1 Dec 2003 06:30:30 -0600 (CST) Original-Received: from yamaoka by washington.hostforweb.net with local (Exim 4.24) id 1AQnCB-00072L-F8; Mon, 01 Dec 2003 07:30:31 -0500 Original-To: Jinhyok Heo X-Face: #kKnN,xUnmKia.'[pp`;Omh}odZK)?7wQSl"4o04=EixTF+V[""w~iNbM9ZL+.b*_CxUmFk B#Fu[*?MZZH@IkN:!"\w%I_zt>[$nm7nQosZ<3eu;B:$Q_:p!',P.c0-_Cy[dz4oIpw0ESA^D*1Lw= L&i*6&( User-Agent: Gnus/5.1003 (Gnus v5.10.3) Emacs/21.3.50 (gnu/linux) Cancel-Lock: sha1:/xa7z9C1NkrUWb0ecUyZu2gjG0A= X-Payment: hashcash 1.2 0:031201:novembre@ournature.org:2c4b4e8b5be95abb X-Hashcash: 0:031201:novembre@ournature.org:2c4b4e8b5be95abb X-Payment: hashcash 1.2 0:031201:ding@gnus.org:ef2d249b16aefe58 X-Hashcash: 0:031201:ding@gnus.org:ef2d249b16aefe58 X-Payment: hashcash 1.2 0:031201:emacs-w3m@namazu.org:5d2f7ce196684d54 X-Hashcash: 0:031201:emacs-w3m@namazu.org:5d2f7ce196684d54 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - washington.hostforweb.net X-AntiAbuse: Original Domain - gnus.org X-AntiAbuse: Originator/Caller UID/GID - [32041 32041] / [47 12] X-AntiAbuse: Sender Address Domain - washington.hostforweb.net Precedence: bulk Xref: main.gmane.org gmane.emacs.gnus.general:55010 gmane.emacs.w3m:3551 X-Report-Spam: http://spam.gmane.org/gmane.emacs.gnus.general:55010 --=-=-= >>>>> In Katsumi Yamaoka wrote: > Although it may be possible to show sources using the Gnus > original article buffer, I think there is not the necessity, > IMHO. That is because it is there. :) I changed my mind. Even if we can see html sources in the Gnus original article buffer, it is not always helpful since non-ascii text or qp encoded data aren't decoded. Here's an quick hack which can be used by putting into ~/.emacs-w3m.el file: --=-=-= Content-Type: application/emacs-lisp Content-Disposition: attachment (defun gnus-article-view-html-source-with-emacs-w3m () "View HTML source in the Gnus article buffer." (interactive) (when (and (eq major-mode 'gnus-article-mode) (buffer-live-p gnus-summary-buffer)) (let ((article (save-excursion (set-buffer gnus-summary-buffer) (gnus-summary-article-number))) (mm-inline-media-tests mm-inline-media-tests) src text keymap) (when article (when (and (not (setq src (get-text-property (point) 'view-html-source))) (setq text (assoc "text/plain" mm-inline-media-tests))) (setq mm-inline-media-tests (cons (cons "text/html" (cdr text)) mm-inline-media-tests))) (save-window-excursion (save-excursion (set-buffer gnus-summary-buffer) (gnus-summary-display-article article))) (article-goto-body) (when (and (not src) (eq this-command 'gnus-article-view-html-source-with-emacs-w3m)) (define-key (setq keymap (make-sparse-keymap)) (this-command-keys) 'gnus-article-view-html-source-with-emacs-w3m) (let ((inhibit-read-only t)) (save-restriction (widen) (add-text-properties (point) (point-max) (nconc (gnus-local-map-property keymap) ;; Put the mark meaning this part was ;; displayed by this command. '(view-html-source t)))))))))) (define-key w3m-minor-mode-map "\\" 'gnus-article-view-html-source-with-emacs-w3m) --=-=-= Content-Disposition: inline I don't want to add it to Gnus. I think it could be rewritten more generally, for example, to show MIME parts only with decoding charsets. -- Katsumi Yamaoka --=-=-=--