Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Running emacsclientw.exe on windows can't attach to running emacs server #3324

Closed
Whil- opened this issue Jun 7, 2020 · 4 comments
Closed
Labels
is:bug Something isn't working as intended module:core Relevant to Doom core os:windows Pertains specifically to Windows re:defaults Regarding Doom's defaults re:emacs:daemon Pertains to the Emacs daemon status:resolved Issue was addressed internally

Comments

@Whil-
Copy link

Whil- commented Jun 7, 2020

What did you expect to happen?
That after I've started doom-emacs in daemon-mode in windows with runemacs.exe --daemon, and after that run emacsclientw.exe -n -e "(raise-frame)", get a emacs started instantly, connected to the emacs deamon.

What actually happened?
A new emacs session is started when running the emacsclientw.exe command above.

Running on Windows-10, Emacs 27.0.91.

Solution
I think I've found a reason and possible solution... It seems the move of .emacs.d/server/ to .emacs.d/.local./cache/server is the culprit. When trying to attach to the daemon, emacs by default looks in .emacs.d/server/ for the address to it. Since that file doesn't exist in that location it fails to find the running emacs deamon.

One can work around it by specifying the full path to the server-file as an argument to emacsclientw.exe. Or by customizing server-auth-dir. But best would probably be to not hide the server folder in core/core.el to begin with! Since it disables the ability to use emacs in server mode.

@Whil- Whil- added the is:bug Something isn't working as intended label Jun 7, 2020
@hlissner hlissner added module:core Relevant to Doom core re:defaults Regarding Doom's defaults re:emacs:daemon Pertains to the Emacs daemon labels Jun 7, 2020
@hlissner hlissner added the status:resolved Issue was addressed internally label Jun 7, 2020
@hlissner
Copy link
Member

hlissner commented Jun 7, 2020

As of c2c81ec this issue should be resolved. Let me know if that isn't the case and I'll reopen it. Thanks for bringing it to my attention!

@hlissner hlissner added the os:windows Pertains specifically to Windows label Jun 7, 2020
@Whil-
Copy link
Author

Whil- commented Jun 7, 2020

Can confirm that it's fixed, thank you.

@seanfarley
Copy link
Contributor

The commit for this fix (which I won't argue against; probably never should have changed the default since it's assumed by so many projects) was a real hammer to the back of the head. So, thanks for that.

For those of us that worked around the original source of this issue by updating our own environment variables (i.e. EMACS_SERVER_FILE), we now had a bunch of stuff just straight up not working. That was bad enough, fixable, but still annoying. The real issue here is that doom caches the environment variables so the old EMACS_SERVER_FILE was still saved and processes launched within emacs would just fail for no obvious reason (any command calling emacsclient specifically). One cache, (usually more than) one bug.

The cherry on top is that you didn't even add the server to gitignore in this repo. It's just a nice reminder (along with your decision about discord) that this isn't a community project. It's Henrik's project. And we're just lucky enough to use it.

daveduthie pushed a commit to daveduthie/doom-emacs that referenced this issue Jun 12, 2020
This directory is used when server-use-tcp is non-nil (which is the case
on Windows). With this changed from its default, users have to manually
specify its location when using emacsclientw.exe to connect to daemons.

This means a little more noise in `~/.emacs.d`, but Windows users have
worse things to put up with.

Fixes doomemacs#3324
hlissner added a commit that referenced this issue Jul 24, 2020
@hlissner
Copy link
Member

The cherry on top is that you didn't even add the server to gitignore in this repo

Sorry for failing to notice this until now. As of a78c397, ~/.emacs.d/server is now git ignored.

github-actions bot added a commit to vlaci/nix-doom-emacs that referenced this issue Jul 31, 2020
## Changelog for doom-emacs:
Commits: [doomemacs/doomemacs@15f0bccd...09248015](doomemacs/doomemacs@15f0bcc...0924801)

* [`03add77b`](doomemacs/doomemacs@03add77) Elixir formats long numbers with an underscore
* [`ad6da92f`](doomemacs/doomemacs@ad6da92) Update config.el
* [`a282730c`](doomemacs/doomemacs@a282730) Fix typos and reword docstrings
* [`205aed59`](doomemacs/doomemacs@205aed5) Update dart module README
* [`f4c2c7f9`](doomemacs/doomemacs@f4c2c7f) Bump :lang org
* [`6e600914`](doomemacs/doomemacs@6e60091) Bump :lang ruby
* [`f8d3064e`](doomemacs/doomemacs@f8d3064) Bump :tools ansible
* [`d70b2ff7`](doomemacs/doomemacs@d70b2ff) docs/faq: add "How to disable smartparens" doomemacs/doomemacs#3609
* [`316a9b87`](doomemacs/doomemacs@316a9b8) docs/faq: add "How to maximize/fullscreen at startup"
* [`0ebb5cf3`](doomemacs/doomemacs@0ebb5cf) docs/faq: add "Why sharp-quote functions"
* [`1e0cd6dd`](doomemacs/doomemacs@1e0cd6d) docs/faq: add "Is Doom a fork of spacemacs/prelude/etc?"
* [`f99c3fb3`](doomemacs/doomemacs@f99c3fb) docs/faq: "Why is scrolling slow"->"Why is Emacs slow"
* [`e6221844`](doomemacs/doomemacs@e622184) docs/faq: general revision & reformatting
* [`e517da66`](doomemacs/doomemacs@e517da6) docs/api: fix "Centered frame" snippet
* [`091635d5`](doomemacs/doomemacs@091635d) docs/api: add missing TOC entry
* [`25008382`](doomemacs/doomemacs@2500838) Fix void-variable: lua-lsp-dir
* [`cd40d45c`](doomemacs/doomemacs@cd40d45) docs/faq: minor corrections & revision
* [`2bb88e24`](doomemacs/doomemacs@2bb88e2) docs/faq: Add "~/.emacs.d/server is unsafe" error
* [`d2117b78`](doomemacs/doomemacs@d2117b7) docs/faq: add "How to share/sync config between computers"
* [`87d17fab`](doomemacs/doomemacs@87d17fa) docs/getting_started: general revision
* [`976a6017`](doomemacs/doomemacs@976a601) docs/getting_started: add install guides for Windows
* [`9ec54284`](doomemacs/doomemacs@9ec5428) Set core.autocrlf = true in repos on Windows doomemacs/doomemacs#2637
* [`a78c3973`](doomemacs/doomemacs@a78c397) Add server/ to gitignore doomemacs/doomemacs#3324
* [`47a350f6`](doomemacs/doomemacs@47a350f) jinja2-enable-indent-on-save = nil doomemacs/doomemacs#3555
* [`61cb7252`](doomemacs/doomemacs@61cb725) Fix doomemacs/doomemacs#3509 again
* [`bcc1b84e`](doomemacs/doomemacs@bcc1b84) Increase so-long threshold for softwrapped text modes
* [`3aeb1778`](doomemacs/doomemacs@3aeb177) Add +literate-enable-recompile-h to enable save-on-tangle
* [`ff21dfe5`](doomemacs/doomemacs@ff21dfe) Revise :config literate README
* [`cd3c865c`](doomemacs/doomemacs@cd3c865) Bump :ui doom
* [`7a276dbf`](doomemacs/doomemacs@7a276db) Restore evil keybinds for mu4e-view-mode doomemacs/doomemacs#3464
* [`2441d28a`](doomemacs/doomemacs@2441d28) Fix wrong-number-of-args error from cmd!! macro
* [`afcf56a6`](doomemacs/doomemacs@afcf56a) Redesign dwim RET on org headings
* [`807eb82b`](doomemacs/doomemacs@807eb82) docs/faq: add "How to make a new theme"
* [`e6ae1d29`](doomemacs/doomemacs@e6ae1d2) Add support for pyright language server
* [`99d5cd1f`](doomemacs/doomemacs@99d5cd1) Check +emacs-lisp-disable-flycheck-in-dirs against default-directory
* [`b8a8ca9b`](doomemacs/doomemacs@b8a8ca9) Consider any window with no-other-window a popup
* [`e71b7fc7`](doomemacs/doomemacs@e71b7fc) Revise comments in core.el
* [`b2787a94`](doomemacs/doomemacs@b2787a9) Fix doomemacs/doomemacs#3627: persist auto-yasnippet snippets
* [`711e6877`](doomemacs/doomemacs@711e687) config/literate: expand #+INCLUDE directives
* [`8da31dbb`](doomemacs/doomemacs@8da31db) config/literate: update & revise readme
* [`4b960393`](doomemacs/doomemacs@4b96039) bin/org-tangle: expand #+INCLUDE directives
* [`d41df5f2`](doomemacs/doomemacs@d41df5f) editor/format: add README doomemacs/doomemacs#1166
* [`8c2026b4`](doomemacs/doomemacs@8c2026b) docs/getting_started: revise & expand "Writing your own modules"
* [`135929d4`](doomemacs/doomemacs@135929d) docs/getting_started: fix heading hierarchy
* [`69ce5d5e`](doomemacs/doomemacs@69ce5d5) docs/getting_started: update ToC
* [`e1fc2db7`](doomemacs/doomemacs@e1fc2db) Disable line numbers in dashboard
* [`6ca9e0e2`](doomemacs/doomemacs@6ca9e0e) Fix doomemacs/doomemacs#3632: wrong-number-of-args on setq-local
* [`e7c21634`](doomemacs/doomemacs@e7c2163) Remove company-prescient
* [`e52993fe`](doomemacs/doomemacs@e52993f) completion/company: update README's package list
* [`0f39d7bd`](doomemacs/doomemacs@0f39d7b) lang/cc: remove unnecessary settings
* [`e6979166`](doomemacs/doomemacs@e697916) Disable flycheck in racket-xp-mode
* [`076cee4e`](doomemacs/doomemacs@076cee4) Revise +org--insert-item
* [`12e414be`](doomemacs/doomemacs@12e414b) Rename +org/toggle-clock -> +org/toggle-last-clock
* [`629c7bed`](doomemacs/doomemacs@629c7be) Rename λ! (deprecated) -> cmd!
* [`b2e11f9a`](doomemacs/doomemacs@b2e11f9) Revise docstrings for org hooks
* [`a5c509af`](doomemacs/doomemacs@a5c509a) lang/org: org-catch-invisible-edits = 'smart
* [`cacc9d2e`](doomemacs/doomemacs@cacc9d2) lang/org: org-list-allow-alphabetical = t
* [`ccfaf3f4`](doomemacs/doomemacs@ccfaf3f) Move auto-mode-alist fallbacks to bottom
* [`87199113`](doomemacs/doomemacs@8719911) SPC f d -> +default/dired
* [`8dfe8840`](doomemacs/doomemacs@8dfe884) docs/faq: add "My keybinds don't work"
* [`6ebdbafb`](doomemacs/doomemacs@6ebdbaf) Bump :lang python
* [`046dfb64`](doomemacs/doomemacs@046dfb6) lang/python: refactor lsp integration
* [`0e732977`](doomemacs/doomemacs@0e73297) lang/org: fix edge case in +org--insert-item
* [`ccccb976`](doomemacs/doomemacs@ccccb97) tools/magit: map Forge jumps in evil-mode
* [`9c96feba`](doomemacs/doomemacs@9c96feb) Fix wrong-type-arg stringp error on +default/dired
* [`af7f5d0f`](doomemacs/doomemacs@af7f5d0) tools/magit: merge Forge jumps with evil-magit
* [`d8af5c3c`](doomemacs/doomemacs@d8af5c3) Support native compilation of packages
* [`b9b987e1`](doomemacs/doomemacs@b9b987e) Optimize straight build step
* [`57c08638`](doomemacs/doomemacs@57c0863) Fix aggressive native recompilation of packages
* [`d1c2a444`](doomemacs/doomemacs@d1c2a44) [UI] Set prompt to readonly in comint buffers
* [`1a6f5086`](doomemacs/doomemacs@1a6f508) Fix doomemacs/doomemacs#3504: evil-ex-substitute-global = nil
* [`2e1775c4`](doomemacs/doomemacs@2e1775c) docs/api: fix inline command in map! example
* [`095b3297`](doomemacs/doomemacs@095b329) Register workspace buffers opened via bookmark-jump
* [`9c1a356a`](doomemacs/doomemacs@9c1a356) Update help keybinds in 'doom install' postamble
* [`d006f76d`](doomemacs/doomemacs@d006f76) org-roam: check for sqlite3 executable in doctor
* [`d2f7999c`](doomemacs/doomemacs@d2f7999) Don't close treemacs on ESC doomemacs/doomemacs#1970
* [`34e80471`](doomemacs/doomemacs@34e8047) Fix doomemacs/doomemacs#3645: stringp error starting up org-roam
* [`edf5249d`](doomemacs/doomemacs@edf5249) Bump :tools lsp debugger
* [`b604e38d`](doomemacs/doomemacs@b604e38) Bump :ui treemacs
* [`048b086d`](doomemacs/doomemacs@048b086) Add calfw-cal dependency to allow local cal source
* [`66e9b0af`](doomemacs/doomemacs@66e9b0a) Bump :lang gdscript
* [`09248015`](doomemacs/doomemacs@0924801) Fix doomemacs/doomemacs#3650: void-variable tab-prefix-map
ymarco pushed a commit to ymarco/doom-emacs that referenced this issue Aug 9, 2020
This directory is used when server-use-tcp is non-nil (which is the case
on Windows). With this changed from its default, users have to manually
specify its location when using emacsclientw.exe to connect to daemons.

This means a little more noise in `~/.emacs.d`, but Windows users have
worse things to put up with.

Fixes doomemacs#3324
ymarco pushed a commit to ymarco/doom-emacs that referenced this issue Aug 9, 2020
vlaci pushed a commit to vlaci/nix-doom-emacs that referenced this issue Aug 15, 2020
## Changelog for doom-emacs:
Commits: [doomemacs/doomemacs@15f0bccd...09248015](doomemacs/doomemacs@15f0bcc...0924801)

* [`03add77b`](doomemacs/doomemacs@03add77) Elixir formats long numbers with an underscore
* [`ad6da92f`](doomemacs/doomemacs@ad6da92) Update config.el
* [`a282730c`](doomemacs/doomemacs@a282730) Fix typos and reword docstrings
* [`205aed59`](doomemacs/doomemacs@205aed5) Update dart module README
* [`f4c2c7f9`](doomemacs/doomemacs@f4c2c7f) Bump :lang org
* [`6e600914`](doomemacs/doomemacs@6e60091) Bump :lang ruby
* [`f8d3064e`](doomemacs/doomemacs@f8d3064) Bump :tools ansible
* [`d70b2ff7`](doomemacs/doomemacs@d70b2ff) docs/faq: add "How to disable smartparens" doomemacs/doomemacs#3609
* [`316a9b87`](doomemacs/doomemacs@316a9b8) docs/faq: add "How to maximize/fullscreen at startup"
* [`0ebb5cf3`](doomemacs/doomemacs@0ebb5cf) docs/faq: add "Why sharp-quote functions"
* [`1e0cd6dd`](doomemacs/doomemacs@1e0cd6d) docs/faq: add "Is Doom a fork of spacemacs/prelude/etc?"
* [`f99c3fb3`](doomemacs/doomemacs@f99c3fb) docs/faq: "Why is scrolling slow"->"Why is Emacs slow"
* [`e6221844`](doomemacs/doomemacs@e622184) docs/faq: general revision & reformatting
* [`e517da66`](doomemacs/doomemacs@e517da6) docs/api: fix "Centered frame" snippet
* [`091635d5`](doomemacs/doomemacs@091635d) docs/api: add missing TOC entry
* [`25008382`](doomemacs/doomemacs@2500838) Fix void-variable: lua-lsp-dir
* [`cd40d45c`](doomemacs/doomemacs@cd40d45) docs/faq: minor corrections & revision
* [`2bb88e24`](doomemacs/doomemacs@2bb88e2) docs/faq: Add "~/.emacs.d/server is unsafe" error
* [`d2117b78`](doomemacs/doomemacs@d2117b7) docs/faq: add "How to share/sync config between computers"
* [`87d17fab`](doomemacs/doomemacs@87d17fa) docs/getting_started: general revision
* [`976a6017`](doomemacs/doomemacs@976a601) docs/getting_started: add install guides for Windows
* [`9ec54284`](doomemacs/doomemacs@9ec5428) Set core.autocrlf = true in repos on Windows doomemacs/doomemacs#2637
* [`a78c3973`](doomemacs/doomemacs@a78c397) Add server/ to gitignore doomemacs/doomemacs#3324
* [`47a350f6`](doomemacs/doomemacs@47a350f) jinja2-enable-indent-on-save = nil doomemacs/doomemacs#3555
* [`61cb7252`](doomemacs/doomemacs@61cb725) Fix doomemacs/doomemacs#3509 again
* [`bcc1b84e`](doomemacs/doomemacs@bcc1b84) Increase so-long threshold for softwrapped text modes
* [`3aeb1778`](doomemacs/doomemacs@3aeb177) Add +literate-enable-recompile-h to enable save-on-tangle
* [`ff21dfe5`](doomemacs/doomemacs@ff21dfe) Revise :config literate README
* [`cd3c865c`](doomemacs/doomemacs@cd3c865) Bump :ui doom
* [`7a276dbf`](doomemacs/doomemacs@7a276db) Restore evil keybinds for mu4e-view-mode doomemacs/doomemacs#3464
* [`2441d28a`](doomemacs/doomemacs@2441d28) Fix wrong-number-of-args error from cmd!! macro
* [`afcf56a6`](doomemacs/doomemacs@afcf56a) Redesign dwim RET on org headings
* [`807eb82b`](doomemacs/doomemacs@807eb82) docs/faq: add "How to make a new theme"
* [`e6ae1d29`](doomemacs/doomemacs@e6ae1d2) Add support for pyright language server
* [`99d5cd1f`](doomemacs/doomemacs@99d5cd1) Check +emacs-lisp-disable-flycheck-in-dirs against default-directory
* [`b8a8ca9b`](doomemacs/doomemacs@b8a8ca9) Consider any window with no-other-window a popup
* [`e71b7fc7`](doomemacs/doomemacs@e71b7fc) Revise comments in core.el
* [`b2787a94`](doomemacs/doomemacs@b2787a9) Fix doomemacs/doomemacs#3627: persist auto-yasnippet snippets
* [`711e6877`](doomemacs/doomemacs@711e687) config/literate: expand #+INCLUDE directives
* [`8da31dbb`](doomemacs/doomemacs@8da31db) config/literate: update & revise readme
* [`4b960393`](doomemacs/doomemacs@4b96039) bin/org-tangle: expand #+INCLUDE directives
* [`d41df5f2`](doomemacs/doomemacs@d41df5f) editor/format: add README doomemacs/doomemacs#1166
* [`8c2026b4`](doomemacs/doomemacs@8c2026b) docs/getting_started: revise & expand "Writing your own modules"
* [`135929d4`](doomemacs/doomemacs@135929d) docs/getting_started: fix heading hierarchy
* [`69ce5d5e`](doomemacs/doomemacs@69ce5d5) docs/getting_started: update ToC
* [`e1fc2db7`](doomemacs/doomemacs@e1fc2db) Disable line numbers in dashboard
* [`6ca9e0e2`](doomemacs/doomemacs@6ca9e0e) Fix doomemacs/doomemacs#3632: wrong-number-of-args on setq-local
* [`e7c21634`](doomemacs/doomemacs@e7c2163) Remove company-prescient
* [`e52993fe`](doomemacs/doomemacs@e52993f) completion/company: update README's package list
* [`0f39d7bd`](doomemacs/doomemacs@0f39d7b) lang/cc: remove unnecessary settings
* [`e6979166`](doomemacs/doomemacs@e697916) Disable flycheck in racket-xp-mode
* [`076cee4e`](doomemacs/doomemacs@076cee4) Revise +org--insert-item
* [`12e414be`](doomemacs/doomemacs@12e414b) Rename +org/toggle-clock -> +org/toggle-last-clock
* [`629c7bed`](doomemacs/doomemacs@629c7be) Rename λ! (deprecated) -> cmd!
* [`b2e11f9a`](doomemacs/doomemacs@b2e11f9) Revise docstrings for org hooks
* [`a5c509af`](doomemacs/doomemacs@a5c509a) lang/org: org-catch-invisible-edits = 'smart
* [`cacc9d2e`](doomemacs/doomemacs@cacc9d2) lang/org: org-list-allow-alphabetical = t
* [`ccfaf3f4`](doomemacs/doomemacs@ccfaf3f) Move auto-mode-alist fallbacks to bottom
* [`87199113`](doomemacs/doomemacs@8719911) SPC f d -> +default/dired
* [`8dfe8840`](doomemacs/doomemacs@8dfe884) docs/faq: add "My keybinds don't work"
* [`6ebdbafb`](doomemacs/doomemacs@6ebdbaf) Bump :lang python
* [`046dfb64`](doomemacs/doomemacs@046dfb6) lang/python: refactor lsp integration
* [`0e732977`](doomemacs/doomemacs@0e73297) lang/org: fix edge case in +org--insert-item
* [`ccccb976`](doomemacs/doomemacs@ccccb97) tools/magit: map Forge jumps in evil-mode
* [`9c96feba`](doomemacs/doomemacs@9c96feb) Fix wrong-type-arg stringp error on +default/dired
* [`af7f5d0f`](doomemacs/doomemacs@af7f5d0) tools/magit: merge Forge jumps with evil-magit
* [`d8af5c3c`](doomemacs/doomemacs@d8af5c3) Support native compilation of packages
* [`b9b987e1`](doomemacs/doomemacs@b9b987e) Optimize straight build step
* [`57c08638`](doomemacs/doomemacs@57c0863) Fix aggressive native recompilation of packages
* [`d1c2a444`](doomemacs/doomemacs@d1c2a44) [UI] Set prompt to readonly in comint buffers
* [`1a6f5086`](doomemacs/doomemacs@1a6f508) Fix doomemacs/doomemacs#3504: evil-ex-substitute-global = nil
* [`2e1775c4`](doomemacs/doomemacs@2e1775c) docs/api: fix inline command in map! example
* [`095b3297`](doomemacs/doomemacs@095b329) Register workspace buffers opened via bookmark-jump
* [`9c1a356a`](doomemacs/doomemacs@9c1a356) Update help keybinds in 'doom install' postamble
* [`d006f76d`](doomemacs/doomemacs@d006f76) org-roam: check for sqlite3 executable in doctor
* [`d2f7999c`](doomemacs/doomemacs@d2f7999) Don't close treemacs on ESC doomemacs/doomemacs#1970
* [`34e80471`](doomemacs/doomemacs@34e8047) Fix doomemacs/doomemacs#3645: stringp error starting up org-roam
* [`edf5249d`](doomemacs/doomemacs@edf5249) Bump :tools lsp debugger
* [`b604e38d`](doomemacs/doomemacs@b604e38) Bump :ui treemacs
* [`048b086d`](doomemacs/doomemacs@048b086) Add calfw-cal dependency to allow local cal source
* [`66e9b0af`](doomemacs/doomemacs@66e9b0a) Bump :lang gdscript
* [`09248015`](doomemacs/doomemacs@0924801) Fix doomemacs/doomemacs#3650: void-variable tab-prefix-map
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 30, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
is:bug Something isn't working as intended module:core Relevant to Doom core os:windows Pertains specifically to Windows re:defaults Regarding Doom's defaults re:emacs:daemon Pertains to the Emacs daemon status:resolved Issue was addressed internally
Projects
None yet
Development

No branches or pull requests

3 participants