From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/42555 Path: main.gmane.org!not-for-mail From: Jinhyok Heo Newsgroups: gmane.emacs.gnus.general Subject: Re: emacs-w3m Date: Fri, 25 Jan 2002 11:41:16 +0900 Sender: owner-ding@hpc.uh.edu Message-ID: <3ok7u7nodv.fsf@www.okpos.com> References: <3osn8wj8dv.fsf@www.okpos.com> NNTP-Posting-Host: coloc-standby.netfonds.no Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1035177779 12449 80.91.224.250 (21 Oct 2002 05:22:59 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Mon, 21 Oct 2002 05:22:59 +0000 (UTC) Return-Path: Original-Received: (qmail 28654 invoked from network); 25 Jan 2002 02:42:20 -0000 Original-Received: from malifon.math.uh.edu (mail@129.7.128.13) by mastaler.com with SMTP; 25 Jan 2002 02:42:20 -0000 Original-Received: from sina.hpc.uh.edu ([129.7.128.10] ident=lists) by malifon.math.uh.edu with esmtp (Exim 3.20 #1) id 16TwJ5-0003rE-00; Thu, 24 Jan 2002 20:41:35 -0600 Original-Received: by sina.hpc.uh.edu (TLB v0.09a (1.20 tibbs 1996/10/09 22:03:07)); Thu, 24 Jan 2002 20:41:31 -0600 (CST) Original-Received: from sclp3.sclp.com (qmailr@sclp3.sclp.com [209.196.61.66]) by sina.hpc.uh.edu (8.9.3/8.9.3) with SMTP id UAA19817 for ; Thu, 24 Jan 2002 20:41:19 -0600 (CST) Original-Received: (qmail 28645 invoked by alias); 25 Jan 2002 02:41:17 -0000 Original-Received: (qmail 28640 invoked from network); 25 Jan 2002 02:41:16 -0000 Original-Received: from unknown (HELO www.okpos.com) (root@61.82.64.4) by gnus.org with SMTP; 25 Jan 2002 02:41:16 -0000 Original-Received: (from novembre@localhost) by www.okpos.com (8.11.6/8.11.6/SuSE Linux 0.5) id g0P2fGO06461; Fri, 25 Jan 2002 11:41:16 +0900 Original-To: ding@gnus.org In-Reply-To: (Katsumi Yamaoka's message of "Fri, 25 Jan 2002 10:28:49 +0900") Original-Lines: 165 User-Agent: Gnus/5.090006 (Oort Gnus v0.06) XEmacs/21.4 (Artificial Intelligence, i386-suse-linux) Precedence: list X-Majordomo: 1.94.jlt7 Xref: main.gmane.org gmane.emacs.gnus.general:42555 X-Report-Spam: http://spam.gmane.org/gmane.emacs.gnus.general:42555 >>>>> "KY" == Katsumi Yamaoka writes: KY> JH> I tried to use emacs-w3m. Well, it's working well except that my KY> JH> Korean characters doesn't render correctly. KY> JH> Is there a way I can fix it? KY> JH> The w3m inside XEmacs renders Korean very well, but not with gnus. KY> Thank you for the report. I've confirmed your problem. The KY> attached text/html part is extracted from http://kr.yahoo.com/. KY> Gnus + Emacs/w3 or T-gnus shows it correctly, but Gnus + KY> emacs-w3m doesn't. I will consider how to fix it... I've found the following answer to the problem from Korean emacs mailing list(emacs-kr@debian.or.kr). Jaeyoun Chung wrote it. Well, following two lines in mm-inline-text-using-w3m gave me an error which said there was no such function url-current-object. Maybe the function is not in XEmacs, but in Emacs. (url-current-object (url-generic-parse-url (format "cid:%s" (mm-handle-id handle)))) Anyway I've commented it out and it's working well in my XEmacs. Now I'm also happy with html mails. Thanks! -- | Jinhyok Heo (novembre @ ournature.org || http://ournature.org/~novembre/) |-------------------------------------------------------------------------- | "We are still reaching for the sky. In the developed countries people | are coming back down, saying, `It's empty up there.'" --- a Ladakhi monk ##### in my .xemacs/init.el ;;; w3m (setq w3m-display-inline-image t w3m-command-arguments '("-no-graph") w3m-coding-system 'euc-kr w3m-terminal-coding-system 'euc-kr w3m-input-coding-system 'euc-kr w3m-output-coding-system 'euc-kr w3m-file-name-coding-system 'euc-kr w3m-bookmark-file-coding-system 'euc-kr ) ;; handle msoe's brain-damaged coding system (eval-after-load "w3m" '(pushnew '(ks_c_5601-1987 . euc-kr) w3m-charset-coding-system-alist)) (add-hook 'w3m-fontify-after-hook 'remove-w3m-output-garbages) (defun remove-w3m-output-garbages () (interactive) (let ((buffer-read-only)) (setf (point) (point-min)) (while (re-search-forward "[\200-\240]" nil t) (replace-match " ")) (set-buffer-multibyte t)) (set-buffer-modified-p nil)) (autoload 'w3m "w3m" "Interface for w3m on Emacs." t) (autoload 'w3m-find-file "w3m" "w3m interface function for local file." t) (autoload 'w3m-browse-url "w3m" "Ask a WWW browser to show a URL." t) (autoload 'w3m-search "w3m-search" "Search QUERY using SEARCH-ENGINE." t) (autoload 'w3m-weather "w3m-weather" "Display weather report." t) (autoload 'w3m-antenna "w3m-antenna" "Report change of WEB sites." t) (setq mm-inline-text-html-renderer 'mm-inline-text-html-render-with-w3m) ##### in my .gnus.el ;; ====================================================================== ;; start of w3m replacement for w3 ;; ====================================================================== (defvar mm-w3m-setup nil) (defun mm-setup-w3m () (unless mm-w3m-setup (require 'w3m) (require 'url) (require 'url-vars) (setq mm-w3m-setup t)) ) (defun mm-inline-text-using-w3m (handle) (let ((type (mm-handle-media-subtype handle)) text buffer-read-only) (cond ((equal type "html") (mm-setup-w3m) (setq text (mm-get-part handle)) (let ((b (point)) (url-standalone-mode t) ; (url-current-object ; (url-generic-parse-url (format "cid:%s" (mm-handle-id handle)))) (width (window-width)) (charset (mail-content-type-get (mm-handle-type handle) 'charset))) (save-excursion (insert text) (save-restriction (narrow-to-region b (point)) (goto-char (point-min)) (delete-region (point-min) (point-max)) (insert (mm-decode-string text charset)) (save-window-excursion (save-restriction (let ((fill-column fill-column) (url-standalone-mode t)) (condition-case var (w3m-region (point-min) (point-max)) (error (message "Error while rendering html; showing as text/plain")))))) (mm-handle-set-undisplayer handle `(lambda () (let (buffer-read-only) (if (functionp 'remove-specifier) (mapcar (lambda (prop) (remove-specifier (face-property 'default prop) (current-buffer))) '(background background-pixmap foreground))) (delete-region ,(point-min-marker) ,(point-max-marker))))))))) (t (error (message "only html part can be rendered by `mm-inline-text-using-w3m'")))))) (defun article-wash-html () "Format an html article." (interactive) (save-excursion (let ((buffer-read-only nil) charset) (if (gnus-buffer-live-p gnus-original-article-buffer) (with-current-buffer gnus-original-article-buffer (let* ((ct (gnus-fetch-field "content-type")) (ctl (and ct (ignore-errors (mail-header-parse-content-type ct))))) (setq charset (and ctl (mail-content-type-get ctl 'charset))) (if (stringp charset) (setq charset (intern (downcase charset))))))) (unless charset (setq charset gnus-newsgroup-charset)) (article-goto-body) (save-window-excursion (save-restriction (narrow-to-region (point) (point-max)) (mm-setup-w3m) (let ((url-standalone-mode t)) (condition-case var (w3m-region (point-min) (point-max)) (error)))))))) (setq mm-inline-media-tests (cons '("text/html" mm-inline-text-using-w3m (lambda (handle) (locate-library "w3m"))) mm-inline-media-tests)) ;; ====================================================================== ;; end of w3m replacement for w3 ;; ======================================================================