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 3.0 1995/12/25 09:26:20 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 would like to hide "Mail-From", "Expires", "Xref", "Approved",
76 "Sender" and "X-.*" headers, 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        (require 'hilit19)
107        (let* ((csubject-patterns '(("^\\[.+\\]$" nil msg-subject)))
108               (header-patterns '(("^Subject:.*$" nil msg-subject)
109                                  ("^From:.*$" nil msg-from)
110                                  ("^--text follows this line--$"
111                                   nil msg-separator)
112                                  ("^[A-Za-z][A-Za-z0-9-]+:" nil msg-header)
113                                  ))
114               (body-patterns '(("^\\(In article\\|[ \t]*\\w*[]<>@}|]\\).*$"
115                                 nil msg-quote)))
116               (message-patterns (append ;;csubject-patterns
117                                  header-patterns
118                                  body-patterns))
119               )
120          (hilit-set-mode-patterns 'msg-header header-patterns)
121          (hilit-set-mode-patterns 'msg-body body-patterns)
122          (hilit-set-mode-patterns 'mime/viewer-mode
123                                   message-patterns
124                                   'hilit-rehighlight-message)
125          )
126        (add-hook 'mime-viewer/content-header-filter-hook
127                  (lambda ()
128                    (if (not (eq mime::preview/original-major-mode
129                                 'gnus-original-article-mode))
130                        (hilit-rehighlight-buffer-quietly)
131                      )))
132        (add-hook 'mime-viewer/plain-text-preview-hook
133                  (lambda ()
134                    (if (not (eq mime::preview/original-major-mode
135                                 'gnus-original-article-mode))
136                        (hilit-rehighlight-buffer-quietly)
137                      )))
138        ))
139 @end lisp
140
141
142 @subsection browse-url
143
144 setting example for browse-url.el included in Gnus.
145
146 @lisp
147 (setq browse-url-browser-function
148       (if (eq window-system 'x)
149           'browse-url-netscape
150         'browse-url-w3))
151 (autoload browse-url-browser-function "browse-url"
152   "Ask a WWW browser to show a URL." t)
153 @end lisp