about summary refs log tree commit diff stats
path: root/early-init.el
blob: 0738ca233b83ff5b64b380b188c02ae499db951c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
;;; early-init.el -*- no-byte-compile: t; coding: utf-8 -*-
;; Copyright (C) 2020 Case Duckworth

;; Author: Case Duckworth <acdw@acdw.net>
;; Created: Sometime during the Covid-19 lockdown, 2019
;; Keywords: configuration
;; URL: https://tildegit.org/acdw/emacs

;; This file is not part of GNU Emacs.

;;; Commentary:
;; This file is automatically tangled from config.org.
;; Hand edits will be overwritten!

;;; Code:

;; BOOTSTRAP PACKAGE MANAGEMENT
(let ((win-app-dir "~/Applications"))
  (dolist (path (list
                 ;; Windows
                 (expand-file-name "exe" win-app-dir)
                 (expand-file-name "exe/bin" win-app-dir)
                 (expand-file-name "Git/bin" win-app-dir)
                 (expand-file-name "Git/usr/bin" win-app-dir)
                 (expand-file-name "Git/mingw64/bin" win-app-dir)
                 (expand-file-name "Everything" win-app-dir)
                 (expand-file-name "Win-builds/bin" win-app-dir)
                 (expand-file-name "Z/bin" win-app-dir)
                 ;; Linux
                 (expand-file-name "bin" user-emacs-directory)
                 (expand-file-name "~/bin")
                 (expand-file-name "~/.local/bin")
                 (expand-file-name "~/Scripts")
                 ))
    (when (file-exists-p path)
      (add-to-list 'exec-path path :append))))

;; Set $PATH
(setenv "PATH" (mapconcat #'identity exec-path path-separator))
(setq package-enable-at-startup nil)
(defun acdw/bootstrap-straight ()
  "Bootstrap straight.el."
  (defvar bootstrap-version)
  (let ((bootstrap-file
         (expand-file-name
          "straight/repos/straight.el/bootstrap.el"
          user-emacs-directory))
        (bootstrap-version 5))
    (unless (file-exists-p bootstrap-file)
      (with-current-buffer
          (url-retrieve-synchronously
           (concat
            "https://raw.githubusercontent.com/"
            "raxod502/straight.el/develop/install.el")
           'silent 'inhibit-cookies)
        (goto-char (point-max))
        (eval-print-last-sexp)))
    (load bootstrap-file nil 'nomessage)))
(when (executable-find "git")
  (unless (ignore-errors (acdw/bootstrap-straight))
    (let ((msg "Straight.el didn't bootstrap correctly.  Cloning directly"))
      (message "%s..." msg)
      (call-process "git" nil
                    (get-buffer-create "*bootstrap-straight-messages*") nil
                    "clone"
                    "https://github.com/raxod502/straight.el"
                    (expand-file-name "straight/repos/straight.el"
                                      user-emacs-directory))
      (message "%s...Done." msg)
      (acdw/bootstrap-straight))))
;; SETUP FRAME
(add-to-list 'default-frame-alist
             '(tool-bar-lines . 0))

(tool-bar-mode -1)
(add-to-list 'default-frame-alist
             '(menu-bar-lines . 0))

(menu-bar-mode -1)
(add-to-list 'default-frame-alist
             '(vertical-scroll-bars . nil)
             '(horizontal-scroll-bars . nil))

(scroll-bar-mode -1)
(horizontal-scroll-bar-mode -1)
(setq-default frame-inhibit-implied-resize t
              frame-resize-pixelwise t)

;;; early-init.el ends here