branch: elpa/popup commit 20ce6cbd2f06423be35b3b700c698f0e109e880c Merge: a9635a2392 bc50a5353a Author: Jen-Chieh Shen <jcs090...@gmail.com> Commit: GitHub <nore...@github.com>
Merge pull request #135 from gcv/patch-1 --- popup.el | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/popup.el b/popup.el index de730e0adf..31ed9e92b5 100644 --- a/popup.el +++ b/popup.el @@ -242,14 +242,17 @@ ITEM is not string." (defun popup-replace-displayable (str &optional rep) "Replace non-displayable character from STR. -Optional argument REP is the replacement string of non-displayable character." - (let ((result "") (rep (or rep ""))) - (mapc (lambda (ch) - (setq result (concat result - (if (char-displayable-p ch) (string ch) - rep)))) - str) - result)) +Optional argument REP is the replacement string of +non-displayable character." + (let ((rep (or rep "")) + (results (list))) + (dolist (string (split-string str "")) + (let* ((char (string-to-char string)) + (string (if (char-displayable-p char) + string + rep))) + (push string results))) + (string-join (reverse results)))) (cl-defun popup-make-item (name &key