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>01-vars.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 */
42 /* font-lock-variable-name-face */
48 background-color: inherit;
51 text-decoration: underline;
55 background-color: #FD00FD;
56 text-decoration: underline;
59 background-color: #000000;
60 text-decoration: none;
67 <span class="comment">;; 01-vars.el --- Various variables
69 <span class="comment">;; Copyright (C) 2007 - 2020 Steve Youngs
71 <span class="comment">;; Author: Steve Youngs <<a href="mailto:steve@sxemacs.org">steve@sxemacs.org</a>>
72 ;; Maintainer: Steve Youngs <<a href="mailto:steve@sxemacs.org">steve@sxemacs.org</a>>
73 ;; Created: <2007-12-02>
74 ;; Time-stamp: <Thursday Apr 9, 2020 06:38:48 steve>
75 ;; Download: <<a href="https://downloads.sxemacs.org/SYinits/">https://downloads.sxemacs.org/SYinits/</a>>
76 ;; HTMLised: <<a href="https://www.sxemacs.org/SYinits/01-vars.html">https://www.sxemacs.org/SYinits/01-vars.html</a>>
77 ;; Git Repo: git clone https://git.sxemacs.org/syinit
78 ;; Keywords: init, compile
80 <span class="comment">;; This file is part of SYinit
82 <span class="comment">;; Redistribution and use in source and binary forms, with or without
83 ;; modification, are permitted provided that the following conditions
86 ;; 1. Redistributions of source code must retain the above copyright
87 ;; notice, this list of conditions and the following disclaimer.
89 ;; 2. Redistributions in binary form must reproduce the above copyright
90 ;; notice, this list of conditions and the following disclaimer in the
91 ;; documentation and/or other materials provided with the distribution.
93 ;; 3. Neither the name of the author nor the names of any contributors
94 ;; may be used to endorse or promote products derived from this
95 ;; software without specific prior written permission.
97 ;; THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR
98 ;; IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
99 ;; WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
100 ;; DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
101 ;; FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
102 ;; CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
103 ;; SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
104 ;; BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
105 ;; WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
106 ;; OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
107 ;; IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
109 <span class="comment">;;; Commentary:
111 ;; This init file sets up a few miscelaneous variables and whatnot.
112 ;; If anything has to be loaded very early in the boot up I'll put
113 ;; it in here because this file is loaded first.
116 <span class="comment">;;; Credits:
118 ;; The HTML version of this file was created with Hrvoje Niksic's
119 ;; htmlize.el which is part of the XEmacs "text-modes" package.
122 <span class="comment">;;; Todo:
126 <span class="comment">;;; Code:
128 <span class="comment">;</span><span class="comment"><span class="reference">:*=======================</span></span><span class="comment">
129 ;</span><span class="comment"><span class="reference">:*</span></span><span class="comment"> Keep garbage collection out of my way.
131 </span>(setq gc-cons-threshold 50000000)
134 <span class="comment">;</span><span class="comment"><span class="reference">:*=======================</span></span><span class="comment">
135 ;</span><span class="comment"><span class="reference">:*</span></span><span class="comment"> Set default font
136 </span>(<span class="keyword">defvar</span> <span class="variable-name">sydeffaces</span>
137 '(default bold bold-italic italic)
138 "<span class="doc-string">List symbols for default fonts.</span>")
141 #'(<span class="keyword">lambda</span> (font)
142 (remove-specifier (face-font font) 'global '(x default) nil))
145 (<span class="keyword">progn</span>
146 (set-face-font 'default
148 "<span class="string">-xos4-terminus-medium-r-*-*-*-150-*-*-*-*-iso8859-*</span>")
149 'global '(x default))
152 "<span class="string">-xos4-terminus-bold-r-*-*-*-150-*-*-*-*-iso8859-*</span>")
153 'global '(x default))
154 (set-face-font 'bold-italic
156 "<span class="string">-*-times-bold-i-*-*-*-140-*-*-*-*-iso8859-*</span>")
157 'global '(x default))
158 (set-face-font 'italic
160 "<span class="string">-*-times-medium-i-*-*-*-140-*-*-*-*-*-*</span>")
161 'global '(x default)))
163 <span class="comment">;</span><span class="comment"><span class="reference">:*=======================</span></span><span class="comment">
164 ;</span><span class="comment"><span class="reference">:*</span></span><span class="comment"> Lossage Messages
165 ;; A lot of the time I'm running some very unstable code. So I set
166 ;; this quite high so I can catch all the help-lossage messages.
167 </span>(setq view-lossage-message-count 1000)
169 <span class="comment">;</span><span class="comment"><span class="reference">:*=======================</span></span><span class="comment">
170 ;</span><span class="comment"><span class="reference">:*</span></span><span class="comment"> SXEmacs has a sane filename for custom-file
171 </span>(<span class="keyword">unless</span> (<span class="keyword">featurep</span> '<span class="reference">sxemacs</span>)
173 (expand-file-name "<span class="string">custom-steve.el</span>" user-init-directory))
174 (load-file custom-file))
176 <span class="comment">;</span><span class="comment"><span class="reference">:*=======================</span></span><span class="comment">
177 ;</span><span class="comment"><span class="reference">:*</span></span><span class="comment"> Set the default font
178 </span>(set-face-property
180 'face "<span class="doc-string">-*-Terminus-medium-r-*-*-*-140-*-*-*-*-iso8859-*</span>")
182 <span class="comment">;</span><span class="comment"><span class="reference">:*=======================</span></span><span class="comment">
183 ;</span><span class="comment"><span class="reference">:*</span></span><span class="comment"> Stuff. Lots of stuff...
186 buffers-menu-grouping-function
187 'group-buffers-menu-by-mode-then-alphabetically
188 buffers-menu-sort-function
189 'sort-buffers-menu-by-mode-then-alphabetically
190 buffers-menu-submenus-for-groups-p t
193 get-frame-for-buffer-default-instance-limit nil
194 mouse-yank-at-point t
195 next-line-add-newlines nil
197 require-final-newline t
198 teach-extended-commands-p t
199 teach-extended-commands-timeout 5
200 temp-buffer-show-function 'show-temp-buffer-in-current-frame
203 (<span class="keyword">defvar</span> <span class="variable-name">gnus-directory</span> (paths-construct-path
204 (list (user-home-directory) "<span class="string">Gnus</span>"))
205 "<span class="doc-string">Gnus directory.</span>")
207 (<span class="keyword">defvar</span> <span class="variable-name">message-directory</span> (paths-construct-path
208 (list (user-home-directory) "<span class="string">Gnus</span>"))
209 "<span class="doc-string">Gnus directory.</span>")
212 <span class="comment">;</span><span class="comment"><span class="reference">:*=======================</span></span><span class="comment">
213 ;</span><span class="comment"><span class="reference">:*</span></span><span class="comment"> Unicode shit
214 ;(unless (fboundp 'ucs-to-char)
215 </span>(<span class="keyword">when</span> (<span class="keyword">featurep</span> '(and mule mule-ucs-autoloads))
216 <span class="comment">;; Order is important here
217 </span> (<span class="keyword">progn</span>
218 (<span class="keyword">require</span> '<span class="reference">tae</span>)
219 (<span class="keyword">require</span> '<span class="reference">un-define</span>)
220 (set-coding-priority-list '(utf-8))
221 (set-coding-category-system 'utf-8 'utf-8))
222 (and (coding-system-p (find-coding-system 'utf-8))
223 (setq-default buffer-file-coding-system
225 (find-coding-system 'utf-8)))))
227 <span class="comment">;</span><span class="comment"><span class="reference">:*=======================</span></span><span class="comment">
228 ;</span><span class="comment"><span class="reference">:*</span></span><span class="comment"> Fix #'run-at-time
229 ;; You get an `</span><span class="comment"><span class="reference">args-out-of-range</span></span><span class="comment">' error if you try to set a #'run-at-time
230 ;; to go off in the past. That's not as silly as it sounds, think of
231 ;; things you want to run once per day. At some point the 'time' will be
232 ;; in the past for the current day.
233 </span>(or (<span class="keyword">featurep</span> '<span class="reference">timer-funcs</span>)
234 (<span class="keyword">require</span> '<span class="reference">timer-funcs</span>))
236 (<span class="keyword">defadvice</span> <span class="function-name">run-at-time</span> (before future-run-at-time first activate)
237 "<span class="doc-string">If TIME is in the past, set it for tomorrow.</span>"
238 (<span class="keyword">when</span> (stringp time)
239 (<span class="keyword">let</span> ((tspec (timer-parse-time time)))
240 (<span class="keyword">if</span> tspec
241 (<span class="keyword">progn</span>
244 (itimer-time-difference tspec (current-time))))
245 (<span class="keyword">if</span> (< time 0)
246 (setq time (+ time 86400))))))))
248 <span class="comment">;</span><span class="comment"><span class="reference">:*=======================</span></span><span class="comment">
249 ;</span><span class="comment"><span class="reference">:*</span></span><span class="comment"> Here because sometimes... order important it is
250 </span>(<span class="keyword">require</span> '<span class="reference">ffi-wand</span>)
252 <span class="comment">;</span><span class="comment"><span class="reference">:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::*</span></span><span class="comment">
253 </span>(message "<span class="doc-string">variables initialiased</span>")
255 <!-- SXEmacs Logo -->
257 <a href="https://www.sxemacs.org/" target="_parent">
258 <img style="padding:0px 5px 0px 0px;border:0;width:88px;height:31px"
259 src="/Images/cbsx.png"
260 title="This page was created entirely in SXEmacs"
261 alt="Created with SXEmacs" />
263 <!-- End SXEmacs Logo -->
264 <!-- Valid XHTML 1.0 -->
265 <a href="http://validator.w3.org/check?uri=https%3a%2f%2fwww.sxemacs.org%2fSYinits%2f01-vars.html" target="_blank">
266 <img style="padding:0px 5px 0px 10px;border:0;width:88px;height:31px"
267 src="/Images/valid-xhtml10.png"
268 title="Valid XHTML 1.0 Transitional!"
269 alt="Valid XHTML 1.0 Transitional!" />
272 <!-- End Valid XHTML 1.0 -->
274 <h6>Copyright © 2020 Steve Youngs<br />
275 Verbatim copying and distribution is permitted in any medium,
276 providing this notice is preserved.<br />
278 Last modified: Wed Apr 15 18:12:00 AEST 2020