all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Mattias Engdegård" <mattiase@acm.org>
To: Eli Zaretskii <eliz@gnu.org>
Cc: 34391@debbugs.gnu.org
Subject: bug#34391: Acknowledgement (26.1; [[:cntrl:]] does not match DEL contrary to documentation)
Date: Sun, 10 Feb 2019 10:56:07 +0100	[thread overview]
Message-ID: <35664573-1784-4887-836C-45EE8297CF2B@acm.org> (raw)
In-Reply-To: <835ztuosd3.fsf@gnu.org>

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

8 feb. 2019 kl. 22.58 skrev Eli Zaretskii <eliz@gnu.org>:
> 
> 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?

[-- Attachment #2: 0001-PATCH-Document-that-cntrl-does-not-match-DEL-Bug-343.patch --]
[-- Type: application/octet-stream, Size: 2447 bytes --]

From a7db422fa867d65cb2800ad8cd0f9acb18e10f64 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Mattias=20Engdeg=C3=A5rd?= <mattiase@acm.org>
Date: Sun, 10 Feb 2019 10:39:00 +0100
Subject: [PATCH] [PATCH] Document that [:cntrl:] does not match DEL
 (Bug#34391)

* doc/lispref/searching.texi (Character Classes):
* lisp/emacs-lisp/rx.el (rx):
Document that [:cntrl:] excludes DEL.
* test/src/regex-emacs-tests.el (regex-tests-PTESTS-whitelist):
Swap misplaced comments and fix wrong code for DEL.
---
 doc/lispref/searching.texi    | 2 +-
 lisp/emacs-lisp/rx.el         | 2 +-
 test/src/regex-emacs-tests.el | 6 +++---
 3 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/doc/lispref/searching.texi b/doc/lispref/searching.texi
index 05fc328205..cfbd2449b1 100644
--- a/doc/lispref/searching.texi
+++ b/doc/lispref/searching.texi
@@ -559,7 +559,7 @@ tabs, and other characters whose Unicode @samp{general-category}
 property (@pxref{Character Properties}) indicates they are spacing
 separators.
 @item [:cntrl:]
-This matches any @acronym{ASCII} control character.
+This matches any character whose code is in the range 0--31.
 @item [:digit:]
 This matches @samp{0} through @samp{9}.  Thus, @samp{[-+[:digit:]]}
 matches any digit, as well as @samp{+} and @samp{-}.
diff --git a/lisp/emacs-lisp/rx.el b/lisp/emacs-lisp/rx.el
index 8b4551d0d3..3fa0204a1a 100644
--- a/lisp/emacs-lisp/rx.el
+++ b/lisp/emacs-lisp/rx.el
@@ -964,7 +964,7 @@ CHAR
      matches 0 through 9.
 
 `control', `cntrl'
-     matches ASCII control characters.
+     matches any character whose code is in the range 0-31.
 
 `hex-digit', `hex', `xdigit'
      matches 0 through 9, a through f and A through F.
diff --git a/test/src/regex-emacs-tests.el b/test/src/regex-emacs-tests.el
index e84af6b131..9a40316573 100644
--- a/test/src/regex-emacs-tests.el
+++ b/test/src/regex-emacs-tests.el
@@ -555,11 +555,11 @@ differences in behavior.")
 
 (defconst regex-tests-PTESTS-whitelist
   [
-   ;; emacs doesn't barf on weird ranges such as [b-a], but simply
-   ;; fails to match
+   ;; emacs doesn't see DEL (0x7f) as a [:cntrl:] character
    138
 
-   ;; emacs doesn't see DEL (0x78) as a [:cntrl:] character
+   ;; emacs doesn't barf on weird ranges such as [b-a], but simply
+   ;; fails to match
    168
   ]
   "Line numbers in the PTESTS test that should be skipped.  These
-- 
2.17.2 (Apple Git-113)


  reply	other threads:[~2019-02-10  9:56 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-08 20:49 bug#34391: 26.1; [[:cntrl:]] does not match DEL contrary to documentation Mattias Engdegård
     [not found] ` <handler.34391.B.154965904215015.ack@debbugs.gnu.org>
2019-02-08 21:04   ` bug#34391: Acknowledgement (26.1; [[:cntrl:]] does not match DEL contrary to documentation) Mattias Engdegård
2019-02-08 21:58     ` Eli Zaretskii
2019-02-10  9:56       ` Mattias Engdegård [this message]
2019-02-10 15:19         ` Eli Zaretskii
2019-02-10 22:42           ` Mattias Engdegård

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

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

  git send-email \
    --in-reply-to=35664573-1784-4887-836C-45EE8297CF2B@acm.org \
    --to=mattiase@acm.org \
    --cc=34391@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    /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 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.