From cdcc4eec5d090e7c3ac951891ff4e08800f50e24 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Fri, 15 Jun 2018 22:10:40 +0200 Subject: [PATCH] Refactor +helm*replace-prompt In case +helm-global-prompt is nil, which will effectively disable this advice. --- modules/completion/helm/config.el | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/modules/completion/helm/config.el b/modules/completion/helm/config.el index ae0b5b5c1..6ce2696b5 100644 --- a/modules/completion/helm/config.el +++ b/modules/completion/helm/config.el @@ -54,10 +54,11 @@ ;;; Helm hacks (defun +helm*replace-prompt (plist) "Globally replace helm prompts with `+helm-global-prompt'." - (if (keywordp (car plist)) - (plist-put plist :prompt +helm-global-prompt) - (setf (nth 2 plist) +helm-global-prompt) - plist)) + (cond ((not +helm-global-prompt) plist) + ((keywordp (car plist)) + (plist-put plist :prompt +helm-global-prompt)) + ((setf (nth 2 plist) +helm-global-prompt) + plist))) (advice-add #'helm :filter-args #'+helm*replace-prompt) (defun +helm*hide-header (&rest _)