;;; emacs-core.el --- Summary
;;; Commentary:
;;; Code:

;; -*- lexical-binding: t; -*-

(setq gc-cons-threshold (* 500 1024 1024))

(add-hook 'after-init-hook (lambda () (setq gc-cons-threshold (* 5 1024 1024))))

(setq straight-use-package-by-default t)
(require 'use-package)
(straight-use-package 'diminish)
(require 'diminish)

(unless (file-directory-p (expand-file-name "~/.emacs.d/straight/versions")) (make-directory (expand-file-name "~/.emacs.d/straight/versions") t))
(use-package org)

(setq custom-file (expand-file-name "custom.el" user-emacs-directory))
(when (file-exists-p custom-file) (load custom-file))

(defvar my-laptop-p (equal (system-name) "lilitop"))
(defvar my-server-p (and (equal (system-name) "localhost") (equal user-login-name "root")))
(defvar my-phone-p (not (null (getenv "ANDROID_ROOT")))
  "If non-nil, GNU Emacs is running on Termux.")
(when my-phone-p (defvar gnutls-algorithm-priority "NORMAL:-VERS-TLS1.3"))
(global-auto-revert-mode)  ; simplifies syncing

(savehist-mode)

(when (fboundp 'flycheck-mode)
  (setq flycheck-global-modes nil)
  (global-flycheck-mode -1))
(when (fboundp 'flymake-mode)
  (setq help-at-pt-display-when-idle t)
  ;; Disable flymake in all buffers
  (add-hook 'find-file-hook (lambda () (flymake-mode -1))))

(use-package magit)

(setq user-full-name "Amr Gharbeia")
(defvar email-address "amr@gharbeia.net")
(defvar calendar-latitude 39.0)
(defvar calendar-longitude -77.1)
(defvar calendar-location-name "Washington, DC")
(defvar calendar-time-zone -300)
(defvar calendar-standard-time-zone-name "EST")
(defvar calendar-daylight-time-zone-name "EDT")

(add-hook 'server-done-hook (lambda () (delete-frame)))

(desktop-save-mode t)

(use-package password-store)

(use-package auth-source
  :config (auth-source-pass-enable)
  )

(provide 'emacs-core)
;;; emacs-core.el ends here
