This commit was generated by cvs2svn to compensate for changes in r542,
[elisp/tm.git] / doc / tm-util_en.texi
1 @c $Id: tm-util_en.texi,v 1.1 1995/12/13 09:27:55 morioka Exp $
2
3 @node customize, Bug report, encoded-word, Top
4 @comment  node-name,  next,  previous,  up
5 @chapter customize
6
7 @menu
8 * fields::
9 * available functions::
10 * example::
11 @end menu
12
13 @node fields, available functions, customize, customize
14 @comment  node-name,  next,  previous,  up
15 @section fields
16 @cindex field-list
17 @cindex field-regexp
18
19 tm-view.el and tm-edit.el uses pair of @strong{field-list} and
20 @strong{field-regexp} to display or choose fields of message header.
21
22 tm has functions to set such pair.
23
24
25 @defun tm:add-fields sym field-list &optional regexp-sym
26
27 It adds @var{field-list} to field-list indicated by symbol @var{sym}.
28 @end defun
29
30
31 @defun tm:delete-fields sym field-list &optional regexp-sym
32
33 It removes @var{field-list} from field-list indicated by symbol
34 @var{sym}.
35 @end defun
36
37
38 @node available functions, example, fields, customize
39 @comment  node-name,  next,  previous,  up
40 @section available functions
41
42
43 @defun add-path path &rest options
44
45 It adds @var{path} to @code{load-path}.
46
47 In default, it adds expanded path to top of @code{load-path} if there
48 is @var{path} under @code{default-load-path}.
49
50 If @code{'all-paths} is specified in @var{options}, it searches
51 @var{path} from all of @code{load-path} instead of
52 only @code{default-load-path}.
53
54 If @code{'append} is specifies in @var{options}, it adds to end of
55 @code{load-path}.
56 @end defun
57
58
59 @defun call-after-loaded module func &optional hook-name
60
61 It calls function @var{func} if @var{module} is already provided.
62
63 Otherwise, it add-hooks to @var{hook-name}.
64
65 Default value of @var{hook-name} is @code{MODULE-load-hook}.
66 @end defun
67
68
69 @node example,  , available functions, customize
70 @comment  node-name,  next,  previous,  up
71 @section example
72
73 @subsection message header display (1)
74
75 If you want not to display "Mail-From", "Expires", "Xref", "Approved",
76 "Sender" and "X-.*", please specify:
77
78 @lisp
79 (call-after-loaded
80  'tm-view
81  (lambda ()
82    (tm:add-fields
83     'mime-viewer/ignored-field-list
84     '("Mail-From" "Expires" "Xref" "Approved" "Sender" "X-.*")
85      )))
86 @end lisp
87
88 @subsection message header display (2)
89
90 If you want to display only "From", ".*To", "Subject", ".*Date" and
91 "Newsgroups" , please specify:
92
93 @lisp
94 (setq mime-viewer/ignored-field-list '(".+"))
95 (setq mime-viewer/visible-field-list
96       '("From" ".*To" "Subject" ".*Date" "Newsgroups"))
97 @end lisp
98
99
100 @subsection hilit19
101
102 example to add faces using hilit19.
103
104 @lisp
105 (cond (window-system
106        (let* ((header-patterns '(("^Subject:.*$" nil msg-subject)
107                                  ("^From:.*$" nil msg-from)
108                                  ("^--text follows this line--$"
109                                   nil msg-separator)
110                                  ("^[A-Za-z][A-Za-z0-9-]+:" nil msg-header)
111                                  ))
112               (body-patterns '(("^\\(In article\\|[ \t]*\\w*[]<>@}|]\\).*$"
113                                 nil msg-quote)))
114               (message-patterns (append header-patterns body-patterns))
115               )
116          (hilit-set-mode-patterns 'msg-header header-patterns)
117          (hilit-set-mode-patterns 'msg-body body-patterns)
118          (hilit-set-mode-patterns 'mime/viewer-mode
119                                   message-patterns
120                                   'hilit-rehighlight-message)
121          )
122        (add-hook 'mime-viewer/content-header-filter-hook
123                  (function hilit-rehighlight-buffer-quietly))
124        (add-hook 'mime-viewer/plain-text-preview-hook
125                  (function hilit-rehighlight-buffer-quietly))
126        ))
127 @end lisp
128
129
130 @subsection browse-url
131
132 setting example for browse-url.el included in Gnus.
133
134 @lisp
135 (setq browse-url-browser-function
136       (if (eq window-system 'x)
137           'browse-url-netscape
138         'browse-url-w3))
139 (autoload browse-url-browser-function "browse-url"
140   "Ask a WWW browser to show a URL." t)
141 @end lisp