branch: externals/counsel
commit 5ca9d7dadefb17b4f73660696253f053497ad5f7
Author: Vito Van <[email protected]>
Commit: Basil L. Contovounesios <[email protected]>
Suppress mdfind UserQueryParser output
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 (#3037).
Copyright-paperwork-exempt: yes
---
counsel.el | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/counsel.el b/counsel.el
index 67f93f5b7b..b2dce9ee43 100644
--- a/counsel.el
+++ b/counsel.el
@@ -2651,7 +2651,7 @@ library, which see."
(defun counsel-locate-cmd-mdfind (input)
"Return a `mdfind' shell command based on INPUT."
(counsel-require-program "mdfind")
- (format "mdfind -name %s" (shell-quote-argument input)))
+ (format "mdfind -name %s 2> /dev/null" (shell-quote-argument input)))
(defun counsel-locate-cmd-es (input)
"Return a `es' shell command based on INPUT."