diff --git a/helm-elisp.el b/helm-elisp.el index 69064b682..4b9b7d931 100644 --- a/helm-elisp.el +++ b/helm-elisp.el @@ -791,10 +791,7 @@ is only used to test DEFAULT." (unless (memq 'helm-apropos helm-commands-using-frame) (setq helm-M-x-show-short-doc (not helm-M-x-show-short-doc) helm-apropos-show-short-doc (not helm-apropos-show-short-doc)) - (helm-update (concat "^" (pcase (helm-get-selection) - ((and (pred stringp) str) str) - ((and (pred symbolp) sym) - (symbol-name sym)))) + (helm-update (concat "^" (helm-stringify (helm-get-selection))) (helm-get-current-source))))) ;;;###autoload diff --git a/helm-lib.el b/helm-lib.el index 565db187a..d337a4673 100644 --- a/helm-lib.el +++ b/helm-lib.el @@ -1045,10 +1045,10 @@ Examples: (defun helm-stringify (elm) "Return the representation of ELM as a string. ELM can be a string, a number or a symbol." - (cl-typecase elm - (string elm) - (number (number-to-string elm)) - (symbol (symbol-name elm)))) + (pcase elm + ((pred stringp) elm) + ((pred numberp) (number-to-string elm)) + ((pred symbolp) (symbol-name elm)))) (defun helm-substring (str width) "Return the substring of string STR from 0 to WIDTH.