Add HTML versions of my init files
[website] / SYinits / 13-bbdb.html
1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
2  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3 <!-- Created by htmlize-1.34 in css mode. -->
4 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
5   <head>
6     <title>13-bbdb.el</title>
7 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
8     <meta name="author" content="Steve Youngs" />
9     <meta name="owner" content="steve@sxemacs.org" />
10     <style type="text/css">
11     <!--
12       body {
13         color: #ffffff;
14         background-color: #000000;
15       }
16       .comment {
17         /* font-lock-comment-face */
18         color: #87ceeb;
19       }
20       .doc-string {
21         /* font-lock-doc-string-face */
22         color: #32cd32;
23       }
24       .function-name {
25         /* font-lock-function-name-face */
26         color: #ffff00;
27         font-weight: bold;
28       }
29       .keyword {
30         /* font-lock-keyword-face */
31         color: #fa8072;
32       }
33       .reference {
34         /* font-lock-reference-face */
35         color: #40e0d0;
36       }
37       .string {
38         /* font-lock-string-face */
39         color: #00cd00;
40       }
41       .warning {
42         /* font-lock-warning-face */
43         color: #ff0000;
44         font-weight: bold;
45       }
46
47       a {
48         color: #FF0000;
49         background-color: inherit;
50         font: inherit;
51         font-weight: bold;
52         text-decoration: underline;
53       }
54       a:hover {
55         color: #FFFFFF;
56         background-color: #FD00FD;
57         text-decoration: underline;
58       }
59       .img a:hover {
60         background-color: #000000;
61         text-decoration: none;
62       }
63     -->
64     </style>
65   </head>
66   <body>
67     <pre>
68 <span class="comment">;; 13-bbdb.el --- Big Brother DataBase (BBDB)
69 </span>
70 <span class="comment">;; Copyright (C) 2007 - 2020 Steve Youngs
71 </span>
72 <span class="comment">;;     Author: Steve Youngs &lt;<a href="mailto:steve&#64;sxemacs.org">steve&#64;sxemacs.org</a>&gt;
73 ;; Maintainer: Steve Youngs &lt;<a href="mailto:steve&#64;sxemacs.org">steve&#64;sxemacs.org</a>&gt;
74 ;;    Created: &lt;2007-12-02&gt;
75 ;; Time-stamp: &lt;Thursday Apr  9, 2020 18:51:53 steve&gt;
76 ;;   Download: &lt;<a href="https://downloads.sxemacs.org/SYinits">https://downloads.sxemacs.org/SYinits</a>&gt;
77 ;;   HTMLised: &lt;<a href="https://www.sxemacs.org/SYinits/13-bbdb.html">https://www.sxemacs.org/SYinits/13-bbdb.html</a>&gt;
78 ;;   Git Repo: git clone https://git.sxemacs.org/syinit
79 ;;   Keywords: init, compile
80 </span>
81 <span class="comment">;; This file is part of SYinit
82 </span>
83 <span class="comment">;; Redistribution and use in source and binary forms, with or without
84 ;; modification, are permitted provided that the following conditions
85 ;; are met:
86 ;;
87 ;; 1. Redistributions of source code must retain the above copyright
88 ;;    notice, this list of conditions and the following disclaimer.
89 ;;
90 ;; 2. Redistributions in binary form must reproduce the above copyright
91 ;;    notice, this list of conditions and the following disclaimer in the
92 ;;    documentation and/or other materials provided with the distribution.
93 ;;
94 ;; 3. Neither the name of the author nor the names of any contributors
95 ;;    may be used to endorse or promote products derived from this
96 ;;    software without specific prior written permission.
97 ;;
98 ;; THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR
99 ;; IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
100 ;; WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
101 ;; DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
102 ;; FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
103 ;; CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
104 ;; SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
105 ;; BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
106 ;; WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
107 ;; OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
108 ;; IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
109 </span>
110 <span class="comment">;;; Commentary:
111 ;;
112 ;;  BBDB settings.
113 ;;
114 </span>
115 <span class="comment">;;; Credits:
116 ;;
117 ;;   The HTML version of this file was created with Hrvoje Niksic's
118 ;;   htmlize.el which is part of the XEmacs "text-modes" package.
119 ;;
120 </span>
121 <span class="comment">;;; Todo:
122 ;;
123 ;;     
124 </span>
125 <span class="comment">;;; Code:
126 ;</span><span class="comment"><span class="reference">:*======================</span></span><span class="comment">
127 ;</span><span class="comment"><span class="reference">:*</span></span><span class="comment"> Some standard stuff first
128 </span>(<span class="keyword">require</span> '<span class="reference">bbdb</span>)
129 (<span class="keyword">require</span> '<span class="reference">bbdb-pgp</span>)
130
131 <span class="comment">;</span><span class="comment"><span class="reference">:*=======================</span></span><span class="comment">
132 ;</span><span class="comment"><span class="reference">:*</span></span><span class="comment"> Make sure gnus stuff is loaded
133 </span>(load-file (expand-file-name "<span class="string">.gnus</span>" (user-home-directory)))
134
135 (bbdb-initialize 'gnus 'message 'w3 'sendmail)
136 (bbdb-insinuate-gnus)
137 (bbdb-insinuate-message)
138 (bbdb-insinuate-sc)
139 (bbdb-insinuate-sendmail)
140 (bbdb-insinuate-w3)
141
142 <span class="comment">;; BBDB/PGP stuff
143 </span>(setq 
144  bbdb/pgp-method 'mml-pgpmime
145  bbdb/pgp-default-action 'sign
146  bbdb/pgp-quiet t)
147
148 (<span class="keyword">defun</span> <span class="function-name">sy-bbdb-gnus-auto-notes-hook</span> (record)
149   "<span class="doc-string">Runs `</span><span class="doc-string"><span class="reference">bbdb-auto-notes-hook</span></span><span class="doc-string">' on the original article.
150 This is so a header doesn't have to be visible for BBDB to notice
151 any changes.
152 Kudos to Robert Fenk &lt;<a href="mailto:fenk&#64;users.sf.net">fenk&#64;users.sf.net</a>&gt; for this.</span>"
153   (<span class="keyword">save-excursion</span>
154     (set-buffer (get-buffer gnus-article-buffer))
155     (set-buffer gnus-original-article-buffer)
156     (goto-char (point-min))
157     (bbdb-auto-notes-hook record)))
158
159 (<span class="keyword">autoload</span> 'gnus-convert-face-to-png "<span class="doc-string">gnus-fun</span>")
160
161 <span class="comment">;;; </span><span class="comment"><span class="warning">FIXME:</span></span><span class="comment"> Not ideal, it currently puts cface at one end of the name,
162 ;;; and the xface at the other.  I'd prefer both glyphs on the same
163 ;;; side (preferrably left)
164 </span>(<span class="keyword">defun</span> <span class="function-name">sy-bbdb-display-cx-face</span> ()
165   "<span class="doc-string">Search for face properties and display the faces.
166 This is from Alex Shroeder.</span>"
167   (<span class="keyword">let</span> ((inhibit-read-only t)<span class="comment">; edit the BBDB buffer
168 </span>        (all-records bbdb-records)
169         cface xface record start ext)
170     (<span class="keyword">while</span> all-records
171       (setq record (caar all-records)
172             cface (bbdb-record-getprop record 'cface)
173             xface (bbdb-record-getprop record 'face)
174             start (marker-position (nth 2 (car all-records))))
175       (<span class="keyword">when</span> (or cface xface)
176         (setq ext (extent-at start)))
177       (<span class="keyword">when</span> cface
178         (set-extent-begin-glyph
179          ext
180          (make-glyph
181           (list (vector 'png <span class="reference">:data</span> (gnus-convert-face-to-png cface))))))
182       (<span class="keyword">when</span> xface
183         (set-extent-end-glyph
184          ext
185          (make-glyph
186           (list (vector 'xface <span class="reference">:data</span> (concat "<span class="string">X-Face: </span>" xface)
187                         <span class="reference">:foreground</span> "<span class="string">black</span>"
188                         <span class="reference">:background</span> "<span class="string">white</span>")))))
189       (setq all-records (cddr all-records)))))
190
191 (setq 
192  bbdb-always-add-addresses t
193  bbdb-canonicalize-redundant-nets-p t
194  bbdb-canonicalize-net-hook
195  (<span class="keyword">lambda</span> (addr)
196    (<span class="keyword">cond</span> 
197     ((string-match 
198       "<span class="string">\\`\\([^0-9]+\\)\\(-dated-[^@]+\\|-[0-9]+\\|\\+[^@]+\\.[^@]+\\)\\(@.*\\)\\'</span>"
199       addr)
200      (concat (substring addr (match-beginning 1) (match-end 1))
201              (substring addr (match-beginning 3) (match-end 3))))
202     (t addr)))
203  bbdb-complete-name-allow-cycling t
204  bbdb-completion-display-record t
205  bbdb-completion-type 'primary-or-name
206  bbdb-default-area-code 7
207  bbdb-dial-local-prefix nil
208  bbdb-display-layout 'multi-line
209  bbdb-dwim-net-address-allow-redundancy t
210  bbdb-electric-p nil
211  bbdb-new-nets-always-primary 'never
212  bbdb-north-american-phone-numbers-p nil
213  bbdb-notice-hook 'sy-bbdb-gnus-auto-notes-hook
214  bbdb-offer-save 'auto
215  bbdb-pop-up-display-layout 'multi-line
216  bbdb-pop-up-target-lines 7
217  bbdb-quiet-about-name-mismatches nil
218  bbdb-use-pop-up nil
219  bbdb/gnus-score-default 25
220  bbdb/gnus-summary-in-bbdb-format-letter "<span class="doc-string">X</span>"
221  bbdb/mail-auto-create-p nil
222  bbdb/news-auto-create-p nil)
223
224 <span class="comment">;</span><span class="comment"><span class="reference">:*=======================</span></span><span class="comment">
225 ;</span><span class="comment"><span class="reference">:*</span></span><span class="comment"> All my email addresses, well the important ones anyway.
226 </span>(<span class="keyword">let</span> ((emails '("<span class="string">steve@steveyoungs.com</span>"
227                 "<span class="string">steve@thereadinglamp.net</span>"
228                 "<span class="string">steve@bastard.steveyoungs.com</span>"
229                 "<span class="string">steve@bastard.no-ip.org</span>"
230                 "<span class="string">steve@sxemacs.org</span>"
231                 "<span class="string">steve@sywriting.com</span>"
232                 "<span class="string">sryoungs@iinet.net.au</span>"
233                 "<span class="string">steve.r.youngs@gmail.com</span>"
234                 <span class="comment">;; The following aren't mine, but I'm using
235 </span>                <span class="comment">;; `</span><span class="comment"><span class="reference">bbdb-user-mail-names</span></span><span class="comment">' in
236 </span>                <span class="comment">;; `gnus-ignored-from-addresses.  It's just easier.
237 </span>                "<span class="string">post@gwene.org</span>")))
238   (setq bbdb-user-mail-names (regexp-opt emails t)))
239
240 <span class="comment">;</span><span class="comment"><span class="reference">:*=======================</span></span><span class="comment">
241 ;</span><span class="comment"><span class="reference">:*</span></span><span class="comment"> Update some stuff automatically
242 </span>(setq bbdb-auto-notes-alist
243       '(("<span class="string">Organization</span>"
244          ("<span class="string">.*</span>" company 0 'replace))
245         ("<span class="string">Newsgroups</span>"
246          ("<span class="string">[^,]+</span>" newsgroups 0))
247         ("<span class="string">Subject</span>"
248          ("<span class="string">.*</span>" last-subj 0 'replace))
249         ("<span class="string">User-Agent</span>" 
250          ("<span class="string">.*</span>" mailer 0 'replace))
251         ("<span class="string">X-Mailer</span>" 
252          ("<span class="string">.*</span>" mailer 0 'replace))
253         ("<span class="string">X-Newsreader</span>" 
254          ("<span class="string">.*</span>" mailer 0 'replace))
255         ("<span class="string">X-Attribution</span>"
256          ("<span class="string">.*</span>" attribution 0 'replace))
257         ("<span class="string">X-Now-Playing</span>"
258          ("<span class="string">.*</span>" music 0 'replace))
259         ("<span class="string">X-Face</span>" 
260          ("<span class="string">.+</span>" face 0 'replace))
261         ("<span class="string">Face</span>" 
262          ("<span class="string">.+</span>" cface 0 'replace))))
263
264 <span class="comment">;</span><span class="comment"><span class="reference">:*=======================</span></span><span class="comment">
265 ;</span><span class="comment"><span class="reference">:*</span></span><span class="comment"> mail aliases
266 </span>(<span class="keyword">autoload</span> 'bbdb-define-all-aliases "<span class="doc-string">bbdb-com</span>" 
267   "<span class="doc-string">Hook mail alias feature of BBDB into message-mode.</span>" t)
268
269 <span class="comment">;</span><span class="comment"><span class="reference">:*=======================</span></span><span class="comment">
270 ;</span><span class="comment"><span class="reference">:*</span></span><span class="comment"> Hooks
271 </span>(add-hook 'bbdb-notice-hook 'bbdb-auto-notes-hook)
272 (add-hook 'bbdb-change-hook 'bbdb-timestamp-hook) 
273 (add-hook 'bbdb-create-hook 'bbdb-creation-date-hook)
274 (add-hook 'bbdb-list-hook 'sy-bbdb-display-cx-face)
275 (add-hook 'message-setup-hook 'bbdb-define-all-aliases)
276 <span class="comment">;</span><span class="comment"><span class="reference">:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::*</span></span><span class="comment">
277 </span>(message "<span class="doc-string">bbdb initialised</span>")
278
279 </pre>
280   <!--  SXEmacs Logo -->
281     <div class="img">
282       <a href="https://www.sxemacs.org/" target="_parent">
283         <img style="padding:0px 5px 0px 0px;border:0;width:88px;height:31px"
284           src="/Images/cbsx.png"
285           title="This page was created entirely in SXEmacs"
286           alt="Created with SXEmacs" />
287       </a>
288 <!--  End SXEmacs Logo -->
289 <!--  Valid XHTML 1.0 -->
290       <a href="http://validator.w3.org/check?uri=https%3a%2f%2fwww.sxemacs.org%2fSYinits%2f13-bbdb.html" target="_blank">
291        <img style="padding:0px 5px 0px 10px;border:0;width:88px;height:31px"
292           src="/Images/valid-xhtml10.png"
293           title="Valid XHTML 1.0 Transitional!"
294           alt="Valid XHTML 1.0 Transitional!" />
295       </a>
296     </div>
297 <!--  End Valid XHTML 1.0 -->
298
299     <h6>Copyright &#169; 2020 Steve Youngs<br />
300      Verbatim copying and distribution is permitted in any medium,
301     providing this notice is preserved.<br />
302 <!-- hhmts start -->
303 Last modified: Wed Apr 15 18:14:43 AEST 2020
304 <!-- hhmts end -->
305    </h6>
306
307 </body>
308 </html>