all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#15809: 24.3.50; wrong defcustom type for `suggest-key-bindings'
@ 2013-11-05 15:30 Drew Adams
  2014-02-08  3:36 ` Lars Ingebrigtsen
  0 siblings, 1 reply; 21+ messages in thread
From: Drew Adams @ 2013-11-05 15:30 UTC (permalink / raw)
  To: 15809

Instead of `integer' the `choice' should use `number' (and the code
should then ignore negative values) or `restricted-sexp' with a test
that the time be non-negative.

See the comment by phils here:
http://stackoverflow.com/a/19782939/729907

In GNU Emacs 24.3.50.1 (i686-pc-mingw32)
 of 2013-10-19 on LEG570
Bzr revision: 114715 rgm@gnu.org-20131019023520-s8mwtib7xcx9e05w
Windowing system distributor `Microsoft Corp.', version 6.1.7601
Configured using:
 `configure --enable-checking 'CFLAGS=-O0 -g3' CPPFLAGS=-DGLYPH_DEBUG=1'





^ permalink raw reply	[flat|nested] 21+ messages in thread

* bug#15809: 24.3.50; wrong defcustom type for `suggest-key-bindings'
  2013-11-05 15:30 Drew Adams
@ 2014-02-08  3:36 ` Lars Ingebrigtsen
  2014-02-09  2:14   ` Drew Adams
  2020-10-28  7:50   ` Stefan Kangas
  0 siblings, 2 replies; 21+ messages in thread
From: Lars Ingebrigtsen @ 2014-02-08  3:36 UTC (permalink / raw)
  To: Drew Adams; +Cc: 15809

Drew Adams <drew.adams@oracle.com> writes:

> Instead of `integer' the `choice' should use `number' (and the code
> should then ignore negative values) or `restricted-sexp' with a test
> that the time be non-negative.

Or to be more general, perhaps there should be a custom interval type?  Like

(integer :minimum 1)

?

Or just `natnum'?

-- 
(domestic pets only, the antidote for overdose, milk.)
  bloggy blog http://lars.ingebrigtsen.no/





^ permalink raw reply	[flat|nested] 21+ messages in thread

* bug#15809: 24.3.50; wrong defcustom type for `suggest-key-bindings'
  2014-02-08  3:36 ` Lars Ingebrigtsen
@ 2014-02-09  2:14   ` Drew Adams
  2014-02-11 11:47     ` Lars Ingebrigtsen
  2020-10-28  7:50   ` Stefan Kangas
  1 sibling, 1 reply; 21+ messages in thread
From: Drew Adams @ 2014-02-09  2:14 UTC (permalink / raw)
  To: Lars Ingebrigtsen; +Cc: 15809

> > Instead of `integer' the `choice' should use `number' (and the
> > code should then ignore negative values) or `restricted-sexp'
> > with a test that the time be non-negative.
> 
> Or to be more general, perhaps there should be a custom interval
> type?  Like (integer :minimum 1)
> Or just `natnum'?

That's what `restricted-sexp' is for.  In this case it is a simple
expression.

(And what you suggest is not more general but less general than
`restricted-sexp'.  But that's OK too.)





^ permalink raw reply	[flat|nested] 21+ messages in thread

* bug#15809: 24.3.50; wrong defcustom type for `suggest-key-bindings'
  2014-02-09  2:14   ` Drew Adams
@ 2014-02-11 11:47     ` Lars Ingebrigtsen
  0 siblings, 0 replies; 21+ messages in thread
From: Lars Ingebrigtsen @ 2014-02-11 11:47 UTC (permalink / raw)
  To: Drew Adams; +Cc: 15809

Drew Adams <drew.adams@oracle.com> writes:

>> > Instead of `integer' the `choice' should use `number' (and the
>> > code should then ignore negative values) or `restricted-sexp'
>> > with a test that the time be non-negative.
>> 
>> Or to be more general, perhaps there should be a custom interval
>> type?  Like (integer :minimum 1)
>> Or just `natnum'?
>
> That's what `restricted-sexp' is for.  In this case it is a simple
> expression.

`restricted-sexp' is too general.  We'd lose type info.

-- 
(domestic pets only, the antidote for overdose, milk.)
  bloggy blog http://lars.ingebrigtsen.no/





^ permalink raw reply	[flat|nested] 21+ messages in thread

* bug#15809: 24.3.50; wrong defcustom type for `suggest-key-bindings'
  2014-02-08  3:36 ` Lars Ingebrigtsen
  2014-02-09  2:14   ` Drew Adams
@ 2020-10-28  7:50   ` Stefan Kangas
  2020-10-28  8:00     ` Lars Ingebrigtsen
  1 sibling, 1 reply; 21+ messages in thread
From: Stefan Kangas @ 2020-10-28  7:50 UTC (permalink / raw)
  To: Lars Ingebrigtsen; +Cc: 15809

Lars Ingebrigtsen <larsi@gnus.org> writes:

> Drew Adams <drew.adams@oracle.com> writes:
>
>> Instead of `integer' the `choice' should use `number' (and the code
>> should then ignore negative values) or `restricted-sexp' with a test
>> that the time be non-negative.
>
> Or to be more general, perhaps there should be a custom interval type?  Like
>
> (integer :minimum 1)
>
> ?
>
> Or just `natnum'?

natnum sounds like it could be generally useful, yes.  We have plenty of
customizable things that should never be negative.





^ permalink raw reply	[flat|nested] 21+ messages in thread

* bug#15809: 24.3.50; wrong defcustom type for `suggest-key-bindings'
  2020-10-28  7:50   ` Stefan Kangas
@ 2020-10-28  8:00     ` Lars Ingebrigtsen
  2020-10-28 14:25       ` Drew Adams
  2021-09-24 23:34       ` Stefan Kangas
  0 siblings, 2 replies; 21+ messages in thread
From: Lars Ingebrigtsen @ 2020-10-28  8:00 UTC (permalink / raw)
  To: Stefan Kangas; +Cc: 15809

Stefan Kangas <stefan@marxist.se> writes:

>> Or to be more general, perhaps there should be a custom interval type?  Like
>>
>> (integer :minimum 1)
>>
>> ?
>>
>> Or just `natnum'?
>
> natnum sounds like it could be generally useful, yes.  We have plenty of
> customizable things that should never be negative.

Yeah, that's the most common numerical restriction (by far), and the few
variables that are numbers with other ranges can be done with a
defcustom predicate.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





^ permalink raw reply	[flat|nested] 21+ messages in thread

* bug#15809: 24.3.50; wrong defcustom type for `suggest-key-bindings'
  2020-10-28  8:00     ` Lars Ingebrigtsen
@ 2020-10-28 14:25       ` Drew Adams
  2021-09-24 23:32         ` Stefan Kangas
  2021-09-24 23:34       ` Stefan Kangas
  1 sibling, 1 reply; 21+ messages in thread
From: Drew Adams @ 2020-10-28 14:25 UTC (permalink / raw)
  To: Lars Ingebrigtsen, Stefan Kangas; +Cc: 15809

FWIW, "natural number", like "whole number", unfortunately
has two different meanings, 1... and 0..., depending on
who is talking.

https://en.wikipedia.org/wiki/Natural_number

Emacs has predicate `natnump', with alias `wholenump',
meaning 0...  So the doc for a defcustom type that
mentions "natural number" had better make clear which is
meant.  It can do that by mentioning predicate `natnump'. 





^ permalink raw reply	[flat|nested] 21+ messages in thread

* bug#15809: 24.3.50; wrong defcustom type for `suggest-key-bindings'
  2020-10-28 14:25       ` Drew Adams
@ 2021-09-24 23:32         ` Stefan Kangas
  0 siblings, 0 replies; 21+ messages in thread
From: Stefan Kangas @ 2021-09-24 23:32 UTC (permalink / raw)
  To: Drew Adams; +Cc: Lars Ingebrigtsen, 15809

Drew Adams <drew.adams@oracle.com> writes:

> FWIW, "natural number", like "whole number", unfortunately
> has two different meanings, 1... and 0..., depending on
> who is talking.
>
> https://en.wikipedia.org/wiki/Natural_number
>
> Emacs has predicate `natnump', with alias `wholenump',
> meaning 0...  So the doc for a defcustom type that
> mentions "natural number" had better make clear which is
> meant.  It can do that by mentioning predicate `natnump'.

The docstring of `natnump' defines it as "a nonnegative integer".





^ permalink raw reply	[flat|nested] 21+ messages in thread

* bug#15809: 24.3.50; wrong defcustom type for `suggest-key-bindings'
  2020-10-28  8:00     ` Lars Ingebrigtsen
  2020-10-28 14:25       ` Drew Adams
@ 2021-09-24 23:34       ` Stefan Kangas
  2021-09-25  1:09         ` Lars Ingebrigtsen
  1 sibling, 1 reply; 21+ messages in thread
From: Stefan Kangas @ 2021-09-24 23:34 UTC (permalink / raw)
  To: Lars Ingebrigtsen; +Cc: 15809

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

tags 15809 + patch
thanks

Lars Ingebrigtsen <larsi@gnus.org> writes:

> Stefan Kangas <stefan@marxist.se> writes:
>
>>> Or to be more general, perhaps there should be a custom interval type?  Like
>>>
>>> (integer :minimum 1)
>>>
>>> ?
>>>
>>> Or just `natnum'?
>>
>> natnum sounds like it could be generally useful, yes.  We have plenty of
>> customizable things that should never be negative.
>
> Yeah, that's the most common numerical restriction (by far), and the few
> variables that are numbers with other ranges can be done with a
> defcustom predicate.

How about the attached?

[-- Attachment #2: 0001-New-type-natnum-for-defcustom.patch --]
[-- Type: text/x-diff, Size: 1984 bytes --]

From 7313d60a163b66af039efc69046e4df4dff21457 Mon Sep 17 00:00:00 2001
From: Stefan Kangas <stefan@marxist.se>
Date: Sat, 25 Sep 2021 01:15:49 +0200
Subject: [PATCH 1/2] New :type natnum for defcustom

* lisp/wid-edit.el (natnum): New widget type.  (Bug#15809)
* doc/lispref/customize.texi (Simple Types): Document it.
---
 doc/lispref/customize.texi | 3 +++
 etc/NEWS                   | 5 +++++
 lisp/wid-edit.el           | 7 +++++++
 3 files changed, 15 insertions(+)

diff --git a/doc/lispref/customize.texi b/doc/lispref/customize.texi
index bc35982c17..b93b8bc015 100644
--- a/doc/lispref/customize.texi
+++ b/doc/lispref/customize.texi
@@ -594,6 +594,9 @@ Simple Types
 @item integer
 The value must be an integer.
 
+@item natnum
+The value must be a nonnegative integer.
+
 @item number
 The value must be a number (floating point or integer).
 
diff --git a/etc/NEWS b/etc/NEWS
index c266dddafa..b2e7331517 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -3724,6 +3724,11 @@ instead of only becoming available after doing (for instance)
 ---
 ** ':safe' settings in 'defcustom' are now propagated to the loaddefs files.
 
++++
+** New ':type' for 'defcustom' for nonnegative integers.
+The new 'natnum' type can be used for options that should be
+nonnegative integers.
+
 +++
 ** ERT can now output more verbose test failure reports.
 If the 'EMACS_TEST_VERBOSE' environment variable is set, failure
diff --git a/lisp/wid-edit.el b/lisp/wid-edit.el
index ab358da7e3..72353b9190 100644
--- a/lisp/wid-edit.el
+++ b/lisp/wid-edit.el
@@ -3644,6 +3644,13 @@ 'integer
   :type-error "This field should contain an integer"
   :match-alternatives '(integerp))
 
+(define-widget 'natnum 'restricted-sexp
+  "A nonnegative integer."
+  :tag "Integer (positive)"
+  :value 0
+  :type-error "This field should contain a nonnegative integer"
+  :match-alternatives '(natnump))
+
 (define-widget 'number 'restricted-sexp
   "A number (floating point or integer)."
   :tag "Number"
-- 
2.30.2


[-- Attachment #3: 0002-Set-type-of-suggest-key-bindings-to-natnum.patch --]
[-- Type: text/x-diff, Size: 838 bytes --]

From 95127f0d7441999c78e4c4e9ab8217757148e5c9 Mon Sep 17 00:00:00 2001
From: Stefan Kangas <stefan@marxist.se>
Date: Sat, 25 Sep 2021 01:25:47 +0200
Subject: [PATCH 2/2] Set :type of suggest-key-bindings to natnum

* lisp/simple.el (suggest-key-bindings): Set :type to
natnum.  (Bug#15809)
---
 lisp/simple.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lisp/simple.el b/lisp/simple.el
index 298e3ea5ee..dd480396f6 100644
--- a/lisp/simple.el
+++ b/lisp/simple.el
@@ -2144,7 +2144,7 @@ suggest-key-bindings
 \\[execute-extended-command] for all commands that have them."
   :group 'keyboard
   :type '(choice (const :tag "off" nil)
-                 (integer :tag "time" 2)
+                 (natnum :tag "time" 2)
                  (other :tag "on")))
 
 (defcustom extended-command-suggest-shorter t
-- 
2.30.2


^ permalink raw reply related	[flat|nested] 21+ messages in thread

* bug#15809: 24.3.50; wrong defcustom type for `suggest-key-bindings'
  2021-09-24 23:34       ` Stefan Kangas
@ 2021-09-25  1:09         ` Lars Ingebrigtsen
  2021-09-25  1:54           ` Stefan Kangas
  0 siblings, 1 reply; 21+ messages in thread
From: Lars Ingebrigtsen @ 2021-09-25  1:09 UTC (permalink / raw)
  To: Stefan Kangas; +Cc: 15809

Stefan Kangas <stefan@marxist.se> writes:

> How about the attached?

Looks good to me, except this detail:

> +(define-widget 'natnum 'restricted-sexp
> +  "A nonnegative integer."
> +  :tag "Integer (positive)"

In the tag here, that's a bit confusing.  Why not just say "Integer
(zero or larger)"?

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





^ permalink raw reply	[flat|nested] 21+ messages in thread

* bug#15809: 24.3.50; wrong defcustom type for `suggest-key-bindings'
  2021-09-25  1:09         ` Lars Ingebrigtsen
@ 2021-09-25  1:54           ` Stefan Kangas
  2021-09-25  2:06             ` Lars Ingebrigtsen
  0 siblings, 1 reply; 21+ messages in thread
From: Stefan Kangas @ 2021-09-25  1:54 UTC (permalink / raw)
  To: Lars Ingebrigtsen; +Cc: 15809

Lars Ingebrigtsen <larsi@gnus.org> writes:

>> +(define-widget 'natnum 'restricted-sexp
>> +  "A nonnegative integer."
>> +  :tag "Integer (positive)"
>
> In the tag here, that's a bit confusing.  Why not just say "Integer
> (zero or larger)"?

I believe this is the preferred way to say it, for example that's what
we do in `natnump', and Wikipedia says:

    [...] the standard ISO 80000-2,[4][a] begin the natural numbers with
    0, corresponding to the non-negative integers 0, 1, 2, 3, ...,

But I don't feel very strongly about it; either way seems clear to me.





^ permalink raw reply	[flat|nested] 21+ messages in thread

* bug#15809: 24.3.50; wrong defcustom type for `suggest-key-bindings'
  2021-09-25  1:54           ` Stefan Kangas
@ 2021-09-25  2:06             ` Lars Ingebrigtsen
  2021-09-25  2:43               ` Stefan Kangas
  0 siblings, 1 reply; 21+ messages in thread
From: Lars Ingebrigtsen @ 2021-09-25  2:06 UTC (permalink / raw)
  To: Stefan Kangas; +Cc: 15809

Stefan Kangas <stefan@marxist.se> writes:

> I believe this is the preferred way to say it, for example that's what
> we do in `natnump', and Wikipedia says:
>
>     [...] the standard ISO 80000-2,[4][a] begin the natural numbers with
>     0, corresponding to the non-negative integers 0, 1, 2, 3, ...,
>
> But I don't feel very strongly about it; either way seems clear to me.

Yeah, same here.  So please go ahead and push; if anybody wants to tweak
the strings here, that can be done afterwards.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





^ permalink raw reply	[flat|nested] 21+ messages in thread

* bug#15809: 24.3.50; wrong defcustom type for `suggest-key-bindings'
  2021-09-25  2:06             ` Lars Ingebrigtsen
@ 2021-09-25  2:43               ` Stefan Kangas
  0 siblings, 0 replies; 21+ messages in thread
From: Stefan Kangas @ 2021-09-25  2:43 UTC (permalink / raw)
  To: Lars Ingebrigtsen; +Cc: 15809

tags 15809 fixed
close 15809 28.1
thanks

Lars Ingebrigtsen <larsi@gnus.org> writes:

> Stefan Kangas <stefan@marxist.se> writes:
>
>> I believe this is the preferred way to say it, for example that's what
>> we do in `natnump', and Wikipedia says:
>>
>>     [...] the standard ISO 80000-2,[4][a] begin the natural numbers with
>>     0, corresponding to the non-negative integers 0, 1, 2, 3, ...,
>>
>> But I don't feel very strongly about it; either way seems clear to me.
>
> Yeah, same here.  So please go ahead and push; if anybody wants to tweak
> the strings here, that can be done afterwards.

OK, thanks.  Now pushed to master as commit f1071bf08e.





^ permalink raw reply	[flat|nested] 21+ messages in thread

* bug#15809: 24.3.50; wrong defcustom type for `suggest-key-bindings'
       [not found] <D0F524A8-6F43-4A73-928B-EC91FAFA2866@acm.org>
@ 2021-09-25 10:50 ` Mattias Engdegård
  2021-09-25 10:57 ` Mattias Engdegård
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 21+ messages in thread
From: Mattias Engdegård @ 2021-09-25 10:50 UTC (permalink / raw)
  To: 15809

This is a test to find out why mails sent to debbugs sometimes just disappear.
Please ignore, unless you are an admin!






^ permalink raw reply	[flat|nested] 21+ messages in thread

* bug#15809: 24.3.50; wrong defcustom type for `suggest-key-bindings'
       [not found] <D0F524A8-6F43-4A73-928B-EC91FAFA2866@acm.org>
  2021-09-25 10:50 ` bug#15809: 24.3.50; wrong defcustom type for `suggest-key-bindings' Mattias Engdegård
@ 2021-09-25 10:57 ` Mattias Engdegård
  2021-09-25 13:00 ` Stefan Kangas
  2021-09-25 15:24 ` Drew Adams
  3 siblings, 0 replies; 21+ messages in thread
From: Mattias Engdegård @ 2021-09-25 10:57 UTC (permalink / raw)
  To: 15809

[ Resent to debugs only, because my previous attempt was eaten by a grue.
  Sorry if you get this twice or not at all.
  A modern Emacs bug tracker cannot arrive soon enough! ]

> (define-widget 'natnum 'restricted-sexp
>  "A nonnegative integer."
>  :tag "Integer (positive)"

Sorry, but this is just wrong. 0 is not a positive integer. If nobody fixes this then I will.

And regarding whether natural numbers include zero, the answer is that yes, they do. The notion that they don't is antiquated; today 0 is assumed to be included by default unless otherwise stated or hinted in the notation. Let's not spread some silly 19th century bickering about something that was settled long ago.






^ permalink raw reply	[flat|nested] 21+ messages in thread

* bug#15809: 24.3.50; wrong defcustom type for `suggest-key-bindings'
       [not found] <D0F524A8-6F43-4A73-928B-EC91FAFA2866@acm.org>
  2021-09-25 10:50 ` bug#15809: 24.3.50; wrong defcustom type for `suggest-key-bindings' Mattias Engdegård
  2021-09-25 10:57 ` Mattias Engdegård
@ 2021-09-25 13:00 ` Stefan Kangas
  2021-09-25 13:07   ` Mattias Engdegård
  2021-09-25 15:31   ` bug#15809: [External] : " Drew Adams
  2021-09-25 15:24 ` Drew Adams
  3 siblings, 2 replies; 21+ messages in thread
From: Stefan Kangas @ 2021-09-25 13:00 UTC (permalink / raw)
  To: Mattias Engdegård; +Cc: Lars Ingebrigtsen, 15809

Mattias Engdegård <mattiase@acm.org> writes:

>> (define-widget 'natnum 'restricted-sexp
>>   "A nonnegative integer."
>>   :tag "Integer (positive)"
>
> Sorry, but this is just wrong. 0 is not a positive integer.

The text does not say that zero is positive.

Feel free to improve it, but I don't think the terminology "nonnegative"
is unusual or incorrect.  For example, here is the definition of
"nonnegative integer" from Wolfram MathWorld:

    Nonnegative Integer

    An integer that is either 0 or positive, i.e., a member of the set
    ℤ^* = {0} ∪ ℤ^+, where Ζ-+ denotes the positive integers.

    SEE ALSO: Negative Integer, Nonpositive Integer, Positive Integer, Z-*

    https://mathworld.wolfram.com/NonnegativeInteger.html





^ permalink raw reply	[flat|nested] 21+ messages in thread

* bug#15809: 24.3.50; wrong defcustom type for `suggest-key-bindings'
  2021-09-25 13:00 ` Stefan Kangas
@ 2021-09-25 13:07   ` Mattias Engdegård
  2021-09-25 14:53     ` Stefan Kangas
  2021-09-25 15:31   ` bug#15809: [External] : " Drew Adams
  1 sibling, 1 reply; 21+ messages in thread
From: Mattias Engdegård @ 2021-09-25 13:07 UTC (permalink / raw)
  To: Stefan Kangas; +Cc: Lars Ingebrigtsen, 15809

25 sep. 2021 kl. 15.00 skrev Stefan Kangas <stefan@marxist.se>:

>>> (define-widget 'natnum 'restricted-sexp
>>>  "A nonnegative integer."
>>>  :tag "Integer (positive)"
>> 
>> Sorry, but this is just wrong. 0 is not a positive integer.
> 
> The text does not say that zero is positive.

Actually the tag text does.

> Feel free to improve it, but I don't think the terminology "nonnegative"
> is unusual or incorrect.

It's fine! But "Integer (positive)" isn't, if we are talking about something that can be zero.

What about "Integer (nonnegative)", "Integer (positive or zero)", or something else?

And please accept my apologies about the somewhat unfriendly tone of my original message. I'm really very happy with the change otherwise.






^ permalink raw reply	[flat|nested] 21+ messages in thread

* bug#15809: 24.3.50; wrong defcustom type for `suggest-key-bindings'
  2021-09-25 13:07   ` Mattias Engdegård
@ 2021-09-25 14:53     ` Stefan Kangas
  2021-09-25 18:32       ` Mattias Engdegård
  0 siblings, 1 reply; 21+ messages in thread
From: Stefan Kangas @ 2021-09-25 14:53 UTC (permalink / raw)
  To: Mattias Engdegård; +Cc: Lars Ingebrigtsen, 15809

Mattias Engdegård <mattiase@acm.org> writes:

> 25 sep. 2021 kl. 15.00 skrev Stefan Kangas <stefan@marxist.se>:
>
>>>> (define-widget 'natnum 'restricted-sexp
>>>>  "A nonnegative integer."
>>>>  :tag "Integer (positive)"
>>>
>>> Sorry, but this is just wrong. 0 is not a positive integer.
>>
>> The text does not say that zero is positive.
>
> Actually the tag text does.

Well spotted, thanks!  That is completely wrong, yes.

> What about "Integer (nonnegative)", "Integer (positive or zero)", or
> something else?

Both sound good to me.  The second one doesn't just repeat what is
already said in the other text, so I slightly prefer that one.  Feel
free to install whichever you like better (or tell me to do it if that's
easier).

> And please accept my apologies about the somewhat unfriendly tone of
> my original message. I'm really very happy with the change otherwise.

No reason to apologize.  I was mostly wondering what was the reason for
all the commotion, but now I can see why.  :-)





^ permalink raw reply	[flat|nested] 21+ messages in thread

* bug#15809: [External] : Re: bug#15809: 24.3.50; wrong defcustom type for `suggest-key-bindings'
       [not found] <D0F524A8-6F43-4A73-928B-EC91FAFA2866@acm.org>
                   ` (2 preceding siblings ...)
  2021-09-25 13:00 ` Stefan Kangas
@ 2021-09-25 15:24 ` Drew Adams
  3 siblings, 0 replies; 21+ messages in thread
From: Drew Adams @ 2021-09-25 15:24 UTC (permalink / raw)
  To: Mattias Engdegård, Stefan Kangas
  Cc: Lars Ingebrigtsen, 15809@debbugs.gnu.org

> > (define-widget 'natnum 'restricted-sexp
> >   "A nonnegative integer."
> >   :tag "Integer (positive)"
> 
> Sorry, but this is just wrong. 0 is not a positive integer. If nobody
> fixes this then I will.

100% agreement that "positive" is wrong - it does
not apply to 0.

> And regarding whether natural numbers include zero, the answer is that
> yes, they do. The notion that they don't is antiquated; today 0 is
> assumed to be included by default unless otherwise stated or hinted in
> the notation. Let's not spread some silly 19th century bickering about
> something that was settled long ago.

It's not about what is current or appropriate in
math etc.  It's about providing doc that leaves
less room for confusion.  And yes, "natural number"
is understood differently by different people,
unfortunately.  It's not hard to be clear, here.
"Nonnegative integer" is short, clear, unambiguous.






^ permalink raw reply	[flat|nested] 21+ messages in thread

* bug#15809: [External] : Re: bug#15809: 24.3.50; wrong defcustom type for `suggest-key-bindings'
  2021-09-25 13:00 ` Stefan Kangas
  2021-09-25 13:07   ` Mattias Engdegård
@ 2021-09-25 15:31   ` Drew Adams
  1 sibling, 0 replies; 21+ messages in thread
From: Drew Adams @ 2021-09-25 15:31 UTC (permalink / raw)
  To: Stefan Kangas, Mattias Engdegård
  Cc: Lars Ingebrigtsen, 15809@debbugs.gnu.org

> >> (define-widget 'natnum 'restricted-sexp
> >>   "A nonnegative integer."
> >>   :tag "Integer (positive)"
> >
> > Sorry, but this is just wrong. 0 is not a positive integer.
> 
> The text does not say that zero is positive.

The doc string doesn't, but the tag appears to.
The tag should anyway say what the field is for,
not (usually) what its type is.

If you do add indication of the type to the tag
(i.e., in addition to the field description -
what the field is for / means), then please use
what you have in the doc string.

The field value must be a nonnegative integer.
It need not be a positive integer.

^ permalink raw reply	[flat|nested] 21+ messages in thread

* bug#15809: 24.3.50; wrong defcustom type for `suggest-key-bindings'
  2021-09-25 14:53     ` Stefan Kangas
@ 2021-09-25 18:32       ` Mattias Engdegård
  0 siblings, 0 replies; 21+ messages in thread
From: Mattias Engdegård @ 2021-09-25 18:32 UTC (permalink / raw)
  To: Stefan Kangas; +Cc: Lars Ingebrigtsen, 15809-done

> Both sound good to me.  The second one doesn't just repeat what is
> already said in the other text, so I slightly prefer that one.

Then that's what it will be. Thank you, pushed and closed.






^ permalink raw reply	[flat|nested] 21+ messages in thread

end of thread, other threads:[~2021-09-25 18:32 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <D0F524A8-6F43-4A73-928B-EC91FAFA2866@acm.org>
2021-09-25 10:50 ` bug#15809: 24.3.50; wrong defcustom type for `suggest-key-bindings' Mattias Engdegård
2021-09-25 10:57 ` Mattias Engdegård
2021-09-25 13:00 ` Stefan Kangas
2021-09-25 13:07   ` Mattias Engdegård
2021-09-25 14:53     ` Stefan Kangas
2021-09-25 18:32       ` Mattias Engdegård
2021-09-25 15:31   ` bug#15809: [External] : " Drew Adams
2021-09-25 15:24 ` Drew Adams
2013-11-05 15:30 Drew Adams
2014-02-08  3:36 ` Lars Ingebrigtsen
2014-02-09  2:14   ` Drew Adams
2014-02-11 11:47     ` Lars Ingebrigtsen
2020-10-28  7:50   ` Stefan Kangas
2020-10-28  8:00     ` Lars Ingebrigtsen
2020-10-28 14:25       ` Drew Adams
2021-09-24 23:32         ` Stefan Kangas
2021-09-24 23:34       ` Stefan Kangas
2021-09-25  1:09         ` Lars Ingebrigtsen
2021-09-25  1:54           ` Stefan Kangas
2021-09-25  2:06             ` Lars Ingebrigtsen
2021-09-25  2:43               ` Stefan Kangas

Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.