Skip to content

Commit

Permalink
fix(popup.el): Use faster popup-replace-displayable implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
jcs090218 authored Sep 27, 2022
1 parent c303445 commit a9635a2
Showing 1 changed file with 7 additions and 10 deletions.
17 changes: 7 additions & 10 deletions popup.el
Original file line number Diff line number Diff line change
Expand Up @@ -242,16 +242,13 @@ 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."
(unless rep (setq rep ""))
(let ((result ""))
(dolist (string (split-string str ""))
(let* ((char (string-to-char string))
(string (if (char-displayable-p char)
string
rep)))
(setq result (concat result string))))
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))

(cl-defun popup-make-item (name
Expand Down

0 comments on commit a9635a2

Please sign in to comment.