File tree Expand file tree Collapse file tree 1 file changed +11
-8
lines changed
Expand file tree Collapse file tree 1 file changed +11
-8
lines changed Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments