[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/popup 20ce6cbd2f 3/3: Merge pull request #135 from gcv/pat
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/popup 20ce6cbd2f 3/3: Merge pull request #135 from gcv/patch-1 |
Date: |
Tue, 27 Sep 2022 12:59:22 -0400 (EDT) |
branch: elpa/popup
commit 20ce6cbd2f06423be35b3b700c698f0e109e880c
Merge: a9635a2392 bc50a5353a
Author: Jen-Chieh Shen <jcs090218@gmail.com>
Commit: GitHub <noreply@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