bug#34391: 26.1; [[:cntrl:]] does not match DEL contrary to documentation

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

bug#34391: 26.1; [[:cntrl:]] does not match DEL contrary to documentation

Mattias Engdegård-2
Unlike every other regexp engines and POSIX regexps, and contrary to the documentation, [[:cntrl:]] does not match DEL (\177) in Emacs. (It does not match the C1 controls in U+0080..009f either, but at least there is no such claim.)

Assuming that it is not worth breaking existing code by changing the behaviour, let us at least fix the manual which says:

‘[:cntrl:]’
     This matches any ASCII control character.

which is inaccurate. The error also made it into the doc string of `rx'.




Reply | Threaded
Open this post in threaded view
|

bug#34391: Acknowledgement (26.1; [[:cntrl:]] does not match DEL contrary to documentation)

Mattias Engdegård-2
Proposed patch, again assuming that the [:cntrl:] behaviour cannot be modified. Is that true?
It may have come up before since a comment in a test makes explicit reference to it (see patch), but I cannot find any discussion.


0001-Document-that-cntrl-does-not-match-DEL-Bug-34391.patch (3K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

bug#34391: Acknowledgement (26.1; [[:cntrl:]] does not match DEL contrary to documentation)

Eli Zaretskii
> From: Mattias Engdegård <[hidden email]>
> Date: Fri, 8 Feb 2019 22:04:32 +0100
>
> Proposed patch, again assuming that the [:cntrl:] behaviour cannot be modified. Is that true?
> It may have come up before since a comment in a test makes explicit reference to it (see patch), but I cannot find any discussion.

I think you don't find any discussion because in some quarters this
behavior is the only one that makes sense: "ASCII control characters"
is interpreted as "ASCII characters whose codepoints are below 32
decimal".  Which is why I prefer to amend the documentation to say
that, instead of excluding DEL explicitly.

Thanks.



Reply | Threaded
Open this post in threaded view
|

bug#34391: Acknowledgement (26.1; [[:cntrl:]] does not match DEL contrary to documentation)

Mattias Engdegård-2
8 feb. 2019 kl. 22.58 skrev Eli Zaretskii <[hidden email]>:
>
> I think you don't find any discussion because in some quarters this
> behavior is the only one that makes sense: "ASCII control characters"
> is interpreted as "ASCII characters whose codepoints are below 32
> decimal".  Which is why I prefer to amend the documentation to say
> that, instead of excluding DEL explicitly.

Well, DEL has been a control characters for more than half a century now, but you are right: documentation should be maximally clear to everyone, not just to those who think the way we think they ought to.
Would this patch do?

0001-PATCH-Document-that-cntrl-does-not-match-DEL-Bug-343.patch (3K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

bug#34391: Acknowledgement (26.1; [[:cntrl:]] does not match DEL contrary to documentation)

Eli Zaretskii
> From: Mattias Engdegård <[hidden email]>
> Date: Sun, 10 Feb 2019 10:56:07 +0100
> Cc: [hidden email]
>
> > I think you don't find any discussion because in some quarters this
> > behavior is the only one that makes sense: "ASCII control characters"
> > is interpreted as "ASCII characters whose codepoints are below 32
> > decimal".  Which is why I prefer to amend the documentation to say
> > that, instead of excluding DEL explicitly.
>
> Well, DEL has been a control characters for more than half a century now, but you are right: documentation should be maximally clear to everyone, not just to those who think the way we think they ought to.
> Would this patch do?

Yes, LGTM.  Thanks.  (Be sure to mention the bug number in the log
message.)



Reply | Threaded
Open this post in threaded view
|

bug#34391: Acknowledgement (26.1; [[:cntrl:]] does not match DEL contrary to documentation)

Mattias Engdegård-2
10 feb. 2019 kl. 16.19 skrev Eli Zaretskii <[hidden email]>:
>
> Yes, LGTM.  Thanks.  (Be sure to mention the bug number in the log
> message.)

Yes, done.