From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: storm@cua.dk (Kim F. Storm) Newsgroups: gmane.emacs.devel Subject: Re: ?\_ patch Date: 07 Feb 2003 11:42:00 +0100 Sender: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Message-ID: <5xr8akid8n.fsf@kfs2.cua.dk> References: <200302060044.SAA21429@eel.dms.auburn.edu> <200302060106.TAA21443@eel.dms.auburn.edu> <5xel6lu3lh.fsf@kfs2.cua.dk> <5xadh9tyt3.fsf@kfs2.cua.dk> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1044610942 13924 80.91.224.249 (7 Feb 2003 09:42:22 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Fri, 7 Feb 2003 09:42:22 +0000 (UTC) Cc: miles@gnu.org Return-path: Original-Received: from quimby.gnus.org ([80.91.224.244]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 18h51Y-0003cS-00 for ; Fri, 07 Feb 2003 10:42:20 +0100 Original-Received: from monty-python.gnu.org ([199.232.76.173]) by quimby.gnus.org with esmtp (Exim 3.12 #1 (Debian)) id 18h5B2-000263-00 for ; Fri, 07 Feb 2003 10:52:08 +0100 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.10.13) id 18h52S-0006au-05 for emacs-devel@quimby.gnus.org; Fri, 07 Feb 2003 04:43:16 -0500 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.10.13) id 18h52A-0006aW-00 for emacs-devel@gnu.org; Fri, 07 Feb 2003 04:42:58 -0500 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.10.13) id 18h529-0006aH-00 for emacs-devel@gnu.org; Fri, 07 Feb 2003 04:42:57 -0500 Original-Received: from mail.filanet.dk ([195.215.206.179]) by monty-python.gnu.org with esmtp (Exim 4.10.13) id 18h528-0006UH-00; Fri, 07 Feb 2003 04:42:56 -0500 Original-Received: from kfs2.cua.dk.cua.dk (kfs2.local.filanet.dk [192.168.1.182]) by mail.filanet.dk (Postfix) with SMTP id 1CD637C012; Fri, 7 Feb 2003 10:42:49 +0100 (CET) Original-To: rms@gnu.org In-Reply-To: Original-Lines: 77 User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3.50 Original-cc: teirllm@dms.auburn.edu Original-cc: ted@oconnor.cx Original-cc: handa@m17n.org Original-cc: emacs-devel@gnu.org X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1b5 Precedence: list List-Id: Emacs development discussions. List-Help: List-Post: List-Subscribe: , List-Archive: List-Unsubscribe: , Errors-To: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Xref: main.gmane.org gmane.emacs.devel:11452 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:11452 Richard Stallman 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 http://www.cua.dk