dotfiles/.config/emacs/core/earnecore-pkg.el

51 lines
1.8 KiB
EmacsLisp
Raw Normal View History

;;; earnecore-pkg.el --- Misc -*- lexical-binding: t; -*-
;; Copyright (C) 2020-2021 earnest ma
;; SPDX-License-Identifier: MIT
;; Author: earnest ma <me@earne.link>
;;; Code:
;; Keep the emacs config directory clean
(use-package no-littering
:demand
:config
;; Exclude directories from recentf
(with-eval-after-load 'recentf
(add-to-list 'recentf-exclude no-littering-etc-directory)
(add-to-list 'recentf-exclude no-littering-var-directory))
(setq ; save some files to different files for daemon(s)
recentf-save-file (concat no-littering-var-directory
"recentf-save-" earnemacs-daemon-name ".el")
bookmark-default-file (concat no-littering-var-directory
"bookmark-" earnemacs-daemon-name ".el")
projectile-cache-file (concat no-littering-var-directory
"projectile/cache-" earnemacs-daemon-name ".el")
projectile-known-projects-file (concat no-littering-var-directory
"projectile/known-projects-"
earnemacs-daemon-name ".el")))
;; Do not keep or load a custom file
(setq custom-file (expand-file-name
(format
"custom-%d-%d.el" (emacs-pid) (random))
temporary-file-directory))
;; Native comp adjustments
(defun earnemacs--native-comp-adjustments ()
"Adjustments when using Emacs built with native compilation."
(setq comp-async-report-warnings-errors nil))
(if (and (fboundp 'native-comp-available-p)
(native-comp-available-p))
(earnemacs--native-comp-adjustments))
;; Inherit environment variables from shell
(use-package exec-path-from-shell
:if (or *sys-bsd* *sys-linux* *sys-mac*)
:init
(exec-path-from-shell-initialize))
(provide 'earnecore-pkg)
;;; earnecore-pkg.el ends here