alphapapa / org-ql

A searching tool for Org-mode, including custom query languages, commands, saved searches and agenda-like views, etc.
GNU General Public License v3.0
1.35k stars 104 forks source link

org-ql-find error with fido mode (built in) #411

Open johnsonmlw opened 4 months ago

johnsonmlw commented 4 months ago

OS/platform

Windows 10 and Debian Bookworm

Emacs version and provenance

Windows 10: https://ftp.gnu.org/gnu/emacs/windows/emacs-29/ emacs-29.2_1=installer.exe Debian Bookworm: apt install emacs (28.2)

Emacs command

Windows 10: shortcut from install Debian Bookworm: emacs

Org version and provenance

Windows 10: Built-in (9.6.15) Debian Bookworm: Built-in (9.6.19)

org-ql package version and provenance

melpa: 20240113.647

Actions taken

Enable fido mode org-ql-find

Observed results

[Error in post-command-hook (icomplete-post-command-hook): error "Invalid completion style flex")]

Expected results

No error

Backtrace

No response

Etc.

Disable fido mode, no error

alphapapa commented 4 months ago

Hello,

Thanks for reporting this bug. I can confirm it. However, I don't use fido-mode, and I've no idea what's causing it or how to fix it. I probably won't have time to work on this anytime soon, so patches welcome.

9viz commented 4 months ago

@johnsonmlw Does the error go away if you try the patch given in https://github.com/alphapapa/org-ql/issues/337#issuecomment-1742546764? But it should say "no matches" all the time, without returning any errors.

I think the problem is fido-mode forcefully messes with completions-style which causes org-ql not to do the work since it relies on completions-style being properly set. You can see this in the definition of icomplete--fido-mode-setup. If I use icomplete-mode rather than fido-mode, everything works fine (fido uses icomplete in the backend).

Weirdly enough though, if I use a completion-table prepared by external-completion.el, then I can use fido-mode without issues even though completions-style is still only (flex) in the minibuffer. external-completion also works in a similar way by using a custom completion-style temporarily. So this might be something that to look into to avoid errors like these in the future.

johnsonmlw commented 4 months ago

Thanks for the replies. To update: I applied the changes from the comment 9viz linked to org-ql-completing-read.el and I get the same error as in my issue report above. I might have done something wrong - I'm a little out of my depth here. I made the changes to two lines, saved, restarted emacs, tried org-ql-find, got the same error. Edit: Windows 10, emacs 29

alphapapa commented 4 months ago

@johnsonmlw You don't need to restart Emacs to apply changes. Just evaluate the form or file that you changed.