DarwinAwardWinner / ido-completing-read-plus

Fancy completion all over Emacs, not just for buffers and files.
GNU General Public License v3.0
241 stars 31 forks source link

Disabling dynamic update due to error: circular-list #146

Closed kurnevsky closed 6 years ago

kurnevsky commented 6 years ago

Sometimes I get this error when both ido-ubiquitous-mode and flx-ido-mode are active:

Warning (ido-cr+): Disabling dynamic update due to error: (circular-list (...

The best way to reproduce - describe function with "C-h f", enter some letters to flx start working (like "aaa") and then type left/right multiple times with any order (it uses ido-prev-match/ido-next-match).

Here is my full emacs config if anything: https://github.com/kurnevsky/dotfiles/blob/master/.emacs.d/init.el

phst commented 6 years ago

I've also seen this, it seems to be new in Emacs 26. I couldn't debug it though – whenever I use debug-on-error the debugger hangs when triggering the issue (potentially due to the circular list).

DarwinAwardWinner commented 6 years ago

Does ido continue to function after seeing that warning, or does it actually throw an error after that?

DarwinAwardWinner commented 6 years ago

As for what could be causing it, my guess is that both ido-cr+ and flx-ido are mutating the completion list in place, and both of them are assuming that they are the only one doing so. The easy fix is to have ido-cr+ disable flx-ido when dynamic updates are being used, but this is suboptimal because it means that ido will work differently based on the internals of which function is calling it.

kurnevsky commented 6 years ago

After this warning ido continue to function (without dynamic updates).

DarwinAwardWinner commented 6 years ago

Well, at least it's good to know that the error-catching facilities I added are working as intended.

kurnevsky commented 6 years ago

In case if somebody is interested - implemented workaround (turning off flx-ido-mode) for my config: https://github.com/kurnevsky/dotfiles/commit/b4daed5ea3d554b816767dbb1284bf5ea7e82de9

DarwinAwardWinner commented 6 years ago

Wow, add-variable-watcher looks like a really useful addition to Emacs 26. If everyone is sure that this is only a problem that occurs in Emacs 26, I can go ahead and put this fix directly into ido-cr+.

DarwinAwardWinner commented 6 years ago

By the way, can I ask why you're adding save-buffer to the function blacklist? I don't think that function should involve ido-cr+ at all.

kurnevsky commented 6 years ago

Sure, I have function to create new empty buffer: https://github.com/kurnevsky/dotfiles/blob/master/.emacs.d/init.el#L627 and when I save it with save-buffer it asks file name (emacs uses read-file-name inside basic-save-buffer function which is called from save-buffer). If ido is enabled it suggests only existent files, so I have to disable ido to type a new file name.

kurnevsky commented 6 years ago

If everyone is sure that this is only a problem that occurs in Emacs 26, I can go ahead and put this fix directly into ido-cr+.

Actually I didn't try to reproduce with emacs 25. But I've seen this in both 26 and 27 versions.

DarwinAwardWinner commented 6 years ago

Ido-cr+ has nothing to do with file completion, so I don't think adding save-buffer to the ido-cr+ blacklist would have any effect. You would want to disable ido-mode for that function, not ido-ubiquitous-mode.

DarwinAwardWinner commented 6 years ago

Anyway, as for fixing this issue properly, it will have to wait until Emacs 26 is released and I upgrade to it, or until they fix some issues preventing testing with Emacs 26 on Travis: https://github.com/cask/cask/issues/417

kurnevsky commented 6 years ago

Hm, indeed, it doesn't change anything. I added this when moved from helm to ido-cr+, because helm-mode affects read-file-name function as well (and it has similar blacklist). Perhaps I was misled when activated helm-mode and saw similar behaviour :)

DarwinAwardWinner commented 6 years ago

This should be fully fixed by 6861547.

kurnevsky commented 6 years ago

@DarwinAwardWinner does it mean that this workaround can be removed?

DarwinAwardWinner commented 6 years ago

Possibly. I'll have to check. Thanks for the reminder.