Comments (10)
@jeffbowman So I tested this both with and without Chemacs, and it seems to work. I submitted a PR in your repo for a typo in early-init.el
But with that change it works.
So:
- Chemacs in ~/.emacs.d
- Rational-emacs in ~/rational-test
- Rational-config in ~/rational-config
And that worked for me. Tested in Windows with a clean setup (sandbox) where HOME
is in $env:APPDATA
, the default.
The only thing is the personal config-files needs the same structure with ~/rational-config/.config/rational-emacs
so this might be mentioned in the README.
I set the environment-variable in the shell, but have not tested the variant with it set in .emacs-profiles.el
.
from crafted-emacs.
I have Chemacs2 working on Windows, but only if I edit early-init.el
. And that is because I didn't install it in the folder that the documentation recommends. Which is either ~/.rational-emacs
or ~/.config/rational-emacs
.
So I edited early-init-el
from:
(defvar rational-config-path
(let ((home-dir (getenv "HOME")))
(if (file-exists-p (expand-file-name ".rational-emacs" home-dir))
(expand-file-name ".rational-emacs" home-dir)
(expand-file-name ".config/rational-emacs" home-dir)))
"The user's rational-emacs configuration path.")
to:
(defvar rational-config-path user-emacs-directory)
and that makes it work for me.
I'm not sure why rational Emacs has to be installed to a specific location and not just use the built in variable user-emacs-directory
. And on Windows there is no HOME
variable by default, so that could also cause problems.
You don't say what OS you're on but if you try to change early-init.el
as above it might work for you.
from crafted-emacs.
I'm on MacOS (m1) and Linux , though I only tested it on the Mac.
Thanks
from crafted-emacs.
This is an interesting conundrum. The reason is due to the fact we are looking for the rational-emacs-path
in the early-init.el
file, and we need to know fairly explicitly where to find that path. Initially, we used the ~
alias for the HOME
folder, but as was mentioned in #19 that may not exist on Windows. I have a patch for that implementation in #32, but that only barely alleviates the problem here.
I can think of a couple of improvements:
- Use an environment variable, ala RATIONAL_EMACS_HOME, the fall back will be the APPDATA/HOME implementation in #32.
- Use something relative to the users emacs configuration folder like this:
(let ((home-dir (expand-file-name "../.rational-emacs" (file-name-directory (locate-user-emacs-file "init.el"))))) ...)
and fallback to the current implementation which looks in~/.rational-emacs
or~/.config/rational-emacs
if the path doesn't exist.
from crafted-emacs.
PR #38 created for this issue, @harryfrogfather or possibly @sdaaish , could you review please and/or test? Let me know your feedback and I'll update the PR as necessary.
from crafted-emacs.
@sdaaish Thanks!! I have installed chemacs to try to figure out the issue. It should not create an additional .config/ structure in your rational config folder. I have completely rewritten the logic now, it seems to work for me and my neophyte/naive usage of chemacs, seems to also continue to work without chemacs. I'd appreciate it if you could pull the changes from my branch and test one more time. And thanks for the PR to fix the spelling error I had!
from crafted-emacs.
Sure thing.
The number of test-cases increases with the options, so it's hard to keep track of them now… But I tested two of them anyway. Long story below.
The short story: It worked as expected what I can see.
Testing
Two tests, both with Chemacs2 and custom installation of rational_emacs. The second one with custom config path. Both cases with Windows 11 in a sandbox. Use of emacs built in $HOME
variable wich is the same as ${env:AppData}
in Windows.
test 1
Chemacs, custom installation of rational-emacs.
Installation
# Clone emacs repositories
& git clone https://github.com/plexus/chemacs2.git $env:AppData/.emacs.d
& git clone -b more-friendly-for-chemacs https://github.com/jeffbowman/rational-emacs.git $env:AppData/rational-test
-
~/.emacs-profiles.el
(("default" . ((user-emacs-directory . "~/rational-test"))))
rational-config-path
rational-config-path is a variable defined in ‘early-init.el’.
Its value is
"c:/Users/WDAGUtilityAccount/AppData/Roaming/rational-test/rational-emacs"
Documentation:
The user’s rational-emacs configuration path.
rational-config-file
rational-config-file is a variable defined in ‘init.el’.
Its value is
"c:/Users/WDAGUtilityAccount/AppData/Roaming/rational-test/rational-emacs/config.el"
Documentation:
The user’s configuration file.
Result
By adding a local config to $HOME/rational-test/rational-emacs/config.el
the setup works with Chemacs2. $HOME
is in this case the same as $env:Appdata
.
So the test was successful.
test2
chemacs, custom installation and custom config-path.
Installation
# Clone emacs repositories
& git clone https://github.com/plexus/chemacs2.git $env:AppData/.emacs.d
& git clone -b more-friendly-for-chemacs https://github.com/jeffbowman/rational-emacs.git $env:AppData/rational-test
-
~/.emacs-profiles.el
(("default" . ((user-emacs-directory . "~/rational-test"))))
rational-config-path
rational-config-path is a variable defined in ‘early-init.el’.
Its value is
"c:/Users/WDAGUtilityAccount/AppData/Roaming/my-rational-emacs-config"
Documentation:
The user’s rational-emacs configuration path.
rational-config-file
rational-config-file is a variable defined in ‘init.el’.
Its value is
"c:/Users/WDAGUtilityAccount/AppData/Roaming/my-rational-emacs-config/config.el"
Documentation:
The user’s configuration file.
user-emacs-directory
user-emacs-directory is a variable defined in subr.el.
Value
"~/rational-test/"
Result
The test was successful, rational-emacs found config.el
in the correct directory and loaded it without any errors.
Output
From test2.
- Chemacs2
- Custom installation of rational-emacs.
- Custom config path.
- Use of environment variable
RATIONAL_EMACS_HOME
.
from crafted-emacs.
Fantastic!! Thanks for the help!! I'm going to update the docs then see if @daviwil will merge the update.
from crafted-emacs.
With the merge of #38 can this issue be closed?
from crafted-emacs.
yes it looks ok from my perspective
from crafted-emacs.
Related Issues (20)
- [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
- `crafted-init-config` automatically finding directory possibly confounded by submodule use HOT 9
- Eglot doesn't automatically load when a relevant mode is visited until explicitly required HOT 10
- treesit-auto-opt-out-list seems to have disappeared
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.