Skip to content

Commit

Permalink
fix: remove references to straight
Browse files Browse the repository at this point in the history
  • Loading branch information
abougouffa committed Dec 1, 2024
1 parent 34356cd commit af3bc49
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 61 deletions.
66 changes: 17 additions & 49 deletions core/me-lib-extra.el
Original file line number Diff line number Diff line change
Expand Up @@ -30,19 +30,11 @@ Call functions without asking when DONT-ASK-P is non-nil."
"Update MinEmacs packages to the last revisions (can cause breakages)."
(interactive)
;; Load all modules
(user-error "Not yet implemented for `package'")
(message "[MinEmacs]: Loading all modules and on-demand modules")
(apply #'minemacs-load-module (minemacs-modules t))

;; Update straight recipe repositories
(straight-pull-recipe-repositories)

;; Run `straight's update cycle, taking into account the explicitly pinned versions
(message "[MinEmacs]: Pulling packages")
(straight-x-pull-all)
(message "[MinEmacs]: Freezing packages")
(straight-x-freeze-versions)
(message "[MinEmacs]: Rebuilding packages")
(straight-rebuild-all)
;; TODO: Implement for `package'

;; Run package-specific build functions (ex: `pdf-tools-install')
(message "[MinEmacs]: Running additional package-specific build functions")
Expand All @@ -55,22 +47,13 @@ This takes into account the explicitly pinned packages. When called with
\\[universal-argument] or with PULL-MINEMACS, it will run \"git pull\"
in MinEmacs directory before upgrading."
(interactive "P")
(user-error "Not yet implemented for `package'")
(when pull-minemacs
(let ((default-directory minemacs-root-dir))
(vc-pull)))
;; Update straight recipe repositories
(straight-pull-recipe-repositories)
;; This will ensure that the pinned lockfile is up-to-date
(straight-x-freeze-pinned-versions)
;; Restore packages to the versions pinned in the lockfiles
(when (file-exists-p (concat straight-base-dir "versions/pinned.el"))
(message "[MinEmacs] Restoring pinned versions of packages")
(straight-x-thaw-pinned-versions))
(message "[MinEmacs] Restoring packages from the global lockfile versions")
(straight-thaw-versions)
;; Rebuild the packages
(message "[MinEmacs] Rebuilding packages")
(straight-rebuild-all)

;; TODO: Implement for `package'

;; Run package-specific build functions (ex: `pdf-tools-install')
(message "[MinEmacs] Running additional package-specific build functions")
(minemacs-run-build-functions 'dont-ask))
Expand All @@ -82,19 +65,6 @@ in MinEmacs directory before upgrading."
(mapc (+apply-partially-right #'+delete-file-or-directory 'trash 'recursive)
(directory-files minemacs-root-dir nil (rx (seq bol (or "eln-cache" "auto-save-list" "elpa") eol))))))

;;;###autoload
(defun +straight-prune-build-cache ()
"Prune straight.el build directories for old Emacs versions."
(let* ((default-directory (file-name-concat straight-base-dir "straight/")))
;; Prune the build cache and build directory.
(straight-prune-build)
;; Prune old build directories
(mapc (+apply-partially-right #'+delete-file-or-directory 'trash 'recursive)
(seq-filter
(lambda (name)
(not (member name (list straight-build-dir (concat straight-build-dir "-cache.el") "versions" "repos"))))
(directory-files default-directory nil directory-files-no-dot-files-regexp)))))

;;;###autoload
(defun minemacs-cleanup-emacs-directory ()
"Cleanup unwanted files/directories from MinEmacs' directory."
Expand All @@ -103,8 +73,6 @@ in MinEmacs directory before upgrading."
(+info! "Trying to clean outdated native compile cache")
;; Delete outdated natively compiled files when Emacs become idle
(+shutup! (native-compile-prune-cache)))
(+info! "Trying to clean outdated straight build cache")
(+shutup! (+straight-prune-build-cache))
(+info! "Trying to clean MinEmacs' root directory")
(+shutup! (minemacs-root-dir-cleanup)))

Expand Down Expand Up @@ -859,17 +827,17 @@ the children of class at point."
"Request documentation for the thing at point."
(interactive)
(eglot--dbind ((Hover) contents range)
(jsonrpc-request (eglot--current-server-or-lose) :textDocument/hover (eglot--TextDocumentPositionParams))
(let ((blurb (and (not (seq-empty-p contents)) (eglot--hover-info contents range)))
(hint (thing-at-point 'symbol)))
(if blurb
(with-current-buffer (or (and (buffer-live-p +eglot--help-buffer) +eglot--help-buffer)
(setq +eglot--help-buffer (generate-new-buffer "*eglot-help*")))
(with-help-window (current-buffer)
(rename-buffer (format "*eglot-help for %s*" hint))
(with-current-buffer standard-output (insert blurb))
(setq-local nobreak-char-display nil)))
(display-local-help)))))
(jsonrpc-request (eglot--current-server-or-lose) :textDocument/hover (eglot--TextDocumentPositionParams))
(let ((blurb (and (not (seq-empty-p contents)) (eglot--hover-info contents range)))
(hint (thing-at-point 'symbol)))
(if blurb
(with-current-buffer (or (and (buffer-live-p +eglot--help-buffer) +eglot--help-buffer)
(setq +eglot--help-buffer (generate-new-buffer "*eglot-help*")))
(with-help-window (current-buffer)
(rename-buffer (format "*eglot-help for %s*" hint))
(with-current-buffer standard-output (insert blurb))
(setq-local nobreak-char-display nil)))
(display-local-help)))))



Expand Down
4 changes: 0 additions & 4 deletions modules/obsolete/me-platformio.el
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,9 @@


;; PlatformIO integration for Emacs
(push 'projectile straight-built-in-pseudo-packages)

(use-package platformio-mode
:ensure t)

(cl-callf2 remove 'projectile straight-built-in-pseudo-packages)


(provide 'obsolete/me-platformio)
;;; me-platformio.el ends here
4 changes: 0 additions & 4 deletions modules/obsolete/me-projectile.el
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,6 @@

;;; Code:

;; Remove `projectile' form the `straight-built-in-pseudo-packages' in case it
;; has been added
(cl-callf2 remq 'projectile straight-built-in-pseudo-packages)

(use-package projectile
:ensure t
:after minemacs-loaded
Expand Down
4 changes: 0 additions & 4 deletions modules/on-demand/me-nim.el
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,10 @@
:auto-mode '(("\\.nim\\'" . nim-mode) ("\\.nim\\(ble\\|s\\)\\'" . nimscript-mode-maybe)))


(push 'flycheck-nimsuggest straight-built-in-pseudo-packages)

;; A major mode for the Nim programming language
(use-package nim-mode
:ensure t)

(cl-callf2 remq 'flycheck-nimsuggest straight-built-in-pseudo-packages)


(provide 'on-demand/me-nim)
;;; me-nim.el ends here

0 comments on commit af3bc49

Please sign in to comment.