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

Turn off message in new buffer #48

Closed
brotzeit opened this issue Jul 25, 2018 · 9 comments
Closed

Turn off message in new buffer #48

brotzeit opened this issue Jul 25, 2018 · 9 comments

Comments

@brotzeit
Copy link
Contributor

Every time I open a new file in a project with eglot running I get this message. Is there an option to disable it ?

`[eglot]` Automatically started `rustfmt' to manage `rustic-mode' buffers in project `rustfmt'
@brotzeit brotzeit changed the title Turn off message in new eglot buffer Turn off message in new buffer Jul 25, 2018
@joaotavora
Copy link
Owner

There are two problems here:

  • First the message has a bug. It should state the server name, and not the project nickname in the first space.
  • Also, you seem to have eglot-ensure in your rustic-mode-hook That's fine (as long as you have it only in that hook and nowhere else, so please confirm this bit). However, that particular message shouldn't be displayed if you open a file in the same project. This is the message that should be displayed:
<buffer-name> is already managed by existing `rustfmt'

So now two more points:

  1. Are you sure that isn't the message that you're seeing repeatedly and would like to hide?
  2. If you answered yes to 1 and you are seeing the "Automatically started..." thing, then we have a more serious bug. To analyse that, I need you to try to reproduce the problem with a minimal emacs+eglot+rustic configuration and post the detailed steps here, without omitting anything.

joaotavora added a commit that referenced this issue Jul 25, 2018
* eglot.el (eglot-ensure): fix messages.
@brotzeit
Copy link
Contributor Author

brotzeit commented Jul 26, 2018

  1. I copied the message from the log
  2. I just open emacs with the config below and open a file in a git repo.

Complete config:

(setq package-archives '(("melpa" . "http://melpa.org/packages/")))

(require 'package)
(package-initialize)

(unless (package-installed-p 'use-package)
  (package-refresh-contents)
  (package-install 'use-package))

(use-package rustic :ensure t :pin melpa)
(use-package eglot :ensure t :pin melpa)
(setq rustic-rls-pkg 'eglot)

I realized that rustfmt is the project name. I've tried this in the rls git repo and now the message contains rls.

But in the rls repo I also get an error:
[eglot] Server reports (type=1): Cargo failed: Error compiling dependent crate[eglot] Server reports (type=1): Cargo failed: Error compiling dependent crate

@joaotavora
Copy link
Owner

@brotzeit,

Thanks. So I tried your config and didn't spot the second more serious problem, which is good. Everything works as intended.

When I open a file on a previously untouched Rust project, I first get the message

[eglot] Automatically started `EGLOT (guessing_game/rustic-mode)' to manage `rustic-mode' buffers in project `guessing_game'

The, after each new opened file in that project I get the second message

[eglot] Buffer is already managed by existing `guessing_game'
[eglot] Buffer is already managed by existing `guessing_game'
[eglot] Buffer is already managed by existing `guessing_game'
[eglot] Buffer is already managed by existing `guessing_game'
...

I asked you this before: it is the second repeating message that you want to get rid of. Not the first, right?

PS: the RLS problem doesn't seem to have anything to do with Eglot, which is just forwarding you the error message.

@brotzeit
Copy link
Contributor Author

I asked you this before: it is the second repeating message that you want to get rid of. Not the first, right?

I'm not sure about this. I think I only want to be informed if it doesn't work as expected. If I can see in the mode line that a server is running, I don't need an additional message. What do you think ?

PS: the RLS problem doesn't seem to have anything to do with Eglot, which is just forwarding you the error message.

I know. I just wanted to mention it for completeness.

@joaotavora
Copy link
Owner

What do you think ?

I fully agree. But you still haven't confirmed exactly what message you are repeatedly seeing for which new file you open. That's the question I've asked twice. I suppose its not the one you originally mention, but the other one I presented. Please confirm this.

@brotzeit
Copy link
Contributor Author

Sorry, it's the second line.

[eglot] Buffer is already managed by existing `guessing_game'

@brotzeit
Copy link
Contributor Author

I copied the wrong message in the first post...

@joaotavora
Copy link
Owner

I copied the wrong message in the first post...

Yeah, I figured. But I still had to make sure, because if you hadn't it would be an indication of a much more serious problem. This is why I insisted so much with an analysis and reproduction recipe.

Anyway, I think I fixed the problem for you.

@brotzeit
Copy link
Contributor Author

Thanks.

bhankas pushed a commit to bhankas/emacs that referenced this issue Sep 18, 2022
* eglot.el (eglot-ensure): fix messages.
bhankas pushed a commit to bhankas/emacs that referenced this issue Sep 18, 2022
* eglot.el (eglot-ensure): Don't message when a buffer is already
managed.
bhankas pushed a commit to bhankas/emacs that referenced this issue Sep 19, 2022
* eglot.el (eglot-ensure): fix messages.
bhankas pushed a commit to bhankas/emacs that referenced this issue Sep 19, 2022
* eglot.el (eglot-ensure): Don't message when a buffer is already
managed.
bhankas pushed a commit to bhankas/emacs that referenced this issue Sep 19, 2022
* eglot.el (eglot-ensure): fix messages.
#48: joaotavora/eglot#48
bhankas pushed a commit to bhankas/emacs that referenced this issue Sep 19, 2022
* eglot.el (eglot-ensure): Don't message when a buffer is already
managed.

#48: joaotavora/eglot#48
jollaitbot pushed a commit to sailfishos-mirror/emacs that referenced this issue Oct 12, 2022
* eglot.el (eglot-ensure): fix messages.

GitHub-reference: per joaotavora/eglot#48
jollaitbot pushed a commit to sailfishos-mirror/emacs that referenced this issue Oct 12, 2022
* eglot.el (eglot-ensure): Don't message when a buffer is already
managed.

GitHub-reference: close joaotavora/eglot#48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants