Skip to content

Commit 20ce6cb

Browse files
authored
Merge pull request #135 from gcv/patch-1
2 parents a9635a2 + bc50a53 commit 20ce6cb

File tree

1 file changed

+11
-8
lines changed

1 file changed

+11
-8
lines changed

popup.el

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -242,14 +242,17 @@ ITEM is not string."
242242
(defun popup-replace-displayable (str &optional rep)
243243
"Replace non-displayable character from STR.
244244
245-
Optional argument REP is the replacement string of non-displayable character."
246-
(let ((result "") (rep (or rep "")))
247-
(mapc (lambda (ch)
248-
(setq result (concat result
249-
(if (char-displayable-p ch) (string ch)
250-
rep))))
251-
str)
252-
result))
245+
Optional argument REP is the replacement string of
246+
non-displayable character."
247+
(let ((rep (or rep ""))
248+
(results (list)))
249+
(dolist (string (split-string str ""))
250+
(let* ((char (string-to-char string))
251+
(string (if (char-displayable-p char)
252+
string
253+
rep)))
254+
(push string results)))
255+
(string-join (reverse results))))
253256

254257
(cl-defun popup-make-item (name
255258
&key

0 commit comments

Comments
 (0)