diff options
author | Jonas Bernoulli <jonas@bernoul.li> | 2022-07-14 14:22:44 +0200 |
---|---|---|
committer | Jonas Bernoulli <jonas@bernoul.li> | 2024-07-06 17:37:23 +0200 |
commit | e3dd43e247591e588f530ed15867766aa9cc9482 (patch) | |
tree | 4cae240f44d99490f60b65fc1ede9673d2204503 | |
parent | 410a3a50d724c0aaf8d209d6a620976828854881 (diff) | |
download | geiser-e3dd43e247591e588f530ed15867766aa9cc9482.tar.gz geiser-e3dd43e247591e588f530ed15867766aa9cc9482.tar.bz2 |
Define ring-member immediately if necessary
Right above the changed lines we require `ring'. It is therefore not
necessary to delay evaluation until `ring' has been loaded; we know it
has already been loaded.
-rw-r--r-- | elisp/geiser-base.el | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/elisp/geiser-base.el b/elisp/geiser-base.el index 5436224..6100898 100644 --- a/elisp/geiser-base.el +++ b/elisp/geiser-base.el @@ -16,15 +16,14 @@ (require 'ring) -(eval-after-load "ring" - '(when (not (fboundp 'ring-member)) - (defun ring-member (ring item) - (catch 'found - (dotimes (ind (ring-length ring)) - (when (equal item (ring-ref ring ind)) - (throw 'found ind))))))) - -(when (not (fboundp 'looking-at-p)) +(unless (fboundp 'ring-member) + (defun ring-member (ring item) + (catch 'found + (dotimes (ind (ring-length ring)) + (when (equal item (ring-ref ring ind)) + (throw 'found ind)))))) + +(unless (fboundp 'looking-at-p) (defsubst looking-at-p (regexp) (with-no-warnings (let ((inhibit-changing-match-data t)) |