emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/compat b888c2fb49 53/84: Replace when-let with expansio


From: ELPA Syncer
Subject: [elpa] externals/compat b888c2fb49 53/84: Replace when-let with expansions in compat-29
Date: Tue, 3 Jan 2023 08:57:35 -0500 (EST)

branch: externals/compat
commit b888c2fb493d8d71b93a3d5b40e092bddba0afef
Author: Philip Kaludercic <philipk@posteo.net>
Commit: Philip Kaludercic <philipk@posteo.net>

    Replace when-let with expansions in compat-29
---
 compat-29.el | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/compat-29.el b/compat-29.el
index 32783b58f7..0cd5ab3bad 100644
--- a/compat-29.el
+++ b/compat-29.el
@@ -473,8 +473,8 @@ this defaults to the current buffer."
                  (t
                   disp)))
           ;; Remove any old instances.
-          (when-let ((old (assoc prop disp)))
-            (setq disp (delete old disp)))
+          (let ((old (assoc prop disp)))
+            (when old (setq disp (delete old disp))))
           (setq disp (cons (list prop value) disp))
           (when vector
             (setq disp (seq-into disp 'vector)))
@@ -894,8 +894,9 @@ The binding is probably a symbol with a function definition.
 If optional argument ACCEPT-DEFAULT is non-nil, recognize default
 bindings; see the description of `keymap-lookup' for more details
 about this."
-  (when-let ((map (current-local-map)))
-    (compat--keymap-lookup map keys accept-default)))
+  (let ((map (current-local-map)))
+    (when map
+      (compat--keymap-lookup map keys accept-default))))
 
 ;;* UNTESTED
 (compat-defun keymap-global-lookup (keys &optional accept-default _message)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]