From 5b807a1c7216ec93b9b1907aa48b79a00d4a8744 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Mon, 10 Sep 2018 12:48:19 -0400 Subject: [PATCH] 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 --- core/core-lib.el | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/core/core-lib.el b/core/core-lib.el index 993564bb0..af6408b36 100644 --- a/core/core-lib.el +++ b/core/core-lib.el @@ -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 means to remove KEY from ALIST if the new value is `eql' to DEFAULT." (ignore remove) ;;Silence byte-compiler. - (let ((x (if (not testfn) - (assq key alist) - (assoc key alist testfn)))) + (let ((x (cond ((null testfn) (assq key alist)) + ((eq testfn #'equal) (assoc key alist)) + ((cl-find key alist :key #'car :test testfn))))) (if x (cdr x) default))) (advice-add #'alist-get :override #'doom*alist-get))))