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

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

[elpa] externals/compat 2514d35259 4/4: alist-get: Minor cleanup


From: ELPA Syncer
Subject: [elpa] externals/compat 2514d35259 4/4: alist-get: Minor cleanup
Date: Mon, 9 Jan 2023 09:57:27 -0500 (EST)

branch: externals/compat
commit 2514d35259a1a1abef90ccc9be9e903ec9b70e78
Author: Daniel Mendler <mail@daniel-mendler.de>
Commit: Daniel Mendler <mail@daniel-mendler.de>

    alist-get: Minor cleanup
---
 compat-26.el    | 3 +--
 compat-28.el    | 4 ++--
 compat-tests.el | 1 +
 3 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/compat-26.el b/compat-26.el
index b08dd3f89c..d2e60314e0 100644
--- a/compat-26.el
+++ b/compat-26.el
@@ -67,8 +67,7 @@ SEQUENCE may be a list, a vector, a boolean vector, or a 
string."
          ((catch 'found
             (dolist (ent alist)
               (when (and (consp ent) (funcall testfn (car ent) key))
-                (throw 'found (setq entry ent))))
-            default)))
+                (throw 'found (setq entry ent)))))))
         (if entry (cdr entry) default))
     (alist-get key alist default remove)))
 
diff --git a/compat-28.el b/compat-28.el
index b5fc0fcf4a..43d2c9146c 100644
--- a/compat-28.el
+++ b/compat-28.el
@@ -27,7 +27,7 @@
 
 ;;;; Defined in fns.c
 
-;;* INCOMPLETE FEATURE: Should handle multibyte regular expressions
+;; FIXME Should handle multibyte regular expressions
 (compat-defun string-search (needle haystack &optional start-pos) ;; <OK>
   "Search for the string NEEDLE in the strign HAYSTACK.
 
@@ -290,7 +290,7 @@ If LENGTH is nil, use the window width."
 
 ;;;; Defined in subr.el
 
-;;* INCOMPLETE FEATURE: Should handle multibyte regular expressions
+;; FIXME Should handle multibyte regular expressions
 (compat-defun string-replace (fromstring tostring instring) ;; <OK>
   "Replace FROMSTRING with TOSTRING in INSTRING each time it occurs."
   (when (equal fromstring "")
diff --git a/compat-tests.el b/compat-tests.el
index e1f2aea15c..c1a812cad8 100644
--- a/compat-tests.el
+++ b/compat-tests.el
@@ -1679,6 +1679,7 @@
 
   ;; With testfn:
   (should-equal 1 (compat-call alist-get "a" '(("a" . 1) ("b" . 2) ("c" . 3)) 
nil nil #'equal))
+  (should-equal 'd (compat-call alist-get "x" '(("a" . 1) ("b" . 2) ("c" . 3)) 
'd nil #'equal))
   (should-equal 1 (compat-call alist-get 3 '((10 . 10) (4 . 4) (1 . 1) (9 . 
9)) nil nil #'<))
   (should-equal '(a) (compat-call alist-get "b" '(("c" c) ("a" a) ("b" b)) nil 
nil #'string-lessp))
   (should-equal 'c (compat-call alist-get "a" '(("a" . a) ("a" . b) ("b" . c)) 
nil nil



reply via email to

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