unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Andrea Corallo <acorallo@gnu.org>
To: "Mattias Engdegård" <mattias.engdegard@gmail.com>
Cc: Andrea Corallo <akrl@sdf.org>,  Eli Zaretskii <eliz@gnu.org>,
	emacs-devel <emacs-devel@gnu.org>
Subject: Re: Inferred function types in the *Help* buffer
Date: Thu, 01 Jun 2023 10:09:56 -0400	[thread overview]
Message-ID: <yp1ilc7mfyj.fsf@fencepost.gnu.org> (raw)
In-Reply-To: <B3F717B8-A234-4C6A-BB35-B633CFE3854D@gmail.com> ("Mattias Engdegård"'s message of "Thu, 1 Jun 2023 15:06:24 +0200")

[-- Attachment #1: Type: text/plain, Size: 955 bytes --]

Mattias Engdegård <mattias.engdegard@gmail.com> writes:

[...]

> Either I misunderstood what a return value of `boolean` means, or that
> list is riddled with errors. The following functions are specified to
> return boolean in comp-known-type-specifiers but actually may return
> other values as well:
>
>   proper-list-p
>   buffer-modified-p
>   coordinates-in-window-p
>   custom-variable-p
>   file-locked-p
>   file-symlink-p
>   frame-visible-p
>   framep

Okay the attached should address these (please have a look if/when
you've time).

> and, since we have no guarantees about what file handlers actually return,
>
>   file-directory-p
>   file-exists-p
>   file-newer-than-file-p
>   file-readable-p
>   file-writable-p

Aren't the entries we have in agreement with the docstring?  If the
docstring is not in sync with the implementation we have either to fix
one o the other I think.

Thanks!

  Andrea


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-lisp-emacs-lisp-comp.el-comp-known-type-specifiers-F.patch --]
[-- Type: text/x-diff, Size: 3957 bytes --]

From 59383af6b309cd4f6b0340d7d1c8fd90ac71d569 Mon Sep 17 00:00:00 2001
From: Andrea Corallo <akrl@sdf.org>
Date: Thu, 1 Jun 2023 15:53:39 +0200
Subject: [PATCH] * lisp/emacs-lisp/comp.el (comp-known-type-specifiers): Fix a
 bunch of

---
 lisp/emacs-lisp/comp.el | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/lisp/emacs-lisp/comp.el b/lisp/emacs-lisp/comp.el
index b2704ae1446..d361b312a60 100644
--- a/lisp/emacs-lisp/comp.el
+++ b/lisp/emacs-lisp/comp.el
@@ -317,7 +317,7 @@ comp-known-type-specifiers
     (buffer-file-name (function (&optional buffer) (or string null)))
     (buffer-list (function (&optional frame) list))
     (buffer-local-variables (function (&optional buffer) list))
-    (buffer-modified-p (function (&optional buffer) boolean))
+    (buffer-modified-p (function (&optional buffer) (or boolean (member autosaved))))
     (buffer-size (function (&optional buffer) integer))
     (buffer-string (function () string))
     (buffer-substring (function ((or integer marker) (or integer marker)) string))
@@ -344,7 +344,7 @@ comp-known-type-specifiers
     (concat (function (&rest sequence) string))
     (cons (function (t t) cons))
     (consp (function (t) boolean))
-    (coordinates-in-window-p (function (cons window) boolean))
+    (coordinates-in-window-p (function (cons window) (or cons (member bottom-divider right-divider mode-line header-line tab-lineleft-fringeright-fringevertical-line left-margin right-margin))))
     (copy-alist (function (list) list))
     (copy-marker (function (&optional (or integer marker) boolean) marker))
     (copy-sequence (function (sequence) sequence))
@@ -363,7 +363,7 @@ comp-known-type-specifiers
     (current-time-zone (function (&optional (or number list)
                                             (or symbol string cons integer))
                                  cons))
-    (custom-variable-p (function (symbol) boolean))
+    (custom-variable-p (function (symbol) t))
     (decode-char (function (cons t) (or fixnum null)))
     (decode-time (function (&optional (or number list)
                                       (or symbol string cons integer)
@@ -392,11 +392,11 @@ comp-known-type-specifiers
     (ffloor (function (float) float))
     (file-directory-p (function (string) boolean))
     (file-exists-p (function (string) boolean))
-    (file-locked-p (function (string) boolean))
+    (file-locked-p (function (string) (or boolean string)))
     (file-name-absolute-p (function (string) boolean))
     (file-newer-than-file-p (function (string string) boolean))
     (file-readable-p (function (string) boolean))
-    (file-symlink-p (function (string) boolean))
+    (file-symlink-p (function (string) (or boolean string)))
     (file-writable-p (function (string) boolean))
     (fixnump (function (t) boolean))
     (float (function (number) float))
@@ -411,8 +411,8 @@ comp-known-type-specifiers
     (frame-first-window (function ((or frame window)) window))
     (frame-root-window (function (&optional (or frame window)) window))
     (frame-selected-window (function (&optional (or frame window)) window))
-    (frame-visible-p (function (frame) boolean))
-    (framep (function (t) boolean))
+    (frame-visible-p (function (frame) (or boolean (member icon))))
+    (framep (function (t) (or boolean (member x w32 ns pc pgtk haiku))))
     (fround (function (float) float))
     (ftruncate (function (float) float))
     (get (function (symbol symbol) t))
@@ -506,7 +506,7 @@ comp-known-type-specifiers
     (previous-window (function (&optional window t t) window))
     (prin1-to-string (function (t &optional t t) string))
     (processp (function (t) boolean))
-    (proper-list-p (function (t) boolean))
+    (proper-list-p (function (t) (or fixnum null)))
     (propertize (function (string &rest t) string))
     (radians-to-degrees (function (number) float))
     (rassoc (function (t list) list))
-- 
2.25.1


  parent reply	other threads:[~2023-06-01 14:09 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-23 16:44 Inferred function types in the *Help* buffer Andrea Corallo
2023-05-24 10:46 ` Eli Zaretskii
2023-05-24 12:19   ` Andrea Corallo
2023-05-30 16:46     ` Andrea Corallo
2023-05-30 18:14       ` Mattias Engdegård
2023-05-30 18:48         ` Andrea Corallo
2023-05-31 12:19           ` Andrea Corallo
2023-05-31 14:08             ` Eli Zaretskii
2023-06-01 11:28             ` Mattias Engdegård
2023-06-01 11:35               ` Eli Zaretskii
2023-06-01 11:36                 ` Mattias Engdegård
2023-06-01 11:54                   ` Andrea Corallo
2023-06-01 11:50               ` Andrea Corallo
2023-06-01 13:06                 ` Mattias Engdegård
2023-06-01 13:34                   ` Andrea Corallo
2023-06-01 14:50                     ` Mattias Engdegård
2023-06-01 15:10                       ` Andrea Corallo
2023-06-01 17:53                         ` Mattias Engdegård
2023-06-01 19:13                           ` Andrea Corallo
2023-06-01 14:09                   ` Andrea Corallo [this message]
2023-05-31 13:46       ` Eli Zaretskii
2023-06-01  8:42         ` Andrea Corallo
2023-06-01  8:53           ` Eli Zaretskii
  -- strict thread matches above, loose matches on Subject: below --
2023-05-23 16:47 Payas Relekar
2023-05-23 18:51 ` Philip Kaludercic
2023-05-24 12:20 ` Andrea Corallo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=yp1ilc7mfyj.fsf@fencepost.gnu.org \
    --to=acorallo@gnu.org \
    --cc=akrl@sdf.org \
    --cc=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=mattias.engdegard@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).