Skip to content

Commit

Permalink
fix: multiple fixes related to package
Browse files Browse the repository at this point in the history
  • Loading branch information
abougouffa committed Dec 2, 2024
1 parent 730bb0a commit 73736f2
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 37 deletions.
25 changes: 12 additions & 13 deletions core/me-bootstrap.el
Original file line number Diff line number Diff line change
Expand Up @@ -11,28 +11,26 @@
(require 'me-lib)
(require 'package)
(require 'use-package)
(require 'package-vc nil :noerror)

(add-to-list 'package-archives '("melpa" . "https://melpa.org/packages/") t)
(add-to-list 'package--builtins '(treesit . [nil nil "Tree-Sitter integration"])) ; Some packages like `ts-movement' depends on it
(add-to-list 'package--builtins '(docker-tramp . [nil nil "Tree-Sitter integration"])) ; Needed by some packages like `ros', but provided by `tramp'

(setq
;; Set `use-package' to verbose when MinEmacs is started in verbose mode
use-package-verbose (cond (minemacs-debug-p 'debug) (minemacs-verbose-p t))
;; Defer loading packages by default, use `:demand' to force loading a package
use-package-always-defer (not minemacs-always-demand-p)
use-package-always-demand minemacs-always-demand-p
;; Make the expanded code as minimal as possible, do not try to catch errors
use-package-expand-minimally (not minemacs-debug-p))
(setq package-user-dir (expand-file-name "elpa" minemacs-local-dir)
package-gnupghome-dir (expand-file-name "gnupg" package-user-dir)
package-quickstart t
package-quickstart-file (expand-file-name "package-quickstart.el" minemacs-local-dir)
package-vc-register-as-project nil
use-package-verbose (cond (minemacs-debug-p 'debug) (minemacs-verbose-p t))
use-package-always-defer (not minemacs-always-demand-p) ; defer loading packages, unless we use `:demand'
use-package-always-demand minemacs-always-demand-p
use-package-expand-minimally (not minemacs-debug-p)
use-package-vc-prefer-newest t) ; prefer the newest commit over the latest release


;;; `use-package' extensions
;; Add `:vc' support for `use-package' in Emacs 29
(unless (> emacs-major-version 29) (require 'me-backports))

;; Prefer the newest commit over the latest release
(setq use-package-vc-prefer-newest t)

;; Add `:trigger-commands', allow loading the package before executing a
;; specific external command/function.
(add-to-list 'use-package-keywords :trigger-commands)
Expand All @@ -48,6 +46,7 @@
`((satch-add-advice ',(delete-dups arg) :before (lambda (&rest _args) (require ',name)) nil :transient t)))
(use-package-process-keywords name rest state)))

(package-initialize)

;;; Extra utilities
;; Be cautious about the installed revision of `once' and `satch' as they aren't stable yet
Expand Down
14 changes: 4 additions & 10 deletions early-init.el
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,14 @@
;;; Code:

(add-to-list 'load-path (expand-file-name "core" (file-name-directory (file-truename (or load-file-name buffer-file-name)))))
(require 'me-vars)

(require 'me-lib)
(require 'package)
(require 'package-vc nil :noerror)

(setq
;; Avoid garbage collections during startup, this will be overwritten by `+minemacs--gc-tweaks-h'
gc-cons-threshold most-positive-fixnum
;; Better garbage collection settings, see: https://zenodo.org/records/10213384.
gc-cons-threshold (* 128 1024 1024)
gc-cons-percentage 0.25
package-enable-at-startup nil
load-prefer-newer t
package-user-dir (expand-file-name "elpa" minemacs-local-dir)
package-quickstart t
package-quickstart-file (expand-file-name "package-quickstart.el" minemacs-local-dir)
package-vc-register-as-project nil
;; Remove some unneeded UI elements
default-frame-alist '((tool-bar-lines . 0)
(menu-bar-lines . 0)
Expand Down
11 changes: 0 additions & 11 deletions init.el
Original file line number Diff line number Diff line change
Expand Up @@ -154,17 +154,6 @@
;; by `+env-deny-vars'.
(+env-load) ; Load environment variables when available.

;; HACK: The `gc-cons-threshold' has been set in "early-init.el" to
;; `most-positive-fixnum' to avoid garbage collection during startup. We will
;; overwrite it at the end of `minemacs-lazy-hook' to maximize the benefit.
(defun +minemacs--gc-tweaks-h ()
"Better garbage collection settings, no GCMH required.
See: https://zenodo.org/records/10213384."
(setq gc-cons-threshold (* 128 1024 1024)
gc-cons-percentage 0.25))

(add-hook 'minemacs-lazy-hook #'+minemacs--gc-tweaks-h 90)

(defun +minemacs--loaded-h ()
"This is MinEmacs' synchronization point.
Expand Down
4 changes: 1 addition & 3 deletions modules/me-gtd.el
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,7 @@

;; GTD workflow with Org mode
(use-package org-gtd
:ensure t
:custom
(org-gtd-directory (+directory-ensure org-directory "gtd/")))
:ensure t)


(provide 'me-gtd)
Expand Down

0 comments on commit 73736f2

Please sign in to comment.