From ae9bfaa891c4f3cacb118aef6e35432d5fbeb88d Mon Sep 17 00:00:00 2001 From: Stefan Kangas Date: Sat, 16 Oct 2021 22:09:54 +0200 Subject: [PATCH] Simplify condition in kbd * lisp/subr.el (kbd): Simplify condition. This was discussed in: https://lists.gnu.org/r/emacs-devel/2021-10/msg01136.html --- lisp/subr.el | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/lisp/subr.el b/lisp/subr.el index e55c94a9f82..a9669ab750b 100644 --- a/lisp/subr.el +++ b/lisp/subr.el @@ -1068,13 +1068,8 @@ and should normally not be needed." (nreverse lres) lres)))) (if (and (not need-vector) - (let ((ret t)) - (dolist (ch (append res nil)) - (unless (and (characterp ch) - (let ((ch2 (logand ch (lognot ?\M-\^@)))) - (and (>= ch2 0) (<= ch2 127)))) - (setq ret nil))) - ret)) + (not (memq nil (mapcar (lambda (ch) (<= 0 ch 127)) + (append res nil))))) (concat (mapcar (lambda (ch) (if (= (logand ch ?\M-\^@) 0) ch (+ ch 128))) -- 2.39.5