Loads more updates -- large assortment of stuffs
[syinit] / 01-vars-sy.el
1 ;; 01-vars-sy.el --- Various variables
2
3 ;; Copyright (C) 2007 - 2020 Steve Youngs
4
5 ;;     Author: Steve Youngs <steve@sxemacs.org>
6 ;; Maintainer: Steve Youngs <steve@sxemacs.org>
7 ;;    Created: <2007-12-02>
8 ;; Time-stamp: <Sunday Mar  8, 2020 11:17:00 steve>
9 ;;   Download: <http://bastard.steveyoungs.com/~steve/SXEmacs/inits/>
10 ;;   HTMLised: <http://bastard.steveyoungs.com/~steve/SXEmacs/htmlinits/01-vars-sy.html>
11 ;;   Git Repo: git clone https://git.sxemacs.org/syinit
12 ;;   Keywords: init, compile
13
14 ;; This file is part of SYinit
15
16 ;; Redistribution and use in source and binary forms, with or without
17 ;; modification, are permitted provided that the following conditions
18 ;; are met:
19 ;;
20 ;; 1. Redistributions of source code must retain the above copyright
21 ;;    notice, this list of conditions and the following disclaimer.
22 ;;
23 ;; 2. Redistributions in binary form must reproduce the above copyright
24 ;;    notice, this list of conditions and the following disclaimer in the
25 ;;    documentation and/or other materials provided with the distribution.
26 ;;
27 ;; 3. Neither the name of the author nor the names of any contributors
28 ;;    may be used to endorse or promote products derived from this
29 ;;    software without specific prior written permission.
30 ;;
31 ;; THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR
32 ;; IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
33 ;; WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
34 ;; DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
35 ;; FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
36 ;; CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
37 ;; SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
38 ;; BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
39 ;; WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
40 ;; OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
41 ;; IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
42
43 ;;; Commentary:
44 ;;
45 ;;   This init file sets up a few miscelaneous variables and whatnot.
46 ;;   If anything has to be loaded very early in the boot up I'll put
47 ;;   it in here because this file is loaded first.
48 ;;
49
50 ;;; Credits:
51 ;;
52 ;;   The HTML version of this file was created with Hrvoje Niksic's
53 ;;   htmlize.el which is part of the XEmacs "text-modes" package.
54 ;;
55
56 ;;; Todo:
57 ;;
58 ;;     
59
60 ;;; Code:
61
62 ;:*=======================
63 ;:* Keep garbage collection out of my way.
64 ;;
65 (setq gc-cons-threshold 50000000)
66
67
68 ;:*=======================
69 ;:* Set default font (I do this in vars-sy.el because it is called first)
70 (defvar sydeffaces
71   '(default bold bold-italic italic)
72   "List symbols for default fonts.")
73
74 (mapc
75  #'(lambda (font)
76      (remove-specifier (face-font font) 'global '(x default) nil))
77  sydeffaces)
78
79 (progn
80   (set-face-font 'default
81                  (make-font-instance
82                   "-xos4-terminus-medium-r-*-*-*-150-*-*-*-*-iso8859-*")
83                  'global '(x default))
84   (set-face-font 'bold
85                  (make-font-instance
86                   "-xos4-terminus-bold-r-*-*-*-150-*-*-*-*-iso8859-*")
87                  'global '(x default))
88   (set-face-font 'bold-italic
89                  (make-font-instance
90                   "-*-times-bold-i-*-*-*-140-*-*-*-*-iso8859-*")
91                  'global '(x default))
92   (set-face-font 'italic
93                  (make-font-instance
94                   "-*-times-medium-i-*-*-*-140-*-*-*-*-*-*")
95                  'global '(x default)))
96
97 ;:*=======================
98 ;:* Lossage Messages
99 ;; A lot of the time I'm running some very unstable code.  So I set
100 ;; this quite high so I can catch all the help-lossage messages.
101 (setq view-lossage-message-count 1000)
102
103 ;:*=======================
104 ;:* SXEmacs has a sane filename for custom-file
105 (unless (featurep 'sxemacs)
106   (setq custom-file
107         (expand-file-name "custom-steve.el" user-init-directory))
108   (load-file custom-file))
109
110 ;:*=======================
111 ;:* Set the default font
112 (set-face-property
113  'default
114  'face "-*-Terminus-medium-r-*-*-*-140-*-*-*-*-iso8859-*")
115
116 ;:*=======================
117 ;:* Stuff. Lots of stuff...
118
119 (setq-default
120  buffers-menu-grouping-function
121  'group-buffers-menu-by-mode-then-alphabetically
122  buffers-menu-sort-function
123  'sort-buffers-menu-by-mode-then-alphabetically
124  buffers-menu-submenus-for-groups-p t
125  case-fold-search t
126  case-replace t
127  get-frame-for-buffer-default-instance-limit nil
128  mouse-yank-at-point t
129  next-line-add-newlines nil
130  overwrite-mode nil
131  require-final-newline t
132  teach-extended-commands-p t
133  teach-extended-commands-timeout 5
134  temp-buffer-show-function 'show-temp-buffer-in-current-frame
135  zmacs-regions t)
136
137 (defvar gnus-directory (paths-construct-path 
138                         (list (user-home-directory) "Gnus"))
139   "Gnus directory.")
140    
141 (defvar message-directory (paths-construct-path 
142                            (list (user-home-directory) "Gnus"))
143   "Gnus directory.")
144
145
146 ;:*=======================
147 ;:* Unicode shit
148 ;(unless (fboundp 'ucs-to-char)
149 (when (featurep '(and mule mule-ucs-autoloads))
150   ;; Order is important here
151   (progn
152     (require 'tae)
153     (require 'un-define))
154   (and (coding-system-p (find-coding-system 'utf-8))
155        (setq-default buffer-file-coding-system
156                      (coding-system-name
157                       (find-coding-system 'utf-8)))))
158 ;)
159
160 ;:*=======================
161 ;:* Fix #'run-at-time
162 ;;  You get an `args-out-of-range' error if you try to set a #'run-at-time
163 ;;  to go off in the past.  That's not as silly as it sounds, think of
164 ;;  things you want to run once per day.  At some point the 'time' will be
165 ;;  in the past for the current day.
166 (or (featurep 'timer-funcs)
167     (require 'timer-funcs))
168
169 (defadvice run-at-time (before future-run-at-time first activate)
170   "If TIME is in the past, set it for tomorrow."
171   (when (stringp time)
172     (let ((tspec (timer-parse-time time)))
173       (if tspec
174           (progn
175             (setq time
176                   (ceiling
177                    (itimer-time-difference tspec (current-time))))
178             (if (< time 0)
179                 (setq time (+ time 86400))))))))
180    
181 ;:*=======================
182 ;:* Here because sometimes... order important it is
183 (require 'ffi-wand)
184
185 ;:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::*
186 (message "variables initialiased")