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

Suppress mdfind UserQueryParser output #3037

Merged
merged 2 commits into from
Mar 31, 2024
Merged

Conversation

VitoVan
Copy link
Contributor

@VitoVan VitoVan commented Mar 31, 2024

Sometimes on macOS, mdfind would output some non-result messages,

for example:

mdfind -name "vim xml"
2024-03-31 08:03:00.375 mdfind[8907:1002287] [UserQueryParser] Loading keywords and predicates for locale "en_US"
2024-03-31 08:03:00.375 mdfind[8907:1002287] [UserQueryParser] Loading keywords and predicates for locale "en"
/usr/share/vim/vim90/ftplugin/ps1xml.vim
/usr/share/vim/vim90/ftplugin/xml.vim
/usr/share/vim/vim90/indent/xml.vim

Sometimes on macOS, `mdfind` would output some non-result messages,
for example:

mdfind -name "vim xml"
2024-03-31 08:03:00.375 mdfind[8907:1002287] [UserQueryParser] Loading keywords and predicates for locale "en_US"
2024-03-31 08:03:00.375 mdfind[8907:1002287] [UserQueryParser] Loading keywords and predicates for locale "en"
/usr/share/vim/vim90/ftplugin/ps1xml.vim
/usr/share/vim/vim90/ftplugin/xml.vim
/usr/share/vim/vim90/indent/xml.vim

See also https://developer.apple.com/forums/thread/728927.

* counsel.el (counsel-locate-cmd-mdfind): Suppress stderr (abo-abo#3037).

Copyright-paperwork-exempt: yes
* counsel.el (counsel--null-device): New function.
(counsel-locate-cmd-mdfind, counsel-grep-occur): Use it.
@basil-conto basil-conto merged commit ee56399 into abo-abo:master Mar 31, 2024
15 checks passed
@basil-conto
Copy link
Collaborator

basil-conto commented Mar 31, 2024

Thanks!

Let me know if there are any issues with the use of null-device I added.

@VitoVan
Copy link
Contributor Author

VitoVan commented Apr 1, 2024

Ah, thank you.

I don't know about the Emacs version of null-device before, it looks good to me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants