diff options
author | Simon Parri <simonparri@ganzeria.com> | 2025-08-26 11:54:02 -0500 |
---|---|---|
committer | Simon Parri <simonparri@ganzeria.com> | 2025-08-26 11:54:02 -0500 |
commit | 80aa09a9caa52e6ff0ab6765b2a2722f3fc71785 (patch) | |
tree | c3899edb9411a838ddf3c8fa258c14332f323726 /common/.emacs.d/init.el | |
parent | b27b1bcaf2994efe1293e2ad9764b005071a72af (diff) | |
download | dotfiles-80aa09a9caa52e6ff0ab6765b2a2722f3fc71785.tar.gz dotfiles-80aa09a9caa52e6ff0ab6765b2a2722f3fc71785.zip |
Emacs: Fix mu contact completion when there are no matching contacts
Diffstat (limited to 'common/.emacs.d/init.el')
-rw-r--r-- | common/.emacs.d/init.el | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/common/.emacs.d/init.el b/common/.emacs.d/init.el index 3ec6f05..0a7f33e 100644 --- a/common/.emacs.d/init.el +++ b/common/.emacs.d/init.el @@ -2007,12 +2007,15 @@ buffer's text scale." end (completion-table-dynamic (lambda (string) - (thread-last - (shell-quote-argument string) - (format "mu cfind --format=json %s") - shell-command-to-string - json-parse-string - (mapcar (lambda (h) (gethash "display" h)))))) + (let ((jsonstr + (thread-last + (shell-quote-argument string) + (format "mu cfind --format=json %s 2>/dev/null") + shell-command-to-string))) + (when (not (string-empty-p jsonstr)) + (thread-last + (json-parse-string jsonstr) + (mapcar (lambda (h) (gethash "display" h)))))))) :exclusive 'no)))) (add-hook 'message-mode-hook |