diff options
| author | Andrea Corallo | 2023-10-18 16:10:08 +0200 |
|---|---|---|
| committer | Andrea Corallo | 2023-10-19 13:59:57 +0200 |
| commit | a567faf4c2bc497e50ce3c6ace32c1333cf3b706 (patch) | |
| tree | e609039fdf8ff366a85871991980ed6e95c60d72 | |
| parent | 3e193edd68b1abd9483267ba09c6e5c0c59e6c23 (diff) | |
| download | emacs-a567faf4c2bc497e50ce3c6ace32c1333cf3b706.tar.gz emacs-a567faf4c2bc497e50ce3c6ace32c1333cf3b706.zip | |
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.
| -rw-r--r-- | lisp/emacs-lisp/cl-macs.el | 3 | ||||
| -rw-r--r-- | lisp/emacs-lisp/cl-preloaded.el | 4 | ||||
| -rw-r--r-- | test/lisp/emacs-lisp/comp-cstr-tests.el | 2 | ||||
| -rw-r--r-- | test/src/comp-tests.el | 4 |
4 files changed, 7 insertions, 6 deletions
diff --git a/lisp/emacs-lisp/cl-macs.el b/lisp/emacs-lisp/cl-macs.el index 8025a64f1bf..722d561b9f4 100644 --- a/lisp/emacs-lisp/cl-macs.el +++ b/lisp/emacs-lisp/cl-macs.el | |||
| @@ -3502,7 +3502,8 @@ Of course, we really can't know that for sure, so it's just a heuristic." | |||
| 3502 | (symbol . symbolp) | 3502 | (symbol . symbolp) |
| 3503 | (vector . vectorp) | 3503 | (vector . vectorp) |
| 3504 | (window . windowp) | 3504 | (window . windowp) |
| 3505 | ;; FIXME: Do we really want to consider this a type? | 3505 | ;; FIXME: Do we really want to consider these types? |
| 3506 | (number-or-marker . number-or-marker-p) | ||
| 3506 | (integer-or-marker . integer-or-marker-p) | 3507 | (integer-or-marker . integer-or-marker-p) |
| 3507 | )) | 3508 | )) |
| 3508 | (put type 'cl-deftype-satisfies pred)) | 3509 | (put type 'cl-deftype-satisfies pred)) |
diff --git a/lisp/emacs-lisp/cl-preloaded.el b/lisp/emacs-lisp/cl-preloaded.el index 676326980aa..96e288db7d5 100644 --- a/lisp/emacs-lisp/cl-preloaded.el +++ b/lisp/emacs-lisp/cl-preloaded.el | |||
| @@ -58,8 +58,8 @@ | |||
| 58 | ;; Markers aren't `numberp', yet they are accepted wherever integers are | 58 | ;; Markers aren't `numberp', yet they are accepted wherever integers are |
| 59 | ;; accepted, pretty much. | 59 | ;; accepted, pretty much. |
| 60 | (marker number-or-marker atom) | 60 | (marker number-or-marker atom) |
| 61 | (overlay atom) (float number atom) (window-configuration atom) | 61 | (overlay atom) (float number number-or-marker atom) |
| 62 | (process atom) (window atom) | 62 | (window-configuration atom) (process atom) (window atom) |
| 63 | ;; FIXME: We'd want to put `function' here, but that's only true | 63 | ;; FIXME: We'd want to put `function' here, but that's only true |
| 64 | ;; for those `subr's which aren't special forms! | 64 | ;; for those `subr's which aren't special forms! |
| 65 | (subr atom) | 65 | (subr atom) |
diff --git a/test/lisp/emacs-lisp/comp-cstr-tests.el b/test/lisp/emacs-lisp/comp-cstr-tests.el index a4f282fcfef..d2f552af6fa 100644 --- a/test/lisp/emacs-lisp/comp-cstr-tests.el +++ b/test/lisp/emacs-lisp/comp-cstr-tests.el | |||
| @@ -191,7 +191,7 @@ | |||
| 191 | ;; 74 | 191 | ;; 74 |
| 192 | ((and boolean (or number marker)) . nil) | 192 | ((and boolean (or number marker)) . nil) |
| 193 | ;; 75 | 193 | ;; 75 |
| 194 | ((and atom (or number marker)) . (or marker number)) | 194 | ((and atom (or number marker)) . number-or-marker) |
| 195 | ;; 76 | 195 | ;; 76 |
| 196 | ((and symbol (or number marker)) . nil) | 196 | ((and symbol (or number marker)) . nil) |
| 197 | ;; 77 | 197 | ;; 77 |
diff --git a/test/src/comp-tests.el b/test/src/comp-tests.el index 4444ab61219..2b3c3dd4c75 100644 --- a/test/src/comp-tests.el +++ b/test/src/comp-tests.el | |||
| @@ -977,7 +977,7 @@ Return a list of results." | |||
| 977 | (if (= x y) | 977 | (if (= x y) |
| 978 | x | 978 | x |
| 979 | 'foo)) | 979 | 'foo)) |
| 980 | '(or (member foo) marker number)) | 980 | '(or (member foo) number-or-marker)) |
| 981 | 981 | ||
| 982 | ;; 14 | 982 | ;; 14 |
| 983 | ((defun comp-tests-ret-type-spec-f (x) | 983 | ((defun comp-tests-ret-type-spec-f (x) |
| @@ -1117,7 +1117,7 @@ Return a list of results." | |||
| 1117 | ((defun comp-tests-ret-type-spec-f (x) | 1117 | ((defun comp-tests-ret-type-spec-f (x) |
| 1118 | (when (> x 1.0) | 1118 | (when (> x 1.0) |
| 1119 | x)) | 1119 | x)) |
| 1120 | '(or null marker number)) | 1120 | '(or null number-or-marker)) |
| 1121 | 1121 | ||
| 1122 | ;; 36 | 1122 | ;; 36 |
| 1123 | ((defun comp-tests-ret-type-spec-f (x y) | 1123 | ((defun comp-tests-ret-type-spec-f (x y) |