I showed you my source code, pls respond
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

68 lines
2.4 KiB

4 years ago
  1. ;; Emacs creates a lot of files relative to `user-emacs-directory'.
  2. ;; These files are not part of this immutable configuration and do not belong in the emacs directory.
  3. (defconst dotfiles/home
  4. (or (getenv "DOTFILES_HOME")
  5. (expand-file-name user-emacs-directory)))
  6. (defconst dotfiles/cache
  7. (or (getenv "DOTFILES_CACHE")
  8. (expand-file-name "~/.cache/emacs")))
  9. ;; How can we solve this issue?
  10. (unless (file-exists-p dotfiles/cache)
  11. (make-directory dotfiles/cache t))
  12. ;; Shortly after initialization, before most packages load, we change the value to `dotfiles/cache'.
  13. ;; I elaborate more on the technique in my post https://chrishayward.xyz/immutable-emacs/.
  14. (setq user-emacs-directory dotfiles/cache)
  15. ;; Disable error messages for packages that do not yet support native compilation.
  16. (setq comp-async-report-warnings-errors nil)
  17. ;; Because this project uses version-control, we can disable more unwanted features:
  18. ;; + Lock files
  19. ;; + Backup files
  20. (setq make-backup-files nil
  21. create-lockfiles nil)
  22. ;; Download and instll packages using https://github.com/raxod502/straight.el
  23. ;; It's a functional package manager that integrates with https://github.com/jwiegley/use-package
  24. ;; + Use the development branch
  25. ;; + Integrate with use-package
  26. ;; Apply the configurations prior to bootstrapping the package manager.
  27. (setq straight-repository-branch "develop"
  28. straight-use-package-by-default t
  29. package-enable-at-startup nil)
  30. ;; Bootstrap the package manager.
  31. ;; Download, Install, or Configuring depending on the state of the configuration.
  32. ;; All packages build from source, pinned to specific git commit hashes.
  33. (defvar bootstrap-version)
  34. (let ((bootstrap-file
  35. (expand-file-name "straight/repos/straight.el/bootstrap.el" user-emacs-directory))
  36. (bootstrap-version 5))
  37. (unless (file-exists-p bootstrap-file)
  38. (with-current-buffer
  39. (url-retrieve-synchronously
  40. "https://raw.githubusercontent.com/raxod502/straight.el/develop/install.el"
  41. 'silent 'inhibit-cookies)
  42. (goto-char (point-max))
  43. (eval-print-last-sexp)))
  44. (load bootstrap-file nil 'nomessage))
  45. ;; Integrate with use-package by installing it with straight. Override some package sources to
  46. ;; avoid the default package shipped with Emacs.
  47. (straight-use-package 'use-package)
  48. (straight-use-package 'no-littering)
  49. (straight-use-package '(org :local-repo nil))