diff options
| author | Katsumi Yamaoka | 2008-12-04 10:53:18 +0000 |
|---|---|---|
| committer | Katsumi Yamaoka | 2008-12-04 10:53:18 +0000 |
| commit | 1250af7b900dd9ab6ec18113c62048e0ef416cd7 (patch) | |
| tree | 0dd22d47dc302e614c04eab0865a420b83e82c04 | |
| parent | a3b1a468318226d795e46d65d8c3c0b44942d6cc (diff) | |
| download | emacs-1250af7b900dd9ab6ec18113c62048e0ef416cd7.tar.gz emacs-1250af7b900dd9ab6ec18113c62048e0ef416cd7.zip | |
* mm-view.el (mm-inline-text-html-render-with-w3m): Make it simple and fast.
* gnus-art.el (gnus-article-wash-html-with-w3m): Ditto.
| -rw-r--r-- | lisp/gnus/ChangeLog | 7 | ||||
| -rw-r--r-- | lisp/gnus/gnus-art.el | 46 | ||||
| -rw-r--r-- | lisp/gnus/mm-view.el | 51 |
3 files changed, 51 insertions, 53 deletions
diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog index 37a6355ce31..535cbd065f5 100644 --- a/lisp/gnus/ChangeLog +++ b/lisp/gnus/ChangeLog | |||
| @@ -1,3 +1,10 @@ | |||
| 1 | 2008-12-04 Katsumi Yamaoka <yamaoka@jpl.org> | ||
| 2 | |||
| 3 | * mm-view.el (mm-inline-text-html-render-with-w3m): Make it simple and | ||
| 4 | fast. | ||
| 5 | |||
| 6 | * gnus-art.el (gnus-article-wash-html-with-w3m): Ditto. | ||
| 7 | |||
| 1 | 2008-12-04 Naohiro Aota <nao.aota@gmail.com> | 8 | 2008-12-04 Naohiro Aota <nao.aota@gmail.com> |
| 2 | 9 | ||
| 3 | * mm-view.el (mm-inline-text-html-render-with-w3m): Put special keymap | 10 | * mm-view.el (mm-inline-text-html-render-with-w3m): Put special keymap |
diff --git a/lisp/gnus/gnus-art.el b/lisp/gnus/gnus-art.el index 7d96a347b0b..a5d09f466d6 100644 --- a/lisp/gnus/gnus-art.el +++ b/lisp/gnus/gnus-art.el | |||
| @@ -2728,37 +2728,33 @@ charset defined in `gnus-summary-show-article-charset-alist' is used." | |||
| 2728 | (let ((w3m-safe-url-regexp mm-w3m-safe-url-regexp) | 2728 | (let ((w3m-safe-url-regexp mm-w3m-safe-url-regexp) |
| 2729 | w3m-force-redisplay) | 2729 | w3m-force-redisplay) |
| 2730 | (w3m-region (point-min) (point-max))) | 2730 | (w3m-region (point-min) (point-max))) |
| 2731 | ;; Put the mark meaning this part was rendered by emacs-w3m. | ||
| 2732 | (put-text-property (point-min) (point-max) 'mm-inline-text-html-with-w3m t) | ||
| 2731 | (when (and mm-inline-text-html-with-w3m-keymap | 2733 | (when (and mm-inline-text-html-with-w3m-keymap |
| 2732 | (boundp 'w3m-minor-mode-map) | 2734 | (boundp 'w3m-minor-mode-map) |
| 2733 | w3m-minor-mode-map) | 2735 | w3m-minor-mode-map) |
| 2734 | (if (and (boundp 'w3m-link-map) | 2736 | (if (and (boundp 'w3m-link-map) |
| 2735 | w3m-link-map) | 2737 | w3m-link-map) |
| 2736 | (let ((begin (point-min)) | 2738 | (let* ((start (point-min)) |
| 2737 | (map (copy-keymap w3m-link-map)) | 2739 | (end (point-max)) |
| 2738 | end) | 2740 | (on (get-text-property start 'w3m-href-anchor)) |
| 2741 | (map (copy-keymap w3m-link-map)) | ||
| 2742 | next) | ||
| 2739 | (set-keymap-parent map w3m-minor-mode-map) | 2743 | (set-keymap-parent map w3m-minor-mode-map) |
| 2740 | (while (setq end (next-single-property-change begin | 2744 | (while (< start end) |
| 2741 | 'w3m-href-anchor)) | 2745 | (if on |
| 2742 | (add-text-properties | 2746 | (progn |
| 2743 | begin end | 2747 | (setq next (or (text-property-any start end |
| 2744 | (list 'keymap (if (get-text-property begin 'w3m-href-anchor) | 2748 | 'w3m-href-anchor nil) |
| 2745 | map | 2749 | end)) |
| 2746 | w3m-minor-mode-map) | 2750 | (put-text-property start next 'keymap map)) |
| 2747 | ;; Put the mark meaning this part was rendered by emacs-w3m. | 2751 | (setq next (or (text-property-not-all start end |
| 2748 | 'mm-inline-text-html-with-w3m t)) | 2752 | 'w3m-href-anchor nil) |
| 2749 | (setq begin end)) | 2753 | end)) |
| 2750 | (add-text-properties | 2754 | (put-text-property start next 'keymap w3m-minor-mode-map)) |
| 2751 | begin (point-max) | 2755 | (setq start next |
| 2752 | (list 'keymap (if (get-text-property begin 'w3m-href-anchor) | 2756 | on (not on)))) |
| 2753 | map | 2757 | (put-text-property (point-min) (point-max) 'keymap w3m-minor-mode-map)))) |
| 2754 | w3m-minor-mode-map) | ||
| 2755 | ;; Put the mark meaning this part was rendered by emacs-w3m. | ||
| 2756 | 'mm-inline-text-html-with-w3m t))) | ||
| 2757 | (add-text-properties | ||
| 2758 | (point-min) (point-max) | ||
| 2759 | (list 'keymap w3m-minor-mode-map | ||
| 2760 | ;; Put the mark meaning this part was rendered by emacs-w3m. | ||
| 2761 | 'mm-inline-text-html-with-w3m t))))) | ||
| 2762 | 2758 | ||
| 2763 | (defvar charset) ;; Bound by `article-wash-html'. | 2759 | (defvar charset) ;; Bound by `article-wash-html'. |
| 2764 | 2760 | ||
diff --git a/lisp/gnus/mm-view.el b/lisp/gnus/mm-view.el index fd01a0132f6..3f86642b18b 100644 --- a/lisp/gnus/mm-view.el +++ b/lisp/gnus/mm-view.el | |||
| @@ -258,40 +258,35 @@ | |||
| 258 | (let ((w3m-safe-url-regexp mm-w3m-safe-url-regexp) | 258 | (let ((w3m-safe-url-regexp mm-w3m-safe-url-regexp) |
| 259 | w3m-force-redisplay) | 259 | w3m-force-redisplay) |
| 260 | (w3m-region (point-min) (point-max) nil charset)) | 260 | (w3m-region (point-min) (point-max) nil charset)) |
| 261 | ;; Put the mark meaning this part was rendered by emacs-w3m. | ||
| 262 | (put-text-property (point-min) (point-max) | ||
| 263 | 'mm-inline-text-html-with-w3m t) | ||
| 261 | (when (and mm-inline-text-html-with-w3m-keymap | 264 | (when (and mm-inline-text-html-with-w3m-keymap |
| 262 | (boundp 'w3m-minor-mode-map) | 265 | (boundp 'w3m-minor-mode-map) |
| 263 | w3m-minor-mode-map) | 266 | w3m-minor-mode-map) |
| 264 | (if (and (boundp 'w3m-link-map) | 267 | (if (and (boundp 'w3m-link-map) |
| 265 | w3m-link-map) | 268 | w3m-link-map) |
| 266 | (let ((begin (point-min)) | 269 | (let* ((start (point-min)) |
| 267 | (map (copy-keymap w3m-link-map)) | 270 | (end (point-max)) |
| 268 | end) | 271 | (on (get-text-property start 'w3m-href-anchor)) |
| 272 | (map (copy-keymap w3m-link-map)) | ||
| 273 | next) | ||
| 269 | (set-keymap-parent map w3m-minor-mode-map) | 274 | (set-keymap-parent map w3m-minor-mode-map) |
| 270 | (while (setq end (next-single-property-change | 275 | (while (< start end) |
| 271 | begin 'w3m-href-anchor)) | 276 | (if on |
| 272 | (add-text-properties | 277 | (progn |
| 273 | begin end | 278 | (setq next (or (text-property-any start end |
| 274 | (list 'keymap (if (get-text-property begin 'w3m-href-anchor) | 279 | 'w3m-href-anchor nil) |
| 275 | map | 280 | end)) |
| 276 | w3m-minor-mode-map) | 281 | (put-text-property start next 'keymap map)) |
| 277 | ;; Put the mark meaning this part was rendered | 282 | (setq next (or (text-property-not-all start end |
| 278 | ;; by emacs-w3m. | 283 | 'w3m-href-anchor nil) |
| 279 | 'mm-inline-text-html-with-w3m t)) | 284 | end)) |
| 280 | (setq begin end)) | 285 | (put-text-property start next 'keymap w3m-minor-mode-map)) |
| 281 | (add-text-properties | 286 | (setq start next |
| 282 | begin (point-max) | 287 | on (not on)))) |
| 283 | (list 'keymap (if (get-text-property begin 'w3m-href-anchor) | 288 | (put-text-property (point-min) (point-max) |
| 284 | map | 289 | 'keymap w3m-minor-mode-map))) |
| 285 | w3m-minor-mode-map) | ||
| 286 | ;; Put the mark meaning this part was rendered | ||
| 287 | ;; by emacs-w3m. | ||
| 288 | 'mm-inline-text-html-with-w3m t))) | ||
| 289 | (add-text-properties | ||
| 290 | (point-min) (point-max) | ||
| 291 | (list 'keymap w3m-minor-mode-map | ||
| 292 | ;; Put the mark meaning this part was rendered | ||
| 293 | ;; by emacs-w3m. | ||
| 294 | 'mm-inline-text-html-with-w3m t)))) | ||
| 295 | (mm-handle-set-undisplayer | 290 | (mm-handle-set-undisplayer |
| 296 | handle | 291 | handle |
| 297 | `(lambda () | 292 | `(lambda () |