branch: externals/compat commit 70e5842a99c786c6ae1878120ea4c9df45ab15ac Author: Daanturo <daant...@gmail.com> Commit: Philip Kaludercic <phil...@posteo.net>
Fix evaluating after-load-alist for Emacs 24.3 For Emacs 24.3, `after-load-alist` includes forms (for `eval`) instead of functions like 24.4 and above. Also when subr-x, return the feature as symbol. --- compat-24.el | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/compat-24.el b/compat-24.el index d38f0511b4..51bd31e279 100644 --- a/compat-24.el +++ b/compat-24.el @@ -385,15 +385,19 @@ When IGNORE-CASE is non-nil, FUN is expected to be case-insensitive." ;;* UNTESTED (compat-advise require (feature &rest args) - "Allow for Emacs 24.x to require the inexistent FEATURE subr-x." + "Allow for Emacs 24.3 to require the inexistent FEATURE subr-x." + :version "24.4" ;; As the compatibility advise around `require` is more a hack than ;; of of actual value, the highlighting is suppressed. :no-highlight t (if (eq feature 'subr-x) - (let ((entry (assq feature after-load-alist))) - (let ((load-file-name nil)) - (dolist (form (cdr entry)) - (funcall (eval form t))))) + (progn + (unless (memq 'subr-x features) + (push 'subr-x features) + (dolist (a-l-element after-load-alist) + (when (eq (car a-l-element) 'subr-x) + (mapc #'eval (cdr a-l-element))))) + 'subr-x) (apply oldfun feature args))) (compat-defun hash-table-keys (hash-table)