emacs-pretest-bug
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Horizontal Tab and Line Feed are non-ASCII according to the ASCII catego


From: Chris Moore
Subject: Horizontal Tab and Line Feed are non-ASCII according to the ASCII category
Date: Sun, 11 Feb 2007 15:21:07 +0100

Trying to search a buffer for non-ASCII characters using:

  C-u C-s \Ca

finds all the newlines and tabs in the buffer as well as the non-ASCII
characters, but tabs and newlines are ASCII characters.

lisp/international/characters.el lines 109-111 say:

  (let ((ch 32))
    (while (< ch 127)                   ; All ASCII characters have
      (modify-category-entry ch ?a)     ; the category `a' (ASCII)

and this seems to be the problem.  All characters from 0 to 127 are ASCII 
characters, not just from 32 to 126.

Notice that the strict inequality here will result in DEL also being
treated as non-ASCII.

Here's a possible fix (although I don't know what the `l' (Latin)
category is supposed to include, but according to the comment, all
ASCII characters have category `l' as well).

------------------------------------------------------------------------
.~1~ lisp/international/characters.el
--- lisp/international/Backup/characters.el.~1~ 2007-01-22 14:38:46.000000000 
+0100
+++ lisp/international/characters.el    2007-02-11 15:12:12.000000000 +0100
@@ -106,8 +106,8 @@
 
 ;; ASCII
 
-(let ((ch 32))
-  (while (< ch 127)                    ; All ASCII characters have
+(let ((ch 0))
+  (while (< ch 128)                    ; All ASCII characters have
     (modify-category-entry ch ?a)      ; the category `a' (ASCII)
     (modify-category-entry ch ?l)      ; and `l' (Latin).
     (setq ch (1+ ch))))
------------------------------------------------------------------------


In GNU Emacs 22.0.93.34 (i686-pc-linux-gnu, GTK+ Version 2.8.20)
 of 2007-02-09 on trpaslik
X server distributor `The X.Org Foundation', version 11.0.70101000
configured using `configure  '--with-gtk' '--prefix' '/usr/local' '--with-xpm' 
'--with-jpeg' '--with-png' '--with-gif''




reply via email to

[Prev in Thread] Current Thread [Next in Thread]