aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilip Kaludercic <philipk@posteo.net>2022-08-13 15:58:09 +0200
committerPhilip Kaludercic <philipk@posteo.net>2022-08-13 15:58:09 +0200
commitb98e7cc868020a4ede2f330b73bd5aaead147cfd (patch)
tree6196ceb3bee7425dd77aa878ec7ae0e229905689
parentef5246cf5517e3120d75953e091e2e5c77398c29 (diff)
Fix gv-expander for compat-alist-get
We had previously used compat-assoc that is not always defined (e.g. when testing). By giving compat-assoc a realname, we can access it in the gv-expander.
-rw-r--r--compat-26.el3
1 files changed, 2 insertions, 1 deletions
diff --git a/compat-26.el b/compat-26.el
index a21b903..a7dcf2e 100644
--- a/compat-26.el
+++ b/compat-26.el
@@ -123,6 +123,7 @@ Equality is defined by the function TESTFN, defaulting to
`equal'. TESTFN is called with 2 arguments: a car of an alist
element and KEY. With no optional argument, the function behaves
just like `assoc'."
+ :realname compat--assoc-handle-testfn
:prefix t
(if testfn
(catch 'found
@@ -169,7 +170,7 @@ from the absolute start of the buffer, disregarding the narrowing."
(macroexp-let2 macroexp-copyable-p k key
(gv-letplace (getter setter) alist
(macroexp-let2 nil p `(if (and ,testfn (not (eq ,testfn 'eq)))
- (compat-assoc ,k ,getter ,testfn)
+ (compat--assoc-handle-testfn ,k ,getter ,testfn)
(assq ,k ,getter))
(funcall do (if (null default) `(cdr ,p)
`(if ,p (cdr ,p) ,default))