[Top][All Lists]

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

Re: ?\_ patch

From: Kim F. Storm
Subject: Re: ?\_ patch
Date: 06 Feb 2003 12:48:24 +0100
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3.50

Miles Bader <address@hidden> writes:

> address@hidden (Kim F. Storm) writes:
> > What about ?\SPC
> Only if ?\RET, ?\TAB, etc. work too (otherwise it's just too
> inconsistent -- if ?\SPC worked then people would quite naturally expect
> things like ?\RET or ?\TAB to work as well).

I agree, so I redraw my proposal!

Thinking about it, ?\s is a good choice after all!

As Luc points out, we can introduce the \s for space without any risk
of breaking existing code, since the only valid syntax for using \s is
when it is followed by a -, and \s-... doesn't even work in strings.

So I suggest that ?\s is a space unless the `s' is immediately followed
by `-' (e.g. ?\s-a) in which case it has the usual meaning as a super

In strings, "\s" should also mean a space unless it is following by
a `-' (as in "\s-a") which should produce an error as it does now.

To follow a space with a `-' in a string use " -" as before, or "\s\-".

The following patch does this:

Index: lread.c
RCS file: /cvsroot/emacs/emacs/src/lread.c,v
retrieving revision 1.305
diff -c -r1.305 lread.c
*** lread.c     4 Feb 2003 14:03:12 -0000       1.305
--- lread.c     6 Feb 2003 10:37:54 -0000
*** 1698,1705 ****
      case 's':
        c = READCHAR;
!       if (c != '-')
!       error ("Invalid escape character syntax");
        c = READCHAR;
        if (c == '\\')
        c = read_escape (readcharfun, 0, byterep);
--- 1698,1707 ----
      case 's':
        c = READCHAR;
!       if (c != '-') {
!       UNREAD (c);
!       return ' ';
!       }
        c = READCHAR;
        if (c == '\\')
        c = read_escape (readcharfun, 0, byterep);

Kim F. Storm <address@hidden> http://www.cua.dk

reply via email to

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