summaryrefslogtreecommitdiff
path: root/lisp/emacs-lisp
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/emacs-lisp')
-rw-r--r--lisp/emacs-lisp/eieio-base.el29
-rw-r--r--lisp/emacs-lisp/lisp.el2
-rw-r--r--lisp/emacs-lisp/subr-x.el2
3 files changed, 16 insertions, 17 deletions
diff --git a/lisp/emacs-lisp/eieio-base.el b/lisp/emacs-lisp/eieio-base.el
index 6b39b4f2622..e3501be6c1d 100644
--- a/lisp/emacs-lisp/eieio-base.el
+++ b/lisp/emacs-lisp/eieio-base.el
@@ -31,6 +31,7 @@
;;; Code:
(require 'eieio)
+(require 'seq)
(eval-when-compile (require 'cl-lib))
;;; eieio-instance-inheritor
@@ -308,14 +309,6 @@ Second, any text properties will be stripped from strings."
(= (length proposed-value) 1))
nil)
- ;; We have a slot with a single object that can be
- ;; saved here. Recurse and evaluate that
- ;; sub-object.
- ((and classtype (class-p classtype)
- (child-of-class-p (car proposed-value) classtype))
- (eieio-persistent-convert-list-to-object
- proposed-value))
-
;; List of object constructors.
((and (eq (car proposed-value) 'list)
;; 2nd item is a list.
@@ -346,6 +339,16 @@ Second, any text properties will be stripped from strings."
objlist))
;; return the list of objects ... reversed.
(nreverse objlist)))
+ ;; We have a slot with a single object that can be
+ ;; saved here. Recurse and evaluate that
+ ;; sub-object.
+ ((and classtype
+ (seq-some
+ (lambda (elt)
+ (child-of-class-p (car proposed-value) elt))
+ classtype))
+ (eieio-persistent-convert-list-to-object
+ proposed-value))
(t
proposed-value))))
@@ -402,13 +405,9 @@ If no class is referenced there, then return nil."
type))
((eq (car-safe type) 'or)
- ;; If type is a list, and is an or, it is possibly something
- ;; like (or null myclass), so check for that.
- (let ((ans nil))
- (dolist (subtype (cdr type))
- (setq ans (eieio-persistent-slot-type-is-class-p
- subtype)))
- ans))
+ ;; If type is a list, and is an `or', return all valid class
+ ;; types within the `or' statement.
+ (seq-filter #'eieio-persistent-slot-type-is-class-p (cdr type)))
(t
;; No match, not a class.
diff --git a/lisp/emacs-lisp/lisp.el b/lisp/emacs-lisp/lisp.el
index c3d62fd59bb..c54828e7b43 100644
--- a/lisp/emacs-lisp/lisp.el
+++ b/lisp/emacs-lisp/lisp.el
@@ -402,7 +402,7 @@ is called as a function to find the defun's beginning."
"Return non-nil if the point is in an \"emptyish\" line.
This means a line that consists entirely of comments and/or
whitespace."
-;; See http://lists.gnu.org/archive/html/help-gnu-emacs/2016-08/msg00141.html
+;; See https://lists.gnu.org/archive/html/help-gnu-emacs/2016-08/msg00141.html
(save-excursion
(forward-line 0)
(< (line-end-position)
diff --git a/lisp/emacs-lisp/subr-x.el b/lisp/emacs-lisp/subr-x.el
index edba6550fa2..5189cc4a6e8 100644
--- a/lisp/emacs-lisp/subr-x.el
+++ b/lisp/emacs-lisp/subr-x.el
@@ -28,7 +28,7 @@
;; in subr.el.
;; Do not document these functions in the lispref.
-;; http://lists.gnu.org/archive/html/emacs-devel/2014-01/msg01006.html
+;; https://lists.gnu.org/archive/html/emacs-devel/2014-01/msg01006.html
;; NB If you want to use this library, it's almost always correct to use:
;; (eval-when-compile (require 'subr-x))