File: cmail-19.el

package info (click to toggle)
cmail 2.62-3
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 2,496 kB
  • ctags: 2,104
  • sloc: lisp: 25,492; makefile: 189; perl: 148; sh: 68
file content (114 lines) | stat: -rw-r--r-- 3,258 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
;;;
;;;  cmail-19.el - cmail functions for emacs 19
;;; 
;;;  $Author: tmp $
;;;  created at: Fri May 27 13:33:49 JST 1994
;;;
;;;  Maintener:     Toshihiko Ueki <toshi@he.kobelcosys.co.jp>
;;;  Last modified: 1997/09/26
;;;
;;;  Copyright (C) 1995-1996 Yukihiro Matsumoto.

;;; cmail-19.el

(provide 'cmail-19)
(require 'cmail)

(if (featurep 'hilit19)
    (progn
      (hilit-set-mode-patterns '(cmail-readmail-mode cmail-edit-mode mime/viewer-mode mime-view-mode)
			       '(("^Subject:.*$" nil msg-subject)
				 ("^From:.*$" nil msg-from)
				 ("^--text follows this line--$"
				  nil msg-separator)
				 ("^[A-Za-z][A-Za-z0-9-]+:" nil msg-header)
				 ("^\\(In article\\|[ \t]*\\w*[]<>}|]\\).*$"
				  nil msg-quote))
			       'hilit-rehighlight-message)
      (hilit-set-mode-patterns 'cmail-summary-mode
			       '(("^ +[0-9]+ .*" nil summary-seen)
				 ("^ +[0-9]+R.*" nil msg-from)
				 ("^ +[0-9]+F.*" nil msg-from)
				 ("^ +[0-9]+>.*" nil msg-from)
				 ("^ +[0-9]+E.*" nil summary-Xed)
				 ("^ +[0-9]+U.*" nil summary-new)
				 ("^ +[0-9]+D.*" nil summary-deleted)
				 ("^ +[0-9]+H.*" nil msg-quote)
				 ("^ +[0-9]+B.*" nil msg-quote)
				 ("^ +[0-9]+b.*" nil msg-quote)
				 ("^ +[0-9]+!.*" nil summary-deleted)
				 ("^\+.*" nil summary-current)))

      (defun cmail-rehighlight-line ()
	(hilit-rehighlight-region (window-start) (window-end) t))

      (mapcar (function
	       (lambda (hook)
		 (add-hook hook 'hilit-rehighlight-buffer-quietly)))
	      '(
		cmail-summary-mode-hook
		cmail-readmail-mode-hook
		cmail-edit-mode-hook
		cmail-show-contents-after-hook
		cmail-sync-header-hook
		cmail-marked-hook
		mime/viewer-mode-hook
                mime-view-mode-hook
		)
	      )
      )

  (if (or (null cmail-highlight-mode)
	  (or (null (boundp 'emacs-minor-version))
	      (< emacs-minor-version 28)))
      nil
    (if (null (boundp 'frame-parameter))
	(defun frame-parameter (frame parameter)
	  (cdr (assq parameter (frame-parameters frame)))))

    (if (null (boundp 'set-face-italic-p))
	(require 'faces)
	(defun set-face-italic-p (face italic-p &optional frame)
	  (cond ((eq italic-p nil) (make-face-unitalic face frame t))
		(t (make-face-italic face frame t)))))

    (require 'cmail-highlight)

    (let ((alist cmail-highlight-attribute-alist) entry name fore back bold italic)
      (while (setq entry (pop alist))
	(setq name (nth 0 entry)
	      fore (nth 1 entry)
	      back (nth 2 entry)
	      bold (nth 3 entry)
	      italic (nth 4 entry))
	(if fore (set-face-foreground name fore))
	(if back (set-face-background name back))
	(if bold (set-face-bold-p name bold))
	(if italic (set-face-italic-p name italic))))

    (defun cmail-highlight-mail-19 ()
      "Highlight mail."
      (interactive)
      (if cmail-highlight-mode
	(save-excursion
	  (let ((buf "*mail*"))
	    (and (get-buffer buf)
		 (set-buffer buf)
		 (cmail-highlight-message))))))

    (mapcar (function
	     (lambda (hook)
		(add-hook hook 'cmail-highlight-mail-19)))
	    '(cmail-mail-hook
	      mail-setup-hook
	      mail-mode-hook
	      text-mode-hook
	      mime/editor-mode-hook))))

(require 'timezone)

(if (null window-system)
    nil
  (define-key menu-bar-file-menu [rmail] '("Read Mail" . cmail)))

(require 'cmail-e19)