TLDR at the end
I have been learning web developement and decided to use Emacs as my main editor. The Emacs distribubion I started to use was Spacemacs because I wanted something preconfigured to get a better idea of what can be done and how other people use Emacs. I am not familiar enough with many terms and topics yet to make my own working config. It also saved me some time and let me start using the editor rightaway after some quick reading.
I am new to programming in general so after some challenges I was able to make lsp work. I really don't know if it is working properly because the idea of language servers is also new to me. It should be working with the default config that Spacemacs uses, I think. But I am lagging while I use it. Badly. I was doing some basic coding in very small files and it slows down really bad. It gives me useful suggestions and I get documentation while I mouseover or on the minibuffer.. but this prompt me to start my own config from scratch.
I didn't want to get rid of Spacemacs because I use it daily, so I started to find a way to have more than one config simultaneously. I found an option introduced in Emacs 29, `init-directory`. To do what I wanted I needed two configs: Spacemacs and the vanilla one. I started to search how to install Spacemacs in a different folder, because it uses the by default. I did the following:
\- I cloned Spacemacs using
git clone `https://github.com/syl20bnr/spacemacs.git` ~/spacemacs/.emacs.d , which is a different folder.\- I created an alias for it to start it from the command line with its own init-directory:
alias spacemacs='setsid emacs --init-directory ~/spacemacs/.emacs.d'.It worked, for the most part. The Spacemacs configurations and all its layers initiate when I type the alias in the command line. If I just type `emacs`, it uses my new config from the now almost empty `\~emacs.d` directory, where a lonely `init.el` sits.
The issues I have when using the Spacemacs config are two:
1. When I try using the spacemacs/restart-emacs-resume-layouts command bound to
M-m q r , Spacemacs closes but then it opens the the Emacs with the default (new) configuration and the following message in the minibuffer:Unknown option --resume-layouts2. Every time I open Dired to navigate I get the following error:
Error (use-package): dired-quick-sort/:config: Symbol s value as variable is void: evil-collection-binding-overridesI never encountered these errors before. The first one is easier for me to understand. My spacemacs/restart-emacs-resume-layouts function is sending the command to open Emacs with the the default configuration because it expects all the Spacemacs files to be there but they are not there anymore. Following the function to get to its definition, I found the following function next to several others related to restarting flags:
file: \~/spacemacs/.emacs.d/layers/+spacemacs/spacemacs-navigation/funcs.el
(defun spacemacs/restart-emacs-resume-layouts (&optional args)
"Restart emacs and resume layouts."
(interactive)
(spacemacs/restart-emacs (cons "--resume-layouts" args)))
I might be mistaken but I thought that adding "spacemacs" to the "--resume-layouts" string would then send the command "spacemacs --resume-layouts" to... wherever it was going (guessing the command line) and that because spacemacs is an alias, it would then add its `--init-directory` plus, the "--resume-layouts" string that was already there. It doesn't work. I think it becomes
emacs spacemacs --resume-layouts somehow... as if it was concatenating. I don't know then, where to change that "first" emacs to the spacemacs alias.I tried finding errors similar to the second one because I have been unable to find exactly the same one, but the explanations are confusing and you can clearly tell that the guys communicating don't need to explain everything to each other to finish the conversation and