1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-01-03 10:31:37 -08:00

Add two missing 'number-or-marker' entries to the cl machinery (bug#66615)

Assuming 'number-or-marker' is a type (as present multiple times in
cl--typeof-types) adding some missing entries for coherency.

* lisp/emacs-lisp/cl-preloaded.el (cl--typeof-types): Add
'number-or-marker' as supertype of 'number' in the 'float' branch.

* lisp/emacs-lisp/cl-macs.el (cl-deftype-satisfies): Add
'number-or-marker'.

* test/lisp/emacs-lisp/comp-cstr-tests.el (comp-cstr-typespec-tests-alist):
Update test.

* test/src/comp-tests.el (comp-tests-type-spec-tests): Update two testes.
This commit is contained in:
Andrea Corallo 2023-10-18 16:10:08 +02:00
parent 3e193edd68
commit a567faf4c2
4 changed files with 7 additions and 6 deletions

View file

@ -3502,7 +3502,8 @@ Of course, we really can't know that for sure, so it's just a heuristic."
(symbol . symbolp) (symbol . symbolp)
(vector . vectorp) (vector . vectorp)
(window . windowp) (window . windowp)
;; FIXME: Do we really want to consider this a type? ;; FIXME: Do we really want to consider these types?
(number-or-marker . number-or-marker-p)
(integer-or-marker . integer-or-marker-p) (integer-or-marker . integer-or-marker-p)
)) ))
(put type 'cl-deftype-satisfies pred)) (put type 'cl-deftype-satisfies pred))

View file

@ -58,8 +58,8 @@
;; Markers aren't `numberp', yet they are accepted wherever integers are ;; Markers aren't `numberp', yet they are accepted wherever integers are
;; accepted, pretty much. ;; accepted, pretty much.
(marker number-or-marker atom) (marker number-or-marker atom)
(overlay atom) (float number atom) (window-configuration atom) (overlay atom) (float number number-or-marker atom)
(process atom) (window atom) (window-configuration atom) (process atom) (window atom)
;; FIXME: We'd want to put `function' here, but that's only true ;; FIXME: We'd want to put `function' here, but that's only true
;; for those `subr's which aren't special forms! ;; for those `subr's which aren't special forms!
(subr atom) (subr atom)

View file

@ -191,7 +191,7 @@
;; 74 ;; 74
((and boolean (or number marker)) . nil) ((and boolean (or number marker)) . nil)
;; 75 ;; 75
((and atom (or number marker)) . (or marker number)) ((and atom (or number marker)) . number-or-marker)
;; 76 ;; 76
((and symbol (or number marker)) . nil) ((and symbol (or number marker)) . nil)
;; 77 ;; 77

View file

@ -977,7 +977,7 @@ Return a list of results."
(if (= x y) (if (= x y)
x x
'foo)) 'foo))
'(or (member foo) marker number)) '(or (member foo) number-or-marker))
;; 14 ;; 14
((defun comp-tests-ret-type-spec-f (x) ((defun comp-tests-ret-type-spec-f (x)
@ -1117,7 +1117,7 @@ Return a list of results."
((defun comp-tests-ret-type-spec-f (x) ((defun comp-tests-ret-type-spec-f (x)
(when (> x 1.0) (when (> x 1.0)
x)) x))
'(or null marker number)) '(or null number-or-marker))
;; 36 ;; 36
((defun comp-tests-ret-type-spec-f (x y) ((defun comp-tests-ret-type-spec-f (x y)