branch: elpa/helm commit f930dff6fe92045e245bca9e6509ca3da87c5feb Author: Thierry Volpiatto <thie...@posteo.net> Commit: Thierry Volpiatto <thie...@posteo.net>
Add a comp read handler for all-the-icons-insert --- helm-mode.el | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/helm-mode.el b/helm-mode.el index 9d24c39051..5f4b88c351 100644 --- a/helm-mode.el +++ b/helm-mode.el @@ -59,7 +59,8 @@ (dired-do-hardlink . helm-read-file-name-handler-1) (basic-save-buffer . helm-read-file-name-handler-1) (write-file . (default helm-read-file-name-handler-1)) - (write-region . (default helm-read-file-name-handler-1))) + (write-region . (default helm-read-file-name-handler-1)) + (all-the-icons-insert . helm-mode-all-the-icons-handler)) "Completing read functions for specific Emacs commands. By default `helm-mode' use `helm-completing-read-default-handler' to @@ -1121,6 +1122,19 @@ This handler uses dynamic matching which allows honouring `completion-styles'." :must-match require-match) (setq helm-completion--sorting-done nil)))) +(defun helm-mode-all-the-icons-handler (prompt collection test require-match + init hist default inherit-input-method + name buffer) + "A special `completing-read' handler for `all-the-icons-insert'." + (let ((cands (cl-loop for (desc . str) in collection + collect (cons (concat str + " " + (substring-no-properties desc)) + desc)))) + (helm-completing-read-default-1 prompt cands test require-match + init hist default inherit-input-method + name buffer t nil t 'buffer-substring))) + (defun helm-completing-read-default-find-tag (prompt collection test require-match init hist default inherit-input-method