Fix alist-get polyfill's use of assoc in Emacs 25
assoc has only two arguments in Emacs 25, but the polyfill was using its third argument. This was discussed in #875
This commit is contained in:
parent
75036cefb0
commit
5b807a1c72
1 changed files with 3 additions and 3 deletions
|
@ -22,9 +22,9 @@ This is a generalized variable suitable for use with `setf'.
|
||||||
When using it to set a value, optional argument REMOVE non-nil
|
When using it to set a value, optional argument REMOVE non-nil
|
||||||
means to remove KEY from ALIST if the new value is `eql' to DEFAULT."
|
means to remove KEY from ALIST if the new value is `eql' to DEFAULT."
|
||||||
(ignore remove) ;;Silence byte-compiler.
|
(ignore remove) ;;Silence byte-compiler.
|
||||||
(let ((x (if (not testfn)
|
(let ((x (cond ((null testfn) (assq key alist))
|
||||||
(assq key alist)
|
((eq testfn #'equal) (assoc key alist))
|
||||||
(assoc key alist testfn))))
|
((cl-find key alist :key #'car :test testfn)))))
|
||||||
(if x (cdr x) default)))
|
(if x (cdr x) default)))
|
||||||
(advice-add #'alist-get :override #'doom*alist-get))))
|
(advice-add #'alist-get :override #'doom*alist-get))))
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue