Skip to content

Commit

Permalink
fix: several fixes following the move to package
Browse files Browse the repository at this point in the history
  • Loading branch information
abougouffa committed Dec 1, 2024
1 parent 6bf763e commit ef8cb84
Show file tree
Hide file tree
Showing 7 changed files with 30 additions and 41 deletions.
10 changes: 0 additions & 10 deletions core/me-bootstrap.el
Original file line number Diff line number Diff line change
Expand Up @@ -57,16 +57,6 @@
(use-package satch
:vc (:url "https://github.com/emacs-magus/satch.el" :rev "77993b711cccf16702fdc8d21d8f8ba10d7bd0fb"))

;; HACK+BUG: Prevent `package' from failing when looking for depdendencies that
;; doesn't have proper versions
(advice-add
'version-to-list :around
(satch-defun +version-to-list--no-fail:around-a (fn ver)
(condition-case err
(funcall fn ver)
(error (message "`version-to-list': %s" (error-message-string err))
nil))))


(provide 'me-bootstrap)
;;; me-bootstrap.el ends here
2 changes: 0 additions & 2 deletions core/me-lib.el
Original file line number Diff line number Diff line change
Expand Up @@ -1194,8 +1194,6 @@ FEATS is available."
(let ((fn (if (eq (car feats) :any) (progn (setq feats (cdr feats)) #'cl-some) #'cl-every)))
(and (funcall fn (lambda (feat) (memq feat minemacs--extra-features)) feats) t)))

(define-obsolete-function-alias '+emacs-features-p '+emacs-options-p "v11.0.0")


(provide 'me-lib)
;;; me-lib.el ends here
20 changes: 7 additions & 13 deletions core/me-vars.el
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ environment variable \"$MINEMACS_IGNORE_USER_CONFIG\".")
(const :tag "Debug" 4)))

;; Derive the root directory from this file path
(defconst minemacs-root-dir (abbreviate-file-name (file-name-directory (directory-file-name (file-name-directory (file-truename load-file-name))))))
(defconst minemacs-root-dir (expand-file-name (file-name-directory (directory-file-name (file-name-directory (file-truename load-file-name))))))
(defconst minemacs-core-dir (concat minemacs-root-dir "core/"))
(defconst minemacs-assets-dir (concat minemacs-root-dir "assets/"))
(defconst minemacs-elisp-dir (concat minemacs-root-dir "elisp/"))
Expand All @@ -92,11 +92,12 @@ environment variable \"$MINEMACS_IGNORE_USER_CONFIG\".")
(defconst minemacs-cache-dir (concat minemacs-local-dir "cache/"))
(defconst minemacs-loaddefs-file (concat minemacs-core-dir "me-loaddefs.el"))
(defconst minemacs-extra-packages-dir (concat minemacs-local-dir "extra-packages/"))
(defconst minemacs-config-dir (file-name-as-directory
(or (getenv "MINEMACS_DIR")
(getenv "MINEMACSDIR")
(and (file-directory-p "~/.minemacs.d/") "~/.minemacs.d/")
(concat minemacs-root-dir "user-config/")))
(defconst minemacs-config-dir (expand-file-name
(file-name-as-directory
(or (getenv "MINEMACS_DIR")
(getenv "MINEMACSDIR")
(and (file-directory-p "~/.minemacs.d/") "~/.minemacs.d/")
(concat minemacs-root-dir "user-config/"))))
"MinEmacs user customization directory.")

(defconst minemacs-started-with-extra-args-p (and (cdr command-line-args) t) "Has Emacs been started with extras arguments? like a file name or so.")
Expand All @@ -111,13 +112,6 @@ environment variable \"$MINEMACS_IGNORE_USER_CONFIG\".")
"The system's architecture read from `system-configuration'.
It return a symbol like `x86_64', `aarch64', `armhf', ...")

(make-obsolete-variable 'os/android '+emacs-options-p "v11.0.0")
(make-obsolete-variable 'os/linux '+emacs-options-p "v11.0.0")
(make-obsolete-variable 'os/bsd '+emacs-options-p "v11.0.0")
(make-obsolete-variable 'os/win '+emacs-options-p "v11.0.0")
(make-obsolete-variable 'os/mac '+emacs-options-p "v11.0.0")
(make-obsolete-variable 'sys/arch '+emacs-options-p "v11.0.0")

(defconst minemacs--extra-features
(append
(list
Expand Down
8 changes: 4 additions & 4 deletions early-init.el
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,12 @@

;;; Code:

;; Load MinEmacs variables and basic from the `me-vars' core module.
(add-to-list 'load-path (expand-file-name "core" (file-name-directory (file-truename (or load-file-name buffer-file-name)))))
(require 'me-vars)

(setq package-user-dir (expand-file-name "elpa" minemacs-local-dir)
package-enable-at-startup t)

(require 'me-lib)
(require 'package)
(require 'package-vc nil :noerror)
Expand All @@ -20,9 +23,6 @@
gc-cons-threshold most-positive-fixnum
;; Prefer loading newer files
load-prefer-newer t
;; Do not make installed packages available when Emacs starts (we use `straight')
package-enable-at-startup t
package-user-dir (concat minemacs-local-dir "package-archives")
package-vc-register-as-project nil
;; Remove some unneeded UI elements
default-frame-alist '((tool-bar-lines . 0)
Expand Down
14 changes: 7 additions & 7 deletions init.el
Original file line number Diff line number Diff line change
Expand Up @@ -71,12 +71,6 @@
(when (< emacs-major-version recommended-ver)
(message "Recommended Emacs version for MinEmacs is %d or higher, you have v%s" recommended-ver emacs-version)))

;; Write user custom variables to separate file instead of "init.el"
(setq custom-file (concat minemacs-config-dir "custom-vars.el"))

;; Load the custom variables file if it exists
(when (file-exists-p custom-file) (+load custom-file))

;; PERF: Setting `file-name-handler-alist' to nil should boost startup time.
;; https://reddit.com/r/emacs/comments/3kqt6e/2_easy_little_known_steps_to_speed_up_emacs_start
;; Store the current value so we can reset it after Emacs startup.
Expand All @@ -87,7 +81,7 @@
(add-hook 'emacs-startup-hook (lambda () (setq file-name-handler-alist (delete-dups (append file-name-handler-alist (get 'file-name-handler-alist 'original-value))))) 99)

(dolist (dir '("core" "modules" "modules/extras" "elisp")) ; Add some of MinEmacs' directories to `load-path'
(add-to-list 'load-path (expand-file-name dir (file-name-directory (file-truename load-file-name)))))
(add-to-list 'load-path (expand-file-name dir (file-name-directory (file-truename (or load-file-name buffer-file-name))))))

;; NOTE: At this point, MinEmacs variables defined in `me-vars' should be
;; already loaded (in "early-init.el"). However, we load it here if necessary in
Expand All @@ -104,6 +98,12 @@

(require 'me-lib) ; Load MinEmacs' core library

;; Write user custom variables to separate file instead of "init.el"
(setq custom-file (concat minemacs-config-dir "custom-vars.el"))

;; Load the custom variables file if it exists
(when (file-exists-p custom-file) (+load custom-file))

(setq
;; Enable debugging on error when Emacs if needed
debug-on-error minemacs-debug-p
Expand Down
2 changes: 1 addition & 1 deletion modules/me-robot.el
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

;; A package to ease the interaction ROS nodes and the development of ROS software
(use-package ros
:vc (:url "https://github.com/mbeutelspacher/ros.el")
:ensure t
:commands (ros-set-network-setting ros-set-workspace ros-go-to-package ros-clean-cache))


Expand Down
15 changes: 11 additions & 4 deletions modules/me-window.el
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,13 @@
(reusable-frames . visible) ;;
(window-height . 10)))

;; Don't show the *Compile-Log* buffer
(add-to-list
'display-buffer-alist
`(,(rx bol "*" "Compile-Log" "*" eol)
(display-buffer-no-window)
(allow-no-window . t)))

;; Show dictionary definition and completion buffer on the right side
(add-to-list
'display-buffer-alist
Expand All @@ -65,10 +72,10 @@
(add-to-list
'display-buffer-alist
`(,(rx bol "*"
(or "scheme" "ielm" "Python" "Inferior Octave" "maxima" "imaxima" "lua"
"inferior-lisp" "prolog" "gnuplot" "Nix-REPL" "julia"
(seq (or (seq "R" (opt ":" (any digit))) "julia" "SQL") ":" (* any)))
"*" eol)
(or "scheme" "ielm" "Python" "Inferior Octave" "maxima" "imaxima" "lua"
"inferior-lisp" "prolog" "gnuplot" "Nix-REPL" "julia"
(seq (or (seq "R" (opt ":" (any digit))) "julia" "SQL") ":" (* any)))
"*" eol)
(display-buffer-in-side-window)
(side . right)
(dedicated . t) ;; Close when finished
Expand Down

0 comments on commit ef8cb84

Please sign in to comment.