Comments (9)
May have been a Windows issue then, or combined Windows+git issue. I'm pretty sure it wasn't exactly a "me" issue as at the point where I call that, I've done:
- Crafted Emacs early-init.el
- Snippet of code to load
custom.el
- Set temporary file directory variable.
(load ~/.emacs.d/crafted-emacs/modules/crafted-init-config")
Then following that, a little blurp about setting up use-package
then I call my first (require 'crafted-xxx-package)
line. None of these things are elaborate enough to make me think it was my situation where crafted-init-config
couldn't automatically set the crafted-emacs-home
variable. (So for now, step 3.5 is setting that variable, then running crafted-init-config
and everything loads just fine, so that's the only issue I'm aware of.
from crafted-emacs.
So, it turns out, vc-find-root even works when there is not .git or .github directory (as if > you had just downloaded the project source).
That's interesting, then again it was the alternative version in our code (when there was no git), so clearly someone knew that in the past.
May have been a Windows issue then, or combined Windows+git issue.
Well, the current iteration of the code does seem to break on Linux too (from my testing) if in a submodule (or crafted-emacs not being the root of the git-tree) and git is found in PATH
.
I think moving forward, this section of code needs a little more checking that we're doing the right thing and otherwise actively signaling to the users that there is something they need to do manually (for one reason or another).
from crafted-emacs.
Thanks!
Will need to look into how we might detect submodules in scenarios like this. Probably need to update the documentation with hints about setting the crafted-emacs-home
value before loading crafted-init-config
in scenarios like this.
from crafted-emacs.
Is relying on git necessary here? Is there a way for the routines in crafted-init-config.el
to know where the file exists? If you're using git for identifying the project head, there's no real reason to believe that the user has modified the repository tree. Could possibly derive the project root from the location of the initial file.
Otherwise, certainly works to set the directory and I'm glad that it was written to check for this variable and use it when set. Solved my problem completely. It was just the automatic method that didn't seem to work. Anyway, hope the report helps.
from crafted-emacs.
ye, the current code in question is:
;; crafted-init-config.el (line 69ff)
(when (null crafted-emacs-home)
(setq crafted-emacs-home
(expand-file-name
(if (executable-find "git")
(project-root
(project-current nil (file-name-directory load-file-name)))
(vc-find-root load-file-name "modules")))))
As there is already a fallback (vc-find-root
) to using git
, I wonder if there really is a need to use project-root
with git here.
Something like this should get the same result:
(when (null crafted-emacs-home)
(setq crafted-emacs-home (expand-file-name (vc-find-root load-file-name "modules"))))
Alternatively, we could check if the project-root
path contains a modules
directory, but that feels a bit excessive.
from crafted-emacs.
Something like this should get the same result:
(when (null crafted-emacs-home)
(setq crafted-emacs-home (expand-file-name (vc-find-root load-file-name "modules"))))
I was, quite literally, just testing this. I think I originally used project-root
as it provided what I needed, and I use projects, and checking this code out from git
would give the expected result. However, if the project is downloaded but not checked out using git
, then what? That particular piece still needs some re-evaluation. But for git submodules
, which this issue is about, the vc-find-root
is sufficient as well as in cases where the project was cloned to it's own directory.
from crafted-emacs.
For the other case, we could go the (potentially fragile) route of going of "path relative to currently executing file" route.
Otherwise, I'd propose a good error message explaining that it cannot locate the crafted-emacs installation and ask the user to set the crafted-emacs-home
variable manually.
from crafted-emacs.
So, it turns out, vc-find-root
even works when there is not .git
or .github
directory (as if you had just downloaded the project source).
I'd propose a good error message explaining that it cannot locate the crafted-emacs installation and ask the user to set the crafted-emacs-home variable manually.
Maybe we check to make sure crafted-emacs-home
is set before setting the load-path
and if not throw an error with a message that it needs to be explicitly set by the user. Something along the lines of:
(unless crafted-emacs-home (error "Please set the crafted-emacs-home prior to loading the crafted-init-config module."))
from crafted-emacs.
Closing this, because it's addressed by #391.
Thanks to everyone involved.
@Remillard feel free to reopen if necessary.
from crafted-emacs.
Related Issues (20)
- [craftedv2beta] Broken configuration guards (Tracking Issue) HOT 4
- [craftedv2beta] Improve documentation for using straight.el HOT 7
- Provide option for easier module loading. HOT 7
- [craftedv2beta] Use `customize-save-variable` vs. `customize-set-variable`? HOT 11
- [craftedv2beta] Question regarding the skeleton for new modules HOT 5
- Discussion: When do our own `defcustom` variables make sense? When are they best avoided? HOT 6
- [craftedv2beta] Evil bindings in crafted-speedbar are duplicate and inconsistent with evil-collection HOT 3
- [craftedv2beta] Standardized way for naming functions HOT 5
- [craftedv2beta] Unused function `crafted-completion/minibuffer-backward-kill` HOT 2
- texinfo tags in doc headings don't seem to be needed HOT 3
- [v2] Emacs 29+ check for executable prevents Treesitter setup HOT 12
- [v2] No easy way to opt out of tree sitter parsers HOT 5
- [v2] Corfu + Eglot have unsuitable performance for medium/large projects HOT 4
- [v2] defgroup crafted-startup not functioning properly
- [v2]package-selected-packages "Combobulate" problem. HOT 3
- Automating regeneration of Info file HOT 13
- Suggestion: Make examples loadable HOT 3
- Symbol's function definition is void: treesit-auto-add-to-auto-mode-alist HOT 3
- Eglot doesn't automatically load when a relevant mode is visited until explicitly required HOT 10
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from crafted-emacs.