Mercurial > hg > xemacs-beta
comparison lisp/tm/tm-vm.el @ 40:7e54bd776075 r19-15b103
Import from CVS: tag r19-15b103
author | cvs |
---|---|
date | Mon, 13 Aug 2007 08:54:25 +0200 |
parents | 8fc7fe29b841 |
children | 131b0175ea99 |
comparison
equal
deleted
inserted
replaced
39:06f275776fba | 40:7e54bd776075 |
---|---|
7 ;; MORIOKA Tomohiko <morioka@jaist.ac.jp> | 7 ;; MORIOKA Tomohiko <morioka@jaist.ac.jp> |
8 ;; Shuhei KOBAYASHI <shuhei-k@jaist.ac.jp> | 8 ;; Shuhei KOBAYASHI <shuhei-k@jaist.ac.jp> |
9 ;; Oscar Figueiredo <Oscar.Figueiredo@di.epfl.ch> | 9 ;; Oscar Figueiredo <Oscar.Figueiredo@di.epfl.ch> |
10 ;; Maintainer: Oscar Figueiredo <Oscar.Figueiredo@di.epfl.ch> | 10 ;; Maintainer: Oscar Figueiredo <Oscar.Figueiredo@di.epfl.ch> |
11 ;; Created: 1994/10/29 | 11 ;; Created: 1994/10/29 |
12 ;; Version: $Revision: 1.5 $ | 12 ;; Version: $Revision: 1.6 $ |
13 ;; Keywords: mail, MIME, multimedia, multilingual, encoded-word | 13 ;; Keywords: mail, MIME, multimedia, multilingual, encoded-word |
14 | 14 |
15 ;; This file is part of tm (Tools for MIME). | 15 ;; This file is part of tm (Tools for MIME). |
16 | 16 |
17 ;; This program is free software; you can redistribute it and/or | 17 ;; This program is free software; you can redistribute it and/or |
44 (require 'tm-view) | 44 (require 'tm-view) |
45 (require 'vm-reply) | 45 (require 'vm-reply) |
46 (require 'vm-summary) | 46 (require 'vm-summary) |
47 (require 'vm-menu) | 47 (require 'vm-menu) |
48 (require 'vm-toolbar) | 48 (require 'vm-toolbar) |
49 | 49 (require 'vm-mime) |
50 | 50 |
51 ;;; @ Variables | 51 ;;; @ Variables |
52 | 52 |
53 ;;; @@ User customization variables | 53 ;;; @@ User customization variables |
54 | 54 |
101 These hooks are run in the MIME-Preview buffer.") | 101 These hooks are run in the MIME-Preview buffer.") |
102 | 102 |
103 ;;; @@ System/Information variables | 103 ;;; @@ System/Information variables |
104 | 104 |
105 (defconst tm-vm/RCS-ID | 105 (defconst tm-vm/RCS-ID |
106 "$Id: tm-vm.el,v 1.5 1997/02/16 01:29:35 steve Exp $") | 106 "$Id: tm-vm.el,v 1.6 1997/03/22 05:29:25 steve Exp $") |
107 (defconst tm-vm/version (get-version-string tm-vm/RCS-ID)) | 107 (defconst tm-vm/version (get-version-string tm-vm/RCS-ID)) |
108 | 108 |
109 ; Ensure vm-menu-mail-menu gets properly defined *before* tm-vm/vm-emulation-map | 109 ; Ensure vm-menu-mail-menu gets properly defined *before* tm-vm/vm-emulation-map |
110 ; since it contains a call to vm-menu-initialize-vm-mode-menu-map | 110 ; since it contains a call to vm-menu-initialize-vm-mode-menu-map |
111 (setq vm-menu-mail-menu | 111 (setq vm-menu-mail-menu |
284 (define-key vm-mode-map "Z" 'tm-vm/view-message) | 284 (define-key vm-mode-map "Z" 'tm-vm/view-message) |
285 (define-key vm-mode-map "T" 'tm-vm/decode-message-header) | 285 (define-key vm-mode-map "T" 'tm-vm/decode-message-header) |
286 (define-key vm-mode-map "\et" 'tm-vm/toggle-preview-mode) | 286 (define-key vm-mode-map "\et" 'tm-vm/toggle-preview-mode) |
287 | 287 |
288 ; Disable VM 6 built-in MIME handling | 288 ; Disable VM 6 built-in MIME handling |
289 (setq vm-display-using-mime nil) | 289 (setq vm-display-using-mime nil |
290 (setq vm-send-using-mime nil) | 290 vm-send-using-mime nil) |
291 | 291 |
292 ;;; @ MIME encoded-words | 292 ;;; @ MIME encoded-words |
293 | 293 |
294 (defvar tm-vm/use-tm-patch nil | 294 (defvar tm-vm/use-tm-patch nil |
295 "Does not decode encoded-words in summary buffer if it is t. | 295 "Does not decode encoded-words in summary buffer if it is t. |
296 If you use tiny-mime patch for VM (by RIKITAKE Kenji | 296 If you use tiny-mime patch for VM (by RIKITAKE Kenji |
297 <kenji@reseau.toyonaka.osaka.jp>), please set it t [tm-vm.el]") | 297 <kenji@reseau.toyonaka.osaka.jp>), please set it t [tm-vm.el]") |
298 | 298 |
299 (or tm-vm/use-tm-patch | 299 (or tm-vm/use-tm-patch |
300 (progn | 300 (progn |
301 ;;; | 301 (defadvice vm-compile-format (around tm activate) |
302 (defvar tm-vm/chop-full-name-function 'tm-vm/default-chop-full-name) | |
303 (setq vm-chop-full-name-function tm-vm/chop-full-name-function) | |
304 | |
305 (defun tm-vm/default-chop-full-name (address) | |
306 (let* ((ret (vm-default-chop-full-name address)) | |
307 (full-name (car ret)) | |
308 ) | |
309 (if (stringp full-name) | |
310 (cons (mime-eword/decode-string full-name) | |
311 (cdr ret)) | |
312 ret))) | |
313 | |
314 (defadvice vm-su-subject (after tm activate) | |
315 "MIME decoding support through TM added." | 302 "MIME decoding support through TM added." |
316 (setq ad-return-value (mime-eword/decode-string ad-return-value))) | 303 (let ((vm-display-using-mime t)) |
317 | 304 ad-do-it)) |
318 (defadvice vm-su-full-name (after tm activate) | 305 |
306 (defadvice vm-tokenized-summary-insert (around tm activate) | |
319 "MIME decoding support through TM added." | 307 "MIME decoding support through TM added." |
320 (setq ad-return-value (mime-eword/decode-string ad-return-value))) | 308 (let ((vm-display-using-mime t)) |
321 | 309 ad-do-it)) |
322 (defadvice vm-su-to-names (after tm activate) | 310 |
323 "MIME decoding support through TM added." | 311 (fset 'vm-decode-mime-encoded-words-in-string 'mime-eword/decode-string) |
324 (setq ad-return-value (mime-eword/decode-string ad-return-value))) | 312 (fset 'vm-reencode-mime-encoded-words-in-string 'mime-eword/encode-string) |
325 | 313 |
326 )) | 314 )) |
327 | 315 |
328 (defun tm-vm/decode-message-header (&optional count) | 316 (defun tm-vm/decode-message-header (&optional count) |
329 "Decode MIME header of current message. | 317 "Decode MIME header of current message. |
395 mime-viewer/content-header-filter-alist)) | 383 mime-viewer/content-header-filter-alist)) |
396 | 384 |
397 | 385 |
398 | 386 |
399 ;;; @ MIME Viewer | 387 ;;; @ MIME Viewer |
388 | |
389 (setq mime-viewer/code-converter-alist | |
390 (append | |
391 (list (cons 'vm-mode 'mime-charset/decode-buffer) | |
392 (cons 'vm-virtual-mode 'mime-charset/decode-buffer)) | |
393 mime-viewer/code-converter-alist)) | |
400 | 394 |
401 ;;; @@ MIME-Preview buffer management | 395 ;;; @@ MIME-Preview buffer management |
402 | 396 |
403 (defvar tm-vm/system-state nil) | 397 (defvar tm-vm/system-state nil) |
404 | 398 |
741 (function tm-vm/following-method)) | 735 (function tm-vm/following-method)) |
742 (set-alist 'mime-viewer/following-method-alist | 736 (set-alist 'mime-viewer/following-method-alist |
743 'vm-virtual-mode | 737 'vm-virtual-mode |
744 (function tm-vm/following-method)) | 738 (function tm-vm/following-method)) |
745 | 739 |
746 | |
747 (set-alist 'mime-viewer/quitting-method-alist | 740 (set-alist 'mime-viewer/quitting-method-alist |
748 'vm-mode | 741 'vm-mode |
749 'tm-vm/quit-view-message) | 742 'tm-vm/quit-view-message) |
750 | |
751 (set-alist 'mime-viewer/quitting-method-alist | 743 (set-alist 'mime-viewer/quitting-method-alist |
752 'vm-virtual-mode | 744 'vm-virtual-mode |
753 'tm-vm/quit-view-message) | 745 'tm-vm/quit-view-message) |
754 | 746 |
755 ;;; @@ Motion commands | 747 ;;; @@ Motion commands |
1202 (if digest | 1194 (if digest |
1203 (mime-editor/enclose-digest-region (point-min) (point-max))) | 1195 (mime-editor/enclose-digest-region (point-min) (point-max))) |
1204 )))) | 1196 )))) |
1205 | 1197 |
1206 (defadvice vm-forward-message (around tm-aware activate) | 1198 (defadvice vm-forward-message (around tm-aware activate) |
1207 "Extended to support rfc1521 multipart digests and to work properly in MIME-Preview buffers." | 1199 "Extended to support rfc1521 digests (roughly equivalent to what |
1200 VM does when vm-forwarding-digest-type is 'mime but using message/rfc822 | |
1201 when appropriate." | |
1208 (if (not (equal vm-forwarding-digest-type "rfc1521")) | 1202 (if (not (equal vm-forwarding-digest-type "rfc1521")) |
1209 ad-do-it | 1203 ad-do-it |
1210 (if mime::preview/article-buffer | 1204 (if mime::preview/article-buffer |
1211 (set-buffer mime::preview/article-buffer)) | 1205 (set-buffer mime::preview/article-buffer)) |
1212 (vm-follow-summary-cursor) | 1206 (vm-follow-summary-cursor) |