Skip to content

Commit

Permalink
Merge pull request #89 from mernst/master
Browse files Browse the repository at this point in the history
Add instructions for using Emacs's built-in HTML renderer as well as w3m
  • Loading branch information
kazu-yamamoto committed Aug 14, 2015
2 parents 4ad85ca + febe68e commit 8f6261c
Show file tree
Hide file tree
Showing 6 changed files with 68 additions and 18 deletions.
14 changes: 14 additions & 0 deletions dot.mew
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,19 @@
;;
;; Also, set mew-prog-vgrep and mew-prog-vgrep-opts

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;
;;; Using the "eww" browser
;;;
;;; shr-render-region is built into Emacs 24.1 and later.

;(setq mew-use-text/html t) ; decode HTML for all folders
;(setq mew-mime-multipart-alternative-list '("Text/Html" "Text/Plain" ".*"))
;(if (and (fboundp 'shr-render-region)
; ;; \\[shr-render-region] requires Emacs to be compiled with libxml2.
; (fboundp 'libxml-parse-html-region))
; (setq mew-prog-text/html 'shr-render-region))

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;
;;; Using "w3m" with "emacs-w3m"
Expand All @@ -101,6 +114,7 @@
;;; cvs -d :pserver:anonymous@cvs.namazu.org:/storage/cvsroot co emacs-w3m


;(setq mew-use-text/html t) ; decode HTML for all folders
;(setq mew-mime-multipart-alternative-list '("Text/Html" "Text/Plain" ".*"))

;(condition-case nil
Expand Down
30 changes: 20 additions & 10 deletions info/mew.texi
Original file line number Diff line number Diff line change
Expand Up @@ -10329,17 +10329,12 @@ buffer.
す。) 両者をインストールしたら、"~/.mew.el" に以下の設定を加えて下さい。
@end ifset
@ifset en
If you install "w3m" and "emacs-w3m", Text/Html can be displayed in
Message mode. (Please note that multilingualized "w3m", not pure
@w{"}w3m", is necessary for "wvHtml", "xlhtml", and "ppthtml"
described below.) When you install both of them, add the following to
"~/.mew.el'.
Text/Html can be displayed in Message mode, if you add the following to
"~/.mew.el".
@end ifset

@lisp
(condition-case nil
(require 'mew-w3m)
(file-error nil))
(setq mew-use-text/html t) ; decode HTML for all folders
@end lisp

@ifset ja
Expand All @@ -10351,8 +10346,23 @@ described below.) When you install both of them, add the following to
With this, Text/Html can be displayed in Message mode as if it were
Text/Plain. Even in this situation, @samp{C-cC-e} described below is a
valid operation.

By default, Text/Html is displayed using Emacs's built-in HTML renderer.

Alternatively, you can display Text/Html using the w3m browser.
First, install "w3m" and "emacs-w3m".
(Please note that multilingualized "w3m", not pure
@w{"}w3m", is necessary for "wvHtml", "xlhtml", and "ppthtml"
described below.) When you install both of them, add the following to
"~/.mew.el".
@end ifset

@lisp
(condition-case nil
(require 'mew-w3m)
(file-error nil))
@end lisp

@ifset ja
"wvHtml"、"xlhtml"、"ppthtml" というコマンドをインストールすれば、それ
ぞれ WORD、Excel、PowerPoint ファイルのテキスト部分を、Message バッファ
Expand Down Expand Up @@ -10483,8 +10493,8 @@ application, type @samp{C-uC-cC-e}.
@ifset en
Recently there are many message whose have Multipart/Alternative,
which consists of Text/Plain and Text/Html. By default, Mew selects
Text/Plain. When you install "emacs-w3m", you may want to choose
Text/Html. In this case, add the following to "~/.mew.el". (Now, it's
Text/Plain. If you prefer to choose
Text/Html, add the following to "~/.mew.el". (Now, it's a
good idea to get back to @ref{multipart} to review how to use
@samp{:}.)
@end ifset
Expand Down
12 changes: 10 additions & 2 deletions mew-darwin.el
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,18 @@
(defvar mew-format-html "%s.html")
(defvar mew-format-xml "%s.xml")

(defvar mew-prog-text/html 'mew-mime-text/html-w3m) ;; See w3m.el
(defvar mew-prog-text/html
(if (and (fboundp 'shr-render-region)
(fboundp 'libxml-parse-html-region))
'shr-render-region
'mew-mime-text/html-w3m)) ;; See w3m.el
(defvar mew-prog-text/html-ext mew-darwin-exec)

(defvar mew-prog-text/xml 'mew-mime-text/html-w3m) ;; See w3m.el
(defvar mew-prog-text/xml
(if (and (fboundp 'shr-render-region)
(fboundp 'libxml-parse-html-region))
'shr-render-region
'mew-mime-text/html-w3m)) ;; See w3m.el
(defvar mew-prog-text/xml-ext mew-darwin-exec)

(defvar mew-prog-application/xml nil)
Expand Down
6 changes: 4 additions & 2 deletions mew-message.el
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,8 @@ confused. Please use '\\[mew-message-forward]' instead."
(let ((buf (current-buffer)) url)
(mouse-set-point event)
(setq url (or (get-text-property (point) 'mew-url)
(get-text-property (point) 'w3m-href-anchor)))
(get-text-property (point) 'w3m-href-anchor)
(get-text-property (point) 'shr-url)))
(if (and url (string-match mew-regex-nonascii url))
(setq url (mew-puny-encode-url url)))
(if url (browse-url url))
Expand All @@ -220,7 +221,8 @@ confused. Please use '\\[mew-message-forward]' instead."
(interactive)
(let (url)
(setq url (or (get-text-property (point) 'mew-url)
(get-text-property (point) 'w3m-href-anchor)))
(get-text-property (point) 'w3m-href-anchor)
(get-text-property (point) 'shr-url)))
(if (and url (string-match mew-regex-nonascii url))
(setq url (mew-puny-encode-url url)))
(if url (browse-url url))))
Expand Down
12 changes: 10 additions & 2 deletions mew-unix.el
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,18 @@
(defvar mew-unix-browser-arg '("%s"))
(defvar mew-unix-browser-form `(,mew-unix-browser ,mew-unix-browser-arg t))

(defvar mew-prog-text/html 'mew-mime-text/html-w3m) ;; See w3m.el
(defvar mew-prog-text/html
(if (and (fboundp 'shr-render-region)
(fboundp 'libxml-parse-html-region))
'shr-render-region
'mew-mime-text/html-w3m)) ;; See w3m.el
(defvar mew-prog-text/html-ext mew-unix-browser-form)

(defvar mew-prog-text/xml 'mew-mime-text/html-w3m) ;; See w3m.el
(defvar mew-prog-text/xml
(if (and (fboundp 'shr-render-region)
(fboundp 'libxml-parse-html-region))
'shr-render-region
'mew-mime-text/html-w3m)) ;; See w3m.el
(defvar mew-prog-text/xml-ext mew-unix-browser-form)

(defvar mew-prog-application/xml nil)
Expand Down
12 changes: 10 additions & 2 deletions mew-win32.el
Original file line number Diff line number Diff line change
Expand Up @@ -154,10 +154,18 @@
(defvar mew-format-html "%s.htm")
(defvar mew-format-xml "%s.xml")

(defvar mew-prog-text/html 'mew-mime-text/html-w3m) ;; See w3m.el
(defvar mew-prog-text/html
(if (and (fboundp 'shr-render-region)
(fboundp 'libxml-parse-html-region))
'shr-render-region
'mew-mime-text/html-w3m)) ;; See w3m.el
(defvar mew-prog-text/html-ext mew-w32-exec)

(defvar mew-prog-text/xml 'mew-mime-text/html-w3m) ;; See w3m.el
(defvar mew-prog-text/xml
(if (and (fboundp 'shr-render-region)
(fboundp 'libxml-parse-html-region))
'shr-render-region
'mew-mime-text/html-w3m)) ;; See w3m.el
(defvar mew-prog-text/xml-ext mew-w32-exec)

(defvar mew-prog-application/xml nil)
Expand Down

0 comments on commit 8f6261c

Please sign in to comment.