Add HTML versions of my init files
[website] / SYinits / 15-supercite.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>15-supercite.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
42       a {
43         color: #FF0000;
44         background-color: inherit;
45         font: inherit;
46         font-weight: bold;
47         text-decoration: underline;
48       }
49       a:hover {
50         color: #FFFFFF;
51         background-color: #FD00FD;
52         text-decoration: underline;
53       }
54       .img a:hover {
55         background-color: #000000;
56         text-decoration: none;
57       }
58     -->
59     </style>
60   </head>
61   <body>
62     <pre>
63 <span class="comment">;; 15-supercite.el --- Mail citing Settings
64 </span>
65 <span class="comment">;; Copyright (C) 2007 - 2020 Steve Youngs
66 </span>
67 <span class="comment">;;     Author: Steve Youngs &lt;<a href="mailto:steve&#64;sxemacs.org">steve&#64;sxemacs.org</a>&gt;
68 ;; Maintainer: Steve Youngs &lt;<a href="mailto:steve&#64;sxemacs.org">steve&#64;sxemacs.org</a>&gt;
69 ;;    Created: &lt;2007-12-02&gt;
70 ;; Time-stamp: &lt;Thursday Apr  9, 2020 19:00:53 steve&gt;
71 ;;   Download: &lt;<a href="https://downloads.sxemacs.org/SYinits">https://downloads.sxemacs.org/SYinits</a>&gt;
72 ;;   HTMLised: &lt;<a href="https://www.sxemacs.org/SYinits/15-supercite.html">https://www.sxemacs.org/SYinits/15-supercite.html</a>&gt;
73 ;;   Git Repo: git clone https://git.sxemacs.org/syinit
74 ;;   Keywords: init, compile
75 </span>
76 <span class="comment">;; This file is part of SYinit
77 </span>
78 <span class="comment">;; Redistribution and use in source and binary forms, with or without
79 ;; modification, are permitted provided that the following conditions
80 ;; are met:
81 ;;
82 ;; 1. Redistributions of source code must retain the above copyright
83 ;;    notice, this list of conditions and the following disclaimer.
84 ;;
85 ;; 2. Redistributions in binary form must reproduce the above copyright
86 ;;    notice, this list of conditions and the following disclaimer in the
87 ;;    documentation and/or other materials provided with the distribution.
88 ;;
89 ;; 3. Neither the name of the author nor the names of any contributors
90 ;;    may be used to endorse or promote products derived from this
91 ;;    software without specific prior written permission.
92 ;;
93 ;; THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR
94 ;; IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
95 ;; WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
96 ;; DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
97 ;; FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
98 ;; CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
99 ;; SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
100 ;; BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
101 ;; WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
102 ;; OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
103 ;; IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
104 </span>
105 <span class="comment">;;; Commentary:
106 ;;
107 ;;   Setting up citing in Gnus with Supercite.
108 ;;
109 </span>
110 <span class="comment">;;; Credits:
111 ;;
112 ;;   The HTML version of this file was created with Hrvoje Niksic's
113 ;;   htmlize.el which is part of the XEmacs "text-modes" package.
114 ;;
115 </span>
116 <span class="comment">;;; Todo:
117 ;;
118 ;;     
119 </span>
120 <span class="comment">;;; Code:
121 </span>(<span class="keyword">require</span> '<span class="reference">supercite</span>)
122 (<span class="keyword">require</span> '<span class="reference">time-date</span>)
123 <span class="comment">;; Warning: This triggers a bug that has been fixed in an as yet to be
124 ;; released SXEmacs Gnus package.  Sorry.  I will get the packages out
125 ;; as soon as I can.  This was as of: [2020-04-09]
126 </span>(<span class="keyword">defun</span> <span class="function-name">sy-september-citation-line</span> ()
127   (<span class="keyword">let</span> ((sc-mumble "")
128         (whofrom (sc-whofrom)))
129     (<span class="keyword">when</span> whofrom
130       (insert
131        sc-reference-tag-string
132        (sc-hdr "<span class="string">On </span>"
133                (int-to-string
134                 (- (time-to-days (mail-header-parse-date
135                                   (sc-mail-field "<span class="string">date</span>")))
136                    (time-to-days (encode-time 0 0 0 01 09 1993))))
137                "<span class="string"> September 1993, </span>")
138        (sc-mail-field "<span class="string">sc-author</span>")
139        "<span class="string"> wrote:\n</span>"))))
140
141 (setq sc-rewrite-header-list 
142       '((sc-no-header) 
143         (sc-header-on-said) 
144         (sc-header-inarticle-writes) 
145         (sc-header-regarding-adds) 
146         (sc-header-attributed-writes) 
147         (sc-header-author-writes) 
148         (sc-header-verbose) 
149         (sc-no-blank-line-or-header)
150         (sc-header-author-email-writes)
151         (sy-september-citation-line)))
152
153 (setq sc-preferred-attribution-list
154       '("<span class="string">sc-lastchoice</span>"
155         "<span class="string">x-attribution</span>"
156         "<span class="string">sc-consult</span>"
157         "<span class="string">initials</span>"
158         "<span class="string">firstname</span>"
159         "<span class="string">emailname</span>"
160         "<span class="string">lastname</span>"))
161
162 (setq 
163  message-cite-function 'sc-cite-original
164  sc-confirm-always-p nil
165  sc-preferred-header-style 4
166  sc-auto-fill-region-p t
167  sc-fixup-whitespace-p t
168  sc-electric-references-p t
169  sc-cite-blank-lines-p nil
170  sc-nested-citation-p nil
171  sc-citation-separator "<span class="doc-string"> </span>"
172  sc-reference-tag-string "<span class="doc-string">|--> </span>"
173  sc-citation-delimiter "<span class="doc-string">&gt;</span>"
174  sc-extract-address-components 'gnus-extract-address-components)
175
176 (<span class="keyword">defun</span> <span class="function-name">sy-sc-remove-signature</span> ()
177   "<span class="doc-string">Removes the signature from the original message.
178
179 To use, hang it off the appropriate hook such as `</span><span class="doc-string"><span class="reference">sc-pre-hook</span></span><span class="doc-string">' so
180 you're not citing useless stuff.</span>"
181   (<span class="keyword">save-excursion</span>
182     (<span class="keyword">let</span> ((start (point))
183           (end (mark t))
184           (sig-sep gnus-signature-separator)
185           mark)
186       (<span class="keyword">while</span> sig-sep
187         (goto-char end)
188         (<span class="keyword">when</span> (re-search-backward (car sig-sep) start t)
189           (forward-line -1)
190           (<span class="keyword">while</span> (looking-at "<span class="string">[ \t]*$</span>")
191             (forward-line -1))
192           (forward-line 1)
193           (setq mark (set-marker (make-marker) (point)))
194           (delete-region mark (mark t)))
195         (setq sig-sep (cdr sig-sep))))))
196
197 (add-hook 'sc-load-hook 'sc-setup-filladapt)
198 (add-hook 'sc-pre-hook 'sy-sc-remove-signature)
199 (add-hook 'mail-citation-hook 'sc-cite-original)
200
201 <span class="comment">;</span><span class="comment"><span class="reference">:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::</span></span><span class="comment">
202 </span>(message "<span class="doc-string">Supercite settings loaded successfully</span>")
203
204 </pre>
205   <!--  SXEmacs Logo -->
206     <div class="img">
207       <a href="https://www.sxemacs.org/" target="_parent">
208         <img style="padding:0px 5px 0px 0px;border:0;width:88px;height:31px"
209           src="/Images/cbsx.png"
210           title="This page was created entirely in SXEmacs"
211           alt="Created with SXEmacs" />
212       </a>
213 <!--  End SXEmacs Logo -->
214 <!--  Valid XHTML 1.0 -->
215       <a href="http://validator.w3.org/check?uri=https%3a%2f%2fwww.sxemacs.org%2fSYinits%2f15-supercite.html" target="_blank">
216        <img style="padding:0px 5px 0px 10px;border:0;width:88px;height:31px"
217           src="/Images/valid-xhtml10.png"
218           title="Valid XHTML 1.0 Transitional!"
219           alt="Valid XHTML 1.0 Transitional!" />
220       </a>
221     </div>
222 <!--  End Valid XHTML 1.0 -->
223
224     <h6>Copyright &#169; 2020 Steve Youngs<br />
225      Verbatim copying and distribution is permitted in any medium,
226     providing this notice is preserved.<br />
227 <!-- hhmts start -->
228 Last modified: Wed Apr 15 18:15:32 AEST 2020
229 <!-- hhmts end -->
230    </h6>
231
232 </body>
233 </html>