I have just updated spacemacs, packages, and my OS and when I open spacemacs it opens in a scratch buffer in insert mode and when I hit ESC it wont leave insert mode, preventing me from using any commands. Anyone got any good ideas about how to address this?
In terms of being able to do stuff, do C-x to get to a menu. Or to go ahead & get back into normal mode, you can do M-x and type evil-force-normal-state (shouldn't have to type too much to find the right one).
After that I'd go look at the *messages* buffer -- my guess is that something's broken in config and so it's not loading your config properly, and there should be a message about that in *messages*.
hmmm C-x isn't doing anything and M-x evil-force-normal-state returns no-match
this is *messages*
Loading /Users/david/.spacemacs.d/init.el (source)...done
Loading /Users/david/.spacemacs.d/emacs-custom-settings.el (source)...done
(Spacemacs) Warning: Cannot find any of the specified fonts (Fira Code)! Font settings may not be correct.
Spacemacs is ready.Huh, ok, gotcha. Thaaaat sounds pretty messed up. How long had it been since you updated spacemacs? If it’s at the point where C-x isn’t working, I’d personally start thinking about making a backup of ~/.emacs.d and then doing a fresh clone of spacemacs.
a week
But maybe someone will have another suggestion? 🤷
> a week Very weird.
Yea I reinstalled spacemacs and it still is busted
$emacs --version
GNU Emacs 28.1
Copyright (C) 2022 Free Software Foundation, Inc.
GNU Emacs comes with ABSOLUTELY NO WARRANTY.
You may redistribute copies of GNU Emacs
under the terms of the GNU General Public License.
For more information about these matters, see the file named COPYING.Yikes.
When you say you reinstalled, you totally deleted or renamed ~/.emacs.d?
emacs --debug-init
Debugger entered--Lisp error: (file-missing "Cannot open load file" "No such file or directory" "/Users/david/.spacemacs.d/emacs-custom-se...")
load("/Users/david/.spacemacs.d/emacs-custom-se...")
dotspacemacs/user-init()
(condition-case err (dotspacemacs/user-init) ((debug error) (configuration-layer//increment-error-count) (spacemacs-buffer/append (format "Error in %s: %s\n" '"dotspacemacs/user-init" (error-message-string err)) t)))
(progn (condition-case err (dotspacemacs/user-init) ((debug error) (configuration-layer//increment-error-count) (spacemacs-buffer/append (format "Error in %s: %s\n" '"dotspacemacs/user-init" (error-message-string err)) t))))
(if (fboundp 'dotspacemacs/user-init) (progn (condition-case err (dotspacemacs/user-init) ((debug error) (configuration-layer//increment-error-count) (spacemacs-buffer/append (format "Error in %s: %s\n" '"dotspacemacs/user-init" (error-message-string err)) t)))))
(progn (if "Calling dotfile user init..." (progn (spacemacs-buffer/message "Calling dotfile user init..."))) (if (fboundp 'dotspacemacs/user-init) (progn (condition-case err (dotspacemacs/user-init) ((debug error) (configuration-layer//increment-error-count) (spacemacs-buffer/append (format "Error in %s: %s\n" '"dotspacemacs/user-init" (error-message-string err)) t))))))
(if (eq 'dumping spacemacs-dump-mode) nil (progn (if "Calling dotfile user init..." (progn (spacemacs-buffer/message "Calling dotfile user init..."))) (if (fboundp 'dotspacemacs/user-init) (progn (condition-case err (dotspacemacs/user-init) ((debug error) (configuration-layer//increment-error-count) (spacemacs-buffer/append (format "Error in %s: %s\n" ... ...) t)))))))
spacemacs/init()
(let ((please-do-not-disable-file-name-handler-alist nil)) (require 'core-spacemacs) (spacemacs/dump-restore-load-path) (configuration-layer/load-lock-file) (spacemacs/init) (configuration-layer/stable-elpa-init) (configuration-layer/load) (spacemacs-buffer/display-startup-note) (spacemacs/setup-startup-hook) (spacemacs/dump-eval-delayed-functions) (if (and dotspacemacs-enable-server (not (spacemacs-is-dumping-p))) (progn (require 'server) (if dotspacemacs-server-socket-dir (progn (setq server-socket-dir dotspacemacs-server-socket-dir))) (if (server-running-p) nil (message "Starting a server...") (server-start)))))
(if (not (version<= spacemacs-emacs-min-version emacs-version)) (error (concat "Your version of Emacs (%s) is too old. " "Spacemacs requires Emacs version %s or above.") emacs-version spacemacs-emacs-min-version) (let ((please-do-not-disable-file-name-handler-alist nil)) (require 'core-spacemacs) (spacemacs/dump-restore-load-path) (configuration-layer/load-lock-file) (spacemacs/init) (configuration-layer/stable-elpa-init) (configuration-layer/load) (spacemacs-buffer/display-startup-note) (spacemacs/setup-startup-hook) (spacemacs/dump-eval-delayed-functions) (if (and dotspacemacs-enable-server (not (spacemacs-is-dumping-p))) (progn (require 'server) (if dotspacemacs-server-socket-dir (progn (setq server-socket-dir dotspacemacs-server-socket-dir))) (if (server-running-p) nil (message "Starting a server...") (server-start))))))
eval-buffer(#<buffer *load*> nil "/Users/davidgonsalves/.emacs.d/init.el" nil t) ; Reading at buffer position 3366
load-with-code-conversion("/Users/david/.emacs.d/init.el" "/Users/davidgonsalves/.emacs.d/init.el" t t)
load("/Users/david/.emacs.d/init" noerror nomessage)
startup--load-user-init-file(#f(compiled-function () #<bytecode -0x148fbe78a6b07a7>) #f(compiled-function () #<bytecode -0x1f3c686ddc0d6275>) t)
command-line()
normal-top-level()> When you say you reinstalled, you totally deleted or renamed ~/.emacs.d? total deletion
Surprises me that the errors didn't get mentioned in *messages*, but maybe that's another symptom of it being so messed up?
Seems like it's looking in .spacemacs.d/ instead of .emacs.d though?
Is it possible you've got a shell alias somewhere that's got .spacemacs.d by mistake? Or your shell startup is setting that as a value?
this is *warnings*
Warning (initialization): An error occurred while loading '/Users/david/.emacs.d/init.el':
error: Invalid image type 'svg'
To ensure normal operation, you should investigate and remove the
cause of the error in your initialization file. Start Emacs with
the '--debug-init' option to view a complete error backtrace.So, Im not super knowledgable about aliases but I typed alias in the command line and there wasn't spacemacs or emacs when I greped it
And does anything show up if you do env | grep -i emac at the command line?
Also…you’re starting emacs just with emacs?
…I wonder whether it could somehow be pointing to an unexpected installation of emacs — I’d still expect that to use .emacs.d though, so not sure it matters, but maybe worth doing which emacs just to see if the result is surprising (dunno how you installed it in the first place).
env | grep -i emac returns nothing
> Also…you’re starting emacs just with emacs?
yes
Oh, hmm, if you do emacs -Q do you get the exact same thing as you’re getting if you just do emacs?
which emacs
/opt/homebrew/bin/emacsemacs -Q opens in the same buffer but it looks like old school emacs
> So actually when I do emacs -Q — ie “start completely vanilla emacs with no init file” — C-x doesn’t work for me either — my mistake, I thought that was an emacs default, but it must only be spacemacs.
^ is what I started to type, but I take it from your last comment that emacs doesn’t look like old school emacs, it looks still at least somehow spacemacs-ish?
yes, still spacemacs-ish
Got it.
And does "/Users/david/.spacemacs.d/ even exist?
yes
I still think that’s the likely source of trouble here, that for some reason it’s looking in the wrong dir. Unless somehow Spacemacs has shifted to making that its default dir instead of .emacs.d, which I could have missed if so.
Another thing to try would be to delete (or move or rename) both ~/.emacs.d and ~/.spacemacs.d, and then try a fresh clone into ~/.emacs.d.
If that doesn’t solve it, I’m about out of suggestions sadly 😕
FWIW this is the first I’ve ever heard of a .spacemacs.d directory existing or having any relevance to anything.
I use this https://github.com/practicalli/spacemacs.d
https://practical.li/spacemacs/install-spacemacs/#clone-spacemacs
> Another thing to try would be to delete (or move or rename) both ~/.emacs.d and ~/.spacemacs.d, and then try a fresh clone into ~/.emacs.d.
So, I deleted both and did a fresh clone and it works. But as soon as I use the practicalli spacemacs config, it went right back to square one
Oh, got it, I haven’t used theirs. Looks like it uses different dirs (based on the page you linked), namely ~/.config/emacs and ~/.config/spacemacs; maybe you’d have to delete those as well to really get a fresh install? But yeah, no clue on theirs, you’d probably have to check with @jr0cket. I’m glad that at least regular Spacemacs works!
ohh yea that seems new. If you hit the tab for classic config you'll see the ~/.spacemacs.d but i guess I'll have to wait and hear what he says
Thanks for all of your help!
You're welcome, good luck!
Remove .spacemacs.d directory and .spacemacs file if they exist Ensure that there is only one Spacemacs install, either in .config/emacs or .emacs.d (but not both)
Then start Emacs and it should show a simple Spacemacs install wizard in the bottom of the window. If the major version of Emacs has changed due to the OS updates, a large number of packages will download. Wait for them to finish (ignore warnings) and then restart Emacs If that works, then yo can consider cloning the Practicalli spacemacs.d directory and removing the .spacemacs file Using the Practicalli config requires fira code fonts install
If none of that works, something may be wrong with Emacs. Running emacs -Q will run Emacs without any config. M-x should allow you to call the command to show the Emacs version (type version and the commands will narrow). Hopefully it's version 28 or 27
C-x C-c to quit emacs
Okay so I tried all of that and it didn't work and my version is 28.1
I think I just fixed it.
Looks like I had two emacs installed and one wasn't linked