[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/compat 50767a8 90/99: Load deferred code even if file d
From: |
ELPA Syncer |
Subject: |
[elpa] externals/compat 50767a8 90/99: Load deferred code even if file doesn't exist |
Date: |
Sun, 17 Oct 2021 05:58:03 -0400 (EDT) |
branch: externals/compat
commit 50767a8cd21dbe7fbd3415487f5d28331e63f42f
Author: Philip Kaludercic <philipk@posteo.net>
Commit: Philip Kaludercic <philipk@posteo.net>
Load deferred code even if file doesn't exist
---
compat-macs.el | 10 ++++++----
compat.el | 18 +++++++++++++-----
2 files changed, 19 insertions(+), 9 deletions(-)
diff --git a/compat-macs.el b/compat-macs.el
index 46ea7aa..3f710d2 100644
--- a/compat-macs.el
+++ b/compat-macs.el
@@ -102,10 +102,12 @@ TYPE is used to set the symbol property `compat-type' for
NAME."
(put ',realname 'compat-version ,version)
,(funcall def-fn realname version)
,(if feature
- ;; Warning: This might be able throw an error if the code
- ;; is not byte compiled, as explained in:
- ;; https://nullprogram.com/blog/2018/02/22/.
- `(eval-after-load ',feature (lambda () ,body))
+ `(progn
+ (put ',feature 'setup-deferred-p t)
+ ;; Warning: This might be able throw an error if the code
+ ;; is not byte compiled, as explained in:
+ ;; https://nullprogram.com/blog/2018/02/22/.
+ (eval-after-load ',feature (lambda () ,body)))
body))))
(defun compat-common-fdefine (type name arglist docstring rest)
diff --git a/compat.el b/compat.el
index 2ec5aaa..515e34f 100644
--- a/compat.el
+++ b/compat.el
@@ -145,14 +145,22 @@ advice."
(compat-advise require (feature &optional filename noerror)
"Avoid throwing an error if library has compatibility code."
;; As the compatibility advise around `require` is more a hack than
- ;; of of actual value, the highlighting is supressed.
+ ;; of of actual value, the highlighting is suppressed.
:no-highlight t
(condition-case err
- (funcall oldfun feature filename noerror)
+ (funcall oldfun feature filename)
(file-missing
- ;; FIXME: avoid false negatives, check if compat defined a
- ;; feature.
- (unless (assq feature after-load-alist)
+ (let ((entry (assq feature after-load-alist)))
+ (unless (and entry
+ (get feature 'setup-deferred-p)
+ (null noerror))
+ (signal (car err) (cdr err)))
+ (let ((load-file-name nil))
+ (dolist (form (cdr entry))
+ (funcall (eval form t))))
+ feature))
+ (error
+ (unless noerror
(signal (car err) (cdr err))))))
;; Load the actual compatibility definitions:
- [elpa] externals/compat 86fb58f 64/99: Move compat--alist-get-full-elisp to emacs-25.1, (continued)
- [elpa] externals/compat 86fb58f 64/99: Move compat--alist-get-full-elisp to emacs-25.1, ELPA Syncer, 2021/10/17
- [elpa] externals/compat 954c97b 67/99: Update compat-tests header, ELPA Syncer, 2021/10/17
- [elpa] externals/compat 5cd751b 68/99: Mention GitHub issue tracker in README, ELPA Syncer, 2021/10/17
- [elpa] externals/compat 598a040 69/99: Add :cond check to lookup-key, ELPA Syncer, 2021/10/17
- [elpa] externals/compat b16122b 71/99: Use explicit symbol names instead of alii, ELPA Syncer, 2021/10/17
- [elpa] externals/compat a7d9649 72/99: Manually advise functions when nadvice is not available, ELPA Syncer, 2021/10/17
- [elpa] externals/compat 904d660 74/99: Add documentation to manual advice wrapper, ELPA Syncer, 2021/10/17
- [elpa] externals/compat e689153 76/99: Merge compile and run into one GitHub Action job, ELPA Syncer, 2021/10/17
- [elpa] externals/compat c37e1d1 80/99: Fix quoting in compat-macs' legacy advice installation, ELPA Syncer, 2021/10/17
- [elpa] externals/compat 18c2bf9 83/99: Autoload advised functions is necessary, ELPA Syncer, 2021/10/17
- [elpa] externals/compat 50767a8 90/99: Load deferred code even if file doesn't exist,
ELPA Syncer <=
- [elpa] externals/compat 2bb6c10 91/99: Check if function is bound before extracting documentation, ELPA Syncer, 2021/10/17
- [elpa] externals/compat f4c0979 92/99: Prevent shadowing declarations in functional compatibility code, ELPA Syncer, 2021/10/17
- [elpa] externals/compat 3257cf6 93/99: Implement TCO for named-let, ELPA Syncer, 2021/10/17
- [elpa] externals/compat 347f5a8 94/99: Change version suffix to -rc, ELPA Syncer, 2021/10/17
- [elpa] externals/compat 25879c7 95/99: Require instead of loading compat-*.el files, ELPA Syncer, 2021/10/17
- [elpa] externals/compat 5506770 99/99: Update .elpaignore, ELPA Syncer, 2021/10/17
- [elpa] externals/compat 084f18c 73/99: Declare compat functions used in file-name-with-extension, ELPA Syncer, 2021/10/17
- [elpa] externals/compat db218d0 79/99: Handle top-level JSON objects in Emacs 27.x, ELPA Syncer, 2021/10/17
- [elpa] externals/compat 8981d4b 85/99: Handle multiple signals in string-replace test case, ELPA Syncer, 2021/10/17
- [elpa] externals/compat 8ea6272 86/99: Add define-error compatibility function, ELPA Syncer, 2021/10/17