jkitchin / scimax

An emacs starterkit for scientists and engineers
Other
1.04k stars 123 forks source link

emacs-jupyter #491

Closed uliw closed 9 months ago

uliw commented 11 months ago

On Linux, the emacs-jupyter version needs to be pinned to a specific version, see https://github.com/emacs-jupyter/jupyter/issues

However, packages.el installs the version from melpa, even though the pinned version is already installed locally. Now, that is an easy fix on my end, but then I have to stash and edit packages.el every time I update via git. Is there a way to check if a local emacs-jupyter version is already present before pulling in the melpa version?

Edit: Would it be possible to use packages.el only for a minimal subset, then load settings.el, and afterward load any missing packages?

jkitchin commented 10 months ago

Does this do what you need?

(when (executable-find "jupyter")
  ;; use local install if it exists
  (if (featurep 'jupyter)
    (require 'jupyter)
    ;; install if not
    (use-package jupyter))

  (use-package scimax-jupyter :load-path scimax-dir))
uliw commented 10 months ago

that still loads the elpa version, since settings.el has not yet been loaded, so featurep would not know that jupyter will be loaded at a later stage.

jkitchin commented 10 months ago

is settings.el your personal files? If so, scimax looks for a preload.el file in init.el (locate-user-emacs-file "preload.el") and loads that first. Maybe you can put something there to load your jupyter?

I guess it doesn't work to load your version afterwards? It seems like that should work.

uliw commented 10 months ago

ah I see. Yes that works with the abobe code once package managments has been initialized. Thx!