all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: storm@cua.dk (Kim F. Storm)
Cc: miles@gnu.org
Subject: Re: ?\_ patch
Date: 07 Feb 2003 11:42:00 +0100	[thread overview]
Message-ID: <5xr8akid8n.fsf@kfs2.cua.dk> (raw)
In-Reply-To: <E18h4ei-0005rq-00@fencepost.gnu.org>

Richard Stallman <rms@gnu.org> writes:

>     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
>     modifier.
> 
>     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.
> 
> I have a bad feeling about this complication in strings, because it would
> mean introducing a feature that doesn't always work the way people
> would expect it to work.

I agree.

Here's what the Elisp manual says:

   Strings cannot hold characters that have the hyper, super or alt
   modifiers; ...

Since there is definitely NO code today which relies on being able to
specify a super modifier like "\s-a" in a string (emacs will barf with
an "Invalid modifier in string" error if you try), we could simply
define \s to ALWAYS give a space in a string.

Then \s will always work the way people expect!

> 
> Perhaps we could introduce the \s feature only for character constants.
> In that particular context, there is no ambiguity.

If we remove the (non-functional) special meaning of \s in strings as
suggested above, there's no ambiguity for strings either.

Here is a modified patch:

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	7 Feb 2003 09:39:46 -0000
***************
*** 1697,1705 ****
        return c | alt_modifier;
  
      case 's':
        c = READCHAR;
!       if (c != '-')
! 	error ("Invalid escape character syntax");
        c = READCHAR;
        if (c == '\\')
  	c = read_escape (readcharfun, 0, byterep);
--- 1697,1709 ----
        return c | alt_modifier;
  
      case 's':
+       if (stringp)
+ 	return ' ';
        c = READCHAR;
!       if (c != '-') {
! 	UNREAD (c);
! 	return ' ';
!       }
        c = READCHAR;
        if (c == '\\')
  	c = read_escape (readcharfun, 0, byterep);




BTW, why is `backslash space' ignored in a string?
        "\ " => ""

-- 
Kim F. Storm <storm@cua.dk> http://www.cua.dk

  reply	other threads:[~2003-02-07 10:42 UTC|newest]

Thread overview: 43+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-02-05 20:10 ?\_ patch Edward O'Connor
2003-02-05 23:31 ` Kenichi Handa
2003-02-06  0:44   ` Luc Teirlinck
2003-02-06  1:06     ` Luc Teirlinck
2003-02-06  1:20       ` Luc Teirlinck
2003-02-06 10:04       ` Kim F. Storm
2003-02-06  9:17         ` Miles Bader
2003-02-06 11:48           ` Kim F. Storm
2003-02-06 11:37             ` Juanma Barranquero
2003-02-06 17:33             ` Luc Teirlinck
2003-02-07  2:07               ` Miles Bader
2003-02-07  2:53                 ` Luc Teirlinck
2003-02-07  8:34                   ` Miles Bader
2003-02-07  8:56                     ` Kenichi Handa
2003-02-07 14:17                       ` Kim F. Storm
2003-02-07 13:28                         ` Miles Bader
2003-02-07 14:52                           ` Kim F. Storm
2003-02-07 14:02                             ` Miles Bader
2003-02-07 14:30                               ` Dmitry Paduchikh
2003-02-07 16:07                                 ` Kim F. Storm
2003-02-07 15:53                                   ` John Paul Wallington
2003-02-07 16:50                                     ` Kim F. Storm
2003-02-07 16:23                                       ` John Paul Wallington
2003-02-08  1:44                                       ` Miles Bader
2003-02-09  2:07                                         ` Kim F. Storm
2003-02-10  1:48                                           ` Miles Bader
2003-02-07 16:09                                   ` Dmitry Paduchikh
2003-02-07 15:51                               ` Kim F. Storm
2003-02-07 15:13                                 ` Damien Elmes
2003-02-07 20:20                                   ` Luc Teirlinck
2003-02-09 12:39                               ` Richard Stallman
2003-02-10 10:47                             ` Andreas Schwab
2003-02-07  9:18             ` Richard Stallman
2003-02-07 10:42               ` Kim F. Storm [this message]
2003-02-07 11:05                 ` Andreas Schwab
2003-02-10 10:35                 ` Richard Stallman
2003-02-10 12:51                   ` Kim F. Storm
2003-02-11 22:25                     ` Richard Stallman
2003-02-12 13:00                       ` Kim F. Storm
2003-02-13 10:08                         ` Richard Stallman
2003-02-13 14:19                           ` Kim F. Storm
2003-02-06  1:31     ` Kenichi Handa
2003-02-06 10:40       ` Andreas Schwab

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=5xr8akid8n.fsf@kfs2.cua.dk \
    --to=storm@cua.dk \
    --cc=miles@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.