Loads and loads and loads of updates.
[syinit] / 01-vars-sy.el
index 2523577..87db01d 100644 (file)
@@ -1,11 +1,11 @@
 ;; 01-vars-sy.el --- Various variables   -*- Emacs-Lisp -*-
 
-;; Copyright (C) 2007 - 2013 Steve Youngs
+;; Copyright (C) 2007 - 2020 Steve Youngs
 
 ;;     Author: Steve Youngs <steve@sxemacs.org>
 ;; Maintainer: Steve Youngs <steve@sxemacs.org>
 ;;    Created: <2007-12-02>
-;; Time-stamp: <Thursday Dec 31, 2015 01:15:40 steve>
+;; Time-stamp: <Wednesday Feb 12, 2020 13:35:35 steve>
 ;;   Download: <http://bastard.steveyoungs.com/~steve/SXEmacs/inits/>
 ;;   HTMLised: <http://bastard.steveyoungs.com/~steve/SXEmacs/htmlinits/01-vars-sy.html>
 ;;   Git Repo: git clone http://git.sxemacs.org/syinit
 ;;     
 
 ;;; Code:
+
+;:*=======================
+;:* Keep garbage collection out of my way.
+;;
+(setq gc-cons-threshold 50000000)
+
+
 ;:*=======================
 ;:* Set default font (I do this in vars-sy.el because it is called first)
 (defvar sydeffaces
 
 ;:*=======================
 ;:* Set the default font
-(set-face-property 'default 'face "-*-Terminus-medium-r-*-*-*-140-*-*-*-*-iso8859-*")
+(set-face-property
+ 'default
+ 'face "-*-Terminus-medium-r-*-*-*-140-*-*-*-*-iso8859-*")
 
 ;:*=======================
 ;:* Stuff. Lots of stuff...
 
 (setq-default
- buffers-menu-grouping-function 'group-buffers-menu-by-mode-then-alphabetically
- buffers-menu-sort-function 'sort-buffers-menu-by-mode-then-alphabetically
+ buffers-menu-grouping-function
+ 'group-buffers-menu-by-mode-then-alphabetically
+ buffers-menu-sort-function
+ 'sort-buffers-menu-by-mode-then-alphabetically
  buffers-menu-submenus-for-groups-p t
  case-fold-search t
  case-replace t
   "Gnus directory.")
    
 (defvar message-directory (paths-construct-path 
-                       (list (user-home-directory) "Gnus"))
+                          (list (user-home-directory) "Gnus"))
   "Gnus directory.")
 
 
 ;:*=======================
 ;:* Unicode shit
-(unless (fboundp 'ucs-to-char)
-  (when (featurep '(and mule mule-ucs-autoloads))
-    (require 'un-define)
-    (and (coding-system-p (find-coding-system 'utf-8))
-        (setq-default buffer-file-coding-system
-                      (coding-system-name
-                       (find-coding-system 'utf-8))))))
+;; (unless (fboundp 'ucs-to-char)
+;;   (when (featurep '(and mule mule-ucs-autoloads))
+;;     (require 'un-define)
+;;     (and (coding-system-p (find-coding-system 'utf-8))
+;;      (setq-default buffer-file-coding-system
+;;                    (coding-system-name
+;;                     (find-coding-system 'utf-8))))))
+
+;:*=======================
+;:* Fix #'run-at-time
+;;  You get an `args-out-of-range' error if you try to set a #'run-at-time
+;;  to go off in the past.  That's not as silly as it sounds, think of
+;;  things you want to run once per day.  At some point the 'time' will be
+;;  in the past for the current day.
+(or (featurep 'timer-funcs)
+    (require 'timer-funcs))
+
+(defadvice run-at-time (before future-run-at-time first activate)
+  "If TIME is in the past, set it for tomorrow."
+  (when (stringp time)
+    (let ((tspec (timer-parse-time time)))
+      (if tspec
+         (progn
+           (setq time
+                 (ceiling
+                  (itimer-time-difference tspec (current-time))))
+           (if (< time 0)
+               (setq time (+ time 86400))))))))
    
+;:*=======================
+;:* Here because sometimes... order important it is
+(require 'ffi-wand)
+
 ;:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::*
 (message "variables initialiased")