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">
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">
14 background-color: #000000;
17 /* font-lock-comment-face */
21 /* font-lock-doc-string-face */
25 /* font-lock-function-name-face */
30 /* font-lock-keyword-face */
34 /* font-lock-reference-face */
38 /* font-lock-string-face */
44 background-color: inherit;
47 text-decoration: underline;
51 background-color: #FD00FD;
52 text-decoration: underline;
55 background-color: #000000;
56 text-decoration: none;
63 <span class="comment">;; 15-supercite.el --- Mail citing Settings
65 <span class="comment">;; Copyright (C) 2007 - 2020 Steve Youngs
67 <span class="comment">;; Author: Steve Youngs <<a href="mailto:steve@sxemacs.org">steve@sxemacs.org</a>>
68 ;; Maintainer: Steve Youngs <<a href="mailto:steve@sxemacs.org">steve@sxemacs.org</a>>
69 ;; Created: <2007-12-02>
70 ;; Time-stamp: <Thursday Apr 9, 2020 19:00:53 steve>
71 ;; Download: <<a href="https://downloads.sxemacs.org/SYinits">https://downloads.sxemacs.org/SYinits</a>>
72 ;; HTMLised: <<a href="https://www.sxemacs.org/SYinits/15-supercite.html">https://www.sxemacs.org/SYinits/15-supercite.html</a>>
73 ;; Git Repo: git clone https://git.sxemacs.org/syinit
74 ;; Keywords: init, compile
76 <span class="comment">;; This file is part of SYinit
78 <span class="comment">;; Redistribution and use in source and binary forms, with or without
79 ;; modification, are permitted provided that the following conditions
82 ;; 1. Redistributions of source code must retain the above copyright
83 ;; notice, this list of conditions and the following disclaimer.
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.
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.
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.
105 <span class="comment">;;; Commentary:
107 ;; Setting up citing in Gnus with Supercite.
110 <span class="comment">;;; Credits:
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.
116 <span class="comment">;;; Todo:
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
131 sc-reference-tag-string
132 (sc-hdr "<span class="string">On </span>"
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>"))))
141 (setq sc-rewrite-header-list
144 (sc-header-inarticle-writes)
145 (sc-header-regarding-adds)
146 (sc-header-attributed-writes)
147 (sc-header-author-writes)
149 (sc-no-blank-line-or-header)
150 (sc-header-author-email-writes)
151 (sy-september-citation-line)))
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>"))
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">></span>"
174 sc-extract-address-components 'gnus-extract-address-components)
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.
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))
184 (sig-sep gnus-signature-separator)
186 (<span class="keyword">while</span> sig-sep
188 (<span class="keyword">when</span> (re-search-backward (car sig-sep) start t)
190 (<span class="keyword">while</span> (looking-at "<span class="string">[ \t]*$</span>")
193 (setq mark (set-marker (make-marker) (point)))
194 (delete-region mark (mark t)))
195 (setq sig-sep (cdr sig-sep))))))
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)
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>")
205 <!-- SXEmacs Logo -->
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" />
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!" />
222 <!-- End Valid XHTML 1.0 -->
224 <h6>Copyright © 2020 Steve Youngs<br />
225 Verbatim copying and distribution is permitted in any medium,
226 providing this notice is preserved.<br />
228 Last modified: Wed Apr 15 18:15:32 AEST 2020