;;; pre-settings.el --- Summary -*- lexical-binding: t -*- ;;; Commentary: ;;; Code: (mapc (lambda (item) (add-to-list 'load-path item)) '( "~/.config/emacs/settings" ;; path where settings files are kept "~/.config/emacs/lisp" ;; personal elisp lib dir, for manually installed packages "~/.config/emacs/lisp/dash" "~/.config/emacs/lisp/with-editor" "~/.config/emacs/lisp/hydra" ;; required by treemacs org-ref "~/.config/emacs/lisp/async" ;; https://melpa.org/#/async required by ob-async "~/.config/emacs/lisp/persist" ;; https://elpa.gnu.org/packages/persist.html required by org-drill "~/.config/emacs/lisp/use-package" ;; https://melpa.org/#/use-package )) (setq gc-cons-threshold (* 50 1000 1000)) ;; Make startup faster by reducing the frequency of garbage collection. The default is 800 kilobytes. Measured in bytes. Will be decreased again at the end. ;; count startup time (add-hook 'emacs-startup-hook ;; Use a hook so the message doesn't get clobbered by other messages. (lambda () (message "Emacs ready in %s with %d garbage collections." (format "%.2f seconds" (float-time (time-subtract after-init-time before-init-time))) gcs-done))) (require 'use-package) ;; requires bind-key (setq use-package-verbose t) (use-package delight) ;; used for use-package :delight, see delight-delighted-modes ;; ;; functions ;; (defun my-font-installed-p (font-name) "Check if font with FONT-NAME is available." (when (find-font (font-spec :name "all-the-icons")) t)) ;; ;; variables ;; (defvar running-on-windows (memq system-type '(windows-nt cygwin32 cygwin)) "Non-nil if and only if we're running on Windows. Both Win32 and Cygwin count.") (setq user-emacs-directory "~/.config/emacs/") (defconst user-cache-directory (file-name-as-directory (concat user-emacs-directory ".cache")) "My Emacs storage area for persistent files.") ;; create the `user-cache-directory' if not exists (make-directory user-cache-directory t) (defvar my-dbusp (and (boundp 'dbus-compiled-version) ;; t on WSL Debian machine (if (require 'dbus) (dbus-ping :session "org.freedesktop.Notifications"))) ;; is not enough "Check if DBus is available.") (use-package cus-edit :config (setq custom-file (concat user-emacs-directory "custom.el")) (setq custom-buffer-done-kill t) (load custom-file t t)) (provide 'pre-settings) ;;; pre-settings.el ends here