doomemacs / doomemacs/core

Need to check nil workspace during the initial startup

Open
#8,069 1 comment 0 reactions 0 assignees View on GitHub
is:bug needs-triage
Dominant language
Emacs Lisp
Stars
22.7k
Forks
3.1k
Avg merge
10h 46m
Merged PRs (30d)
4

Description

### I confirm that...

- [X] I have searched the [issue tracker](https://github.com/doomemacs/doomemacs/issues), [documentation](https://docs.doomemacs.org), [FAQ](https://docs.doomemacs.org/-/faq), [Discourse](https://discourse.doomemacs.org), and [Google](https://google.com), in case this issue has already been reported/resolved.

- [X] I have read "[How to Debug Issues](https://doomemacs.org/d/how2debug)", and will use it to provide as much information about this issue as possible.

- [X] The issue can be reproduced on the **latest** available commit of Doom.

- [x] The issue can be reproduced on a stable release of Emacs, such as 27, 28, or 29. *(Unstable versions end in .50, .60, or .9x)*

### Expected behavior

Emacs must be initialized with the valid workspace.

### Current behavior

There is a potential issue with the session management. The issue can be reproduced with using mu4e.

```diff
1 file changed, 4 insertions(+), 1 deletion(-)
lisp/lib/sessions.el | 5 ++++-

modified lisp/lib/sessions.el
@@ -60,7 +60,10 @@
((and (require 'frameset nil t)
(require 'restart-emacs nil t))
(restart-emacs--restore-frames-using-desktop file))
- ((error "No session backend to load session with"))))
+ ((error "No session backend to load session with")))
+
+ (unless (+workspace-p (+workspace-current))
+ (+workspace/switch-to 0)))


;;
```
I checked the issue has gone with checking workspace at Doom initial time. (Please consider the above as a code for just checking the issue.. I could not make a PR since I couldn't understand the clean layers in Doom fully enough.)

### Steps to reproduce

1. Open Emacs
2. `M-x =mu4e`
3. `M-x doom/restart-and-restore`
4. `M-x doom/restart`
5. Issue reproduce with the message "Not in a valid workspace (nil)"

### System Information

https://gist.github.com/seokbeomKim/2d832f7954a1bc650df02720c8a803e2

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.