abo-abo / swiper

Ivy - a generic completion frontend for Emacs, Swiper - isearch with an overview, and more. Oh, man!
https://oremacs.com/swiper/
2.32k stars 338 forks source link

Inhibit echo area while ivy is active #1285

Open amosbird opened 7 years ago

amosbird commented 7 years ago

Hello, messages generated from async processes sometimes conflict with the active ivy session. Is there a way to disable any echo messages while ivy is active?

abo-abo commented 7 years ago

This is already done by binding the inhibit-message variable. Only recent (this year's) Emacs versions work with it.

amosbird commented 7 years ago

That should include emacs 25.3 right? But I don't see it working. Do I need to do some customization?

abo-abo commented 7 years ago

It should work for 25.3. Please provide the minimal steps to reproduce the bug.

amosbird commented 7 years ago

Create a file /tmp/test with content

reproduce some bug.

/* Local Variables: */
/* eval: (message "override the minibuffer") */
/* End: */

Open emacs with emacs -Q, and do

(add-to-list 'load-path "~/git/swiper")
(require 'counsel)

First open the test file and allow the local eval elisp permanently, then close the buffer, and do (counsel-rg "reproduce some bug." "/tmp/test") and do C-M-m a.k.a ivy-call

abo-abo commented 7 years ago

I'm getting a popup prompt telling that "eval:" may not be secure and if to allow it. Is that what you mean?

amosbird commented 7 years ago

No, I mean

  1. press ! to permanently allow the eval:
  2. kill that buffer
  3. reopen it via counsel-rg ivy-call
dieggsy commented 7 years ago

@abo-abo I'm also not seeing messages inhibited. I ran:

(progn (run-with-timer 3 nil (lambda () (message "Hello!"))) (ivy-switch-buffer))

Ivy pops up, and after three seconds the message shows up in ivy's place (until some action is taken).

abo-abo commented 7 years ago

@dieggsy Thanks for the pointer, your case should work now. @amosbird Does this also fix your issue?

dieggsy commented 7 years ago

@abo-abo is it possible we could use some non intrusive way to display messages in the style of lv-message in hydra?

EDIT: To clarify, your commit did seem to fix the original problem

abo-abo commented 7 years ago

is it possible we could use some non intrusive way to display messages in the style of lv-message in hydra?

Would be cool. Unfortunately, this would require a low-level change in Emacs C core. I remember I had to invest a lot of time to get inhibit-message into the C core. I don't have that kind of time currently. And then even if a C change is made, it's usable only once it makes it into a release and that release become wide spread.

dieggsy commented 7 years ago

@abo-abo not sure I understand. lv-message itself seems to somewhat work, displaying messages above the ivy minubuffer.

abo-abo commented 7 years ago

@dieggsy It's relatively easy to replace message calls with lv-message in your own code.

But that's not the problem. You want to redirect all message calls not in your own code to lv-message. Which is hard to do, because message is a C function.

dieggsy commented 7 years ago

@abo-abo Ah, I understand now. Thanks.