* ?\_ patch
@ 2003-02-05 20:10 Edward O'Connor
2003-02-05 23:31 ` Kenichi Handa
0 siblings, 1 reply; 43+ messages in thread
From: Edward O'Connor @ 2003-02-05 20:10 UTC (permalink / raw)
[-- Attachment #1: Type: text/plain, Size: 760 bytes --]
Since no one seemed to object and it's a trivial change, here's a
patch to add ?\_ support. Light testing here shows no ill effects.
The patch does the following:
1. Adds support for ?\_ to lread.c,
2. Documents ?\_ in lispref,
3. Augments checkdoc to replace end-of-line `? ' and `?\ ' with `?\_',
(Note that this change isn't as good as it could be, but I don't
know anything about checkdoc's internals.)
4. Updates etc/NEWS and the various ChangeLogs (which presumably
should be changed by whoever checks this in).
I hope this change squeaks in under the paperwork threshold (it's
really very very simple), but if not, I'm perfectly willing to
sign papers.
Ted
--
Edward O'Connor
ted@oconnor.cx
Ense petit placidam sub libertate quietem.
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: Add support for ?\\_ escape character --]
[-- Type: text/x-patch, Size: 6237 bytes --]
Index: etc/NEWS
===================================================================
RCS file: /cvsroot/emacs/emacs/etc/NEWS,v
retrieving revision 1.786
diff -u -r1.786 NEWS
--- etc/NEWS 3 Feb 2003 20:55:30 -0000 1.786
+++ etc/NEWS 5 Feb 2003 19:31:13 -0000
@@ -1150,6 +1150,8 @@
\f
* Lisp Changes in Emacs 21.4
+** New ?\_ escape character for space.
+
** New variables `gc-elapsed' and `gcs-done' provide extra information
on garbage collection.
Index: lisp/ChangeLog
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/ChangeLog,v
retrieving revision 1.4811
diff -u -r1.4811 ChangeLog
--- lisp/ChangeLog 4 Feb 2003 17:07:42 -0000 1.4811
+++ lisp/ChangeLog 5 Feb 2003 19:31:14 -0000
@@ -1,3 +1,8 @@
+2003-02-05 Edward O'Connor <ted@oconnor.cx>
+ * emacs-lisp/checkdoc.el (checkdoc-rogue-space-check-engine):
+ Replace end-of-line `? ' and `?\ ' with `?\_' instead of
+ requiring a manual fix.
+
2003-02-04 Richard M. Stallman <rms@gnu.org>
* term.el (term-raw-map): Set it up at load time.
Index: lisp/emacs-lisp/checkdoc.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/emacs-lisp/checkdoc.el,v
retrieving revision 1.34
diff -u -r1.34 checkdoc.el
--- lisp/emacs-lisp/checkdoc.el 4 Feb 2003 12:53:34 -0000 1.34
+++ lisp/emacs-lisp/checkdoc.el 5 Feb 2003 19:31:14 -0000
@@ -2112,21 +2112,17 @@
;; If end is nil, it means end of buffer to search anyway
(or
;; Check for an error if `? ' or `?\ ' is used at the end of a line.
- ;; (It's dangerous)
+ ;; This is bad beause `delete-trailing-whitespace' and similar tools
+ ;; may remove this space.
(progn
(goto-char start)
(while (and (not msg) (re-search-forward "\\?\\\\?[ \t][ \t]*$" end t))
(setq msg
"Don't use `? ' at the end of a line. \
-News agents may remove it"
+Replace with ?\\_?"
s (match-beginning 0) e (match-end 0) f t)
- ;; If interactive is passed down, give them a chance to fix things.
- (if (and interact (y-or-n-p (concat msg ". Fix? ")))
- (progn
- (checkdoc-recursive-edit msg)
- (setq msg nil)
- (goto-char s)
- (beginning-of-line)))))
+ ;; Replace `? ' and `?\ ' with `?\_'.
+ (checkdoc-autofix-ask-replace s e msg "?\\_")))
;; Check for, and potentially remove whitespace appearing at the
;; end of different lines.
(progn
Index: lispref/ChangeLog
===================================================================
RCS file: /cvsroot/emacs/emacs/lispref/ChangeLog,v
retrieving revision 1.63
diff -u -r1.63 ChangeLog
--- lispref/ChangeLog 31 Jan 2003 15:21:47 -0000 1.63
+++ lispref/ChangeLog 5 Feb 2003 19:31:14 -0000
@@ -1,3 +1,8 @@
+2003-02-05 Edward O'Connor <ted@oconnor.cx>
+
+ * objects.texi (Character Type): Added documentation for new ?\_
+ escape character.
+
2003-01-31 Joe Buehler <jhpb@draco.hekimian.com>
* os.texi (System Environment): Added cygwin system-type.
Index: lispref/objects.texi
===================================================================
RCS file: /cvsroot/emacs/emacs/lispref/objects.texi,v
retrieving revision 1.32
diff -u -r1.32 objects.texi
--- lispref/objects.texi 4 Feb 2003 14:47:54 -0000 1.32
+++ lispref/objects.texi 5 Feb 2003 19:31:14 -0000
@@ -258,11 +258,13 @@
You can use the same syntax for punctuation characters, but it is
often a good idea to add a @samp{\} so that the Emacs commands for
-editing Lisp code don't get confused. For example, @samp{?\ } is the
+editing Lisp code don't get confused. For example, @samp{?\ } is a
way to write the space character. If the character is @samp{\}, you
@emph{must} use a second @samp{\} to quote it: @samp{?\\}.
@cindex whitespace
+@cindex space
+@cindex @samp{\_}
@cindex bell character
@cindex @samp{\a}
@cindex backspace
@@ -279,12 +281,14 @@
@cindex @samp{\r}
@cindex escape
@cindex @samp{\e}
- You can express the characters Control-g, backspace, tab, newline,
-vertical tab, formfeed, return, del, and escape as @samp{?\a},
-@samp{?\b}, @samp{?\t}, @samp{?\n}, @samp{?\v}, @samp{?\f},
-@samp{?\r}, @samp{?\d}, and @samp{?\e}, respectively. Thus,
+ You can express the characters space, Control-g, backspace, tab,
+newline, vertical tab, formfeed, return, del, and escape as
+@samp{?\_}, @samp{?\a}, @samp{?\b}, @samp{?\t}, @samp{?\n},
+@samp{?\v}, @samp{?\f}, @samp{?\r}, @samp{?\d}, and @samp{?\e},
+respectively. Thus,
@example
+?\_ @result{} 32 ; @r{space, @key{SPC}}
?\a @result{} 7 ; @r{@kbd{C-g}}
?\b @result{} 8 ; @r{backspace, @key{BS}, @kbd{C-h}}
?\t @result{} 9 ; @r{tab, @key{TAB}, @kbd{C-i}}
@@ -455,8 +459,8 @@
@samp{()\|;'`"#.,} to avoid confusing the Emacs commands for editing
Lisp code. Also add a backslash before whitespace characters such as
space, tab, newline and formfeed. However, it is cleaner to use one of
-the easily readable escape sequences, such as @samp{\t}, instead of an
-actual whitespace character such as a tab.
+the easily readable escape sequences, such as @samp{\t} or @samp{\_},
+instead of an actual whitespace character such as a tab or space.
@node Symbol Type
@subsection Symbol Type
Index: src/ChangeLog
===================================================================
RCS file: /cvsroot/emacs/emacs/src/ChangeLog,v
retrieving revision 1.3081
diff -u -r1.3081 ChangeLog
--- src/ChangeLog 4 Feb 2003 11:52:10 -0000 1.3081
+++ src/ChangeLog 5 Feb 2003 19:31:14 -0000
@@ -1,3 +1,7 @@
+2003-02-05 Edward O'Connor <ted@oconnor.cx>
+
+ * lread.c (read_escape): Handle new ?\_ escape character.
+
2003-02-04 Richard M. Stallman <rms@gnu.org>
* keyboard.c (echo_now): Update before_command_echo_length.
Index: src/lread.c
===================================================================
RCS file: /cvsroot/emacs/emacs/src/lread.c,v
retrieving revision 1.305
diff -u -r1.305 lread.c
--- src/lread.c 4 Feb 2003 14:03:12 -0000 1.305
+++ src/lread.c 5 Feb 2003 19:31:15 -0000
@@ -1655,6 +1655,8 @@
return '\v';
case '\n':
return -1;
+ case '_':
+ return ' ';
case ' ':
if (stringp)
return -1;
[-- Attachment #3: Type: text/plain, Size: 142 bytes --]
_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/emacs-devel
^ permalink raw reply [flat|nested] 43+ messages in thread
* Re: ?\_ patch
2003-02-05 20:10 ?\_ patch Edward O'Connor
@ 2003-02-05 23:31 ` Kenichi Handa
2003-02-06 0:44 ` Luc Teirlinck
0 siblings, 1 reply; 43+ messages in thread
From: Kenichi Handa @ 2003-02-05 23:31 UTC (permalink / raw)
Cc: emacs-devel
In article <u4cptq6fpzk.fsf@george.floobin.cx>, "Edward O'Connor" <ted@oconnor.cx> writes:
> [1 <text/plain (7bit)>]
> Since no one seemed to object and it's a trivial change, here's a
> patch to add ?\_ support. Light testing here shows no ill effects.
I object to it.
By grepping, I found many files under lisp subdir are using
"?\_" for representing "?_" (e.g. calc/calc-ext.el). Some
are using ?\X unconditionaly even in the place where ?X
works.
That means there are much more such files not included in
Emacs distribution. If we change the meaning of ?\_, all of
them stop working.
---
Ken'ichi HANDA
handa@m17n.org
^ permalink raw reply [flat|nested] 43+ messages in thread
* Re: ?\_ patch
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:31 ` Kenichi Handa
0 siblings, 2 replies; 43+ messages in thread
From: Luc Teirlinck @ 2003-02-06 0:44 UTC (permalink / raw)
Cc: emacs-devel
Ken'ichi HANDA wrote:
I object to it.
By grepping, I found many files under lisp subdir are using
"?\_" for representing "?_" (e.g. calc/calc-ext.el). Some
are using ?\X unconditionaly even in the place where ?X
works.
That means there are much more such files not included in
Emacs distribution. If we change the meaning of ?\_, all of
them stop working.
I did not realize people would be doing this, especially since I saw
no recommendation to quote `_' anywhere.
I now agree with you.
This leaves two solutions: use ?\s, which is somewhat confusing, but
perfectly safe since it has been "protected" by an error message for
ages, or change the default value of tabify-regexp to leave ?\ alone.
Of course, the second solution would mean that personal customizations
of tabify-regexp would be dangerous.
I now lean toward the original solution of using ?\s.
Alternatives like using 32, ?\040 or ?\x20 do not look attractive.
Sincerely,
Luc.
^ permalink raw reply [flat|nested] 43+ messages in thread
* Re: ?\_ patch
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 1:31 ` Kenichi Handa
1 sibling, 2 replies; 43+ messages in thread
From: Luc Teirlinck @ 2003-02-06 1:06 UTC (permalink / raw)
Cc: handa
>From my previous message:
I now lean toward the original solution of using ?\s.
Of course, if one wanted to use it within a string (which one should
allow for consistency), then one might have to worry about whether
"\s-a" would be a valid string, or whether "\s\-a" would be necessary.
Currently, "\s-a" leads to a "Invalid modifier in string" error.
There might be other problems (although I do not see any right now.)
Modifying tabify-regexp is an alternative. It is not a user option
and one could point out in the documentation string that one should
be careful in modifying it.
Sincerely,
Luc.
^ permalink raw reply [flat|nested] 43+ messages in thread
* Re: ?\_ patch
2003-02-06 1:06 ` Luc Teirlinck
@ 2003-02-06 1:20 ` Luc Teirlinck
2003-02-06 10:04 ` Kim F. Storm
1 sibling, 0 replies; 43+ messages in thread
From: Luc Teirlinck @ 2003-02-06 1:20 UTC (permalink / raw)
Cc: handa
>From my previous message:
Of course, if one wanted to use it within a string (which one should
allow for consistency), then one might have to worry about whether
"\s-a" would be a valid string, or whether "\s\-a" would be necessary.
Currently, "\s-a" leads to a "Invalid modifier in string" error.
Requiring "\s\-a" would be better, the alternative would really be too
confusing.
Sincerely,
Luc.
^ permalink raw reply [flat|nested] 43+ messages in thread
* Re: ?\_ patch
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
1 sibling, 1 reply; 43+ messages in thread
From: Kim F. Storm @ 2003-02-06 10:04 UTC (permalink / raw)
Cc: handa
Luc Teirlinck <teirllm@dms.auburn.edu> writes:
> >From my previous message:
>
> I now lean toward the original solution of using ?\s.
>
> Of course, if one wanted to use it within a string (which one should
> allow for consistency), then one might have to worry about whether
> "\s-a" would be a valid string, or whether "\s\-a" would be necessary.
> Currently, "\s-a" leads to a "Invalid modifier in string" error.
> There might be other problems (although I do not see any right now.)
What about ?\SPC
^ permalink raw reply [flat|nested] 43+ messages in thread
* Re: ?\_ patch
2003-02-06 10:04 ` Kim F. Storm
@ 2003-02-06 9:17 ` Miles Bader
2003-02-06 11:48 ` Kim F. Storm
0 siblings, 1 reply; 43+ messages in thread
From: Miles Bader @ 2003-02-06 9:17 UTC (permalink / raw)
Cc: handa
storm@cua.dk (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 guess there's not a conflict between ?\r and ?\RET because one uses
lowercase and the other uppercase, though it makes me a bit nervous...]
-Miles
--
I'd rather be consing.
^ permalink raw reply [flat|nested] 43+ messages in thread
* Re: ?\_ patch
2003-02-06 9:17 ` Miles Bader
@ 2003-02-06 11:48 ` Kim F. Storm
2003-02-06 11:37 ` Juanma Barranquero
` (2 more replies)
0 siblings, 3 replies; 43+ messages in thread
From: Kim F. Storm @ 2003-02-06 11:48 UTC (permalink / raw)
Cc: handa
Miles Bader <miles@lsi.nec.co.jp> writes:
> storm@cua.dk (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
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.
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 <storm@cua.dk> http://www.cua.dk
^ permalink raw reply [flat|nested] 43+ messages in thread
* Re: ?\_ patch
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 9:18 ` Richard Stallman
2 siblings, 0 replies; 43+ messages in thread
From: Juanma Barranquero @ 2003-02-06 11:37 UTC (permalink / raw)
Cc: Miles Bader
On 06 Feb 2003 12:48:24 +0100, storm@cua.dk (Kim F. Storm) wrote:
> 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 like it.
/L/e/k/t/u
^ permalink raw reply [flat|nested] 43+ messages in thread
* Re: ?\_ patch
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 9:18 ` Richard Stallman
2 siblings, 1 reply; 43+ messages in thread
From: Luc Teirlinck @ 2003-02-06 17:33 UTC (permalink / raw)
Cc: miles
Richard and Handa seem to object against any change in Emacs for the
purpose. I do not know whether or not that is due to the fact that
they might believe the required change to be more substantial than it
actually is (as can be seen from your patch). Of course, in addition
to your patch some "secondary" changes to support the primary change
would be necessary, as can be seen from Ted's original patch.
However, such secondary (mostly documentation) changes are necessary
anyway if we are going to alert people to the dangers of ?\ in terms
of trailing whitespace removal and tabification, and propose
alternatives.
If you compare ?\s with ?\040 or ?\x20 (which I consider so closely
related that I consider them as one solution), then:
?\s:
Disadvantages:
1. Possible confusion with ?\s-
2. Requires change in Emacs.
Advantages:
1. Intuitive and concise.
2. Required change in Emacs is limited.
?\040 (or ?\x20)
Disadvantages:
1. Relies on ASCII ordering.
2. Not terribly intuitive.
Advantage:
No change in Emacs required.
I believe that the third suggested solution, (string-to-car " "),
presents some problems if one systematically would want to replace \?
everywhere with it, as I pointed out before.
The main objection against ?\s seems to be the change in Emacs.
In as far as ?\040 (or ?\x20) are concerned, Handa does not seem to
object against the reliance on ASCII and he knows that stuff a lot
better than I do.
So it all comes down to whether the gain in intuitiveness from \?s is
worth the (small) change in Emacs. Of course, intuitiveness is a
relative concept.
Sincerely,
Luc.
^ permalink raw reply [flat|nested] 43+ messages in thread
* Re: ?\_ patch
2003-02-06 17:33 ` Luc Teirlinck
@ 2003-02-07 2:07 ` Miles Bader
2003-02-07 2:53 ` Luc Teirlinck
0 siblings, 1 reply; 43+ messages in thread
From: Miles Bader @ 2003-02-07 2:07 UTC (permalink / raw)
Cc: storm
Luc Teirlinck <teirllm@dms.auburn.edu> writes:
> ?\s:
> Disadvantages:
> 1. Possible confusion with ?\s-
> 2. Requires change in Emacs.
> Advantages:
> 1. Intuitive and concise.
> 2. Required change in Emacs is limited.
>
> ?\040 (or ?\x20)
> Disadvantages:
> 1. Relies on ASCII ordering.
> 2. Not terribly intuitive.
> Advantage:
> No change in Emacs required.
?\_:
Disadvantages:
1. Requires change in Emacs.
Advantages:
1. Intuitive and concise.
2. Required change in Emacs is limited.
I.e., the same as ?\s except with fewer disadvantages...
-Miles
--
80% of success is just showing up. --Woody Allen
^ permalink raw reply [flat|nested] 43+ messages in thread
* Re: ?\_ patch
2003-02-07 2:07 ` Miles Bader
@ 2003-02-07 2:53 ` Luc Teirlinck
2003-02-07 8:34 ` Miles Bader
0 siblings, 1 reply; 43+ messages in thread
From: Luc Teirlinck @ 2003-02-07 2:53 UTC (permalink / raw)
Cc: storm
Miles Bader wrote:
?\_:
Disadvantages:
1. Requires change in Emacs.
Advantages:
1. Intuitive and concise.
2. Required change in Emacs is limited.
I.e., the same as ?\s except with fewer disadvantages...
As Handa pointed out, ?\_ would have broken tons of existing code,
which, for whatever reason, used ?\_ instead of ?_ Breaking existing
code is a big disadvantage.
Sincerely,
Luc.
^ permalink raw reply [flat|nested] 43+ messages in thread
* Re: ?\_ patch
2003-02-07 2:53 ` Luc Teirlinck
@ 2003-02-07 8:34 ` Miles Bader
2003-02-07 8:56 ` Kenichi Handa
0 siblings, 1 reply; 43+ messages in thread
From: Miles Bader @ 2003-02-07 8:34 UTC (permalink / raw)
Cc: storm
Luc Teirlinck <teirllm@dms.auburn.edu> writes:
> As Handa pointed out, ?\_ would have broken tons of existing code,
> which, for whatever reason, used ?\_ instead of ?_ Breaking existing
> code is a big disadvantage.
I didn't see Handa's message (there was a wierd burp in the emacs-devel
mailing list, so perhaps it got nuked there...), but I did a grep and
you're right -- a bunch of code uses ?\_ to mean ?_ .
I can't imagine _why_ people did that, but they did, so I guess ?\_ is
no good. Bleah.
I really don't like the wierd double identity of ?\s, but I'm not sure
what alternative there is... Perhaps kim's idea (?\SPC), but with a less
ambiguous syntax, e.g., #\SPC or something.
Does xemacs do anything about this issue?
-Miles
--
Fast, small, soon; pick any 2.
^ permalink raw reply [flat|nested] 43+ messages in thread
* Re: ?\_ patch
2003-02-07 8:34 ` Miles Bader
@ 2003-02-07 8:56 ` Kenichi Handa
2003-02-07 14:17 ` Kim F. Storm
0 siblings, 1 reply; 43+ messages in thread
From: Kenichi Handa @ 2003-02-07 8:56 UTC (permalink / raw)
Cc: storm
In article <buo65rwbibj.fsf@mcspd15.ucom.lsi.nec.co.jp>, Miles Bader <miles@lsi.nec.co.jp> writes:
> I really don't like the wierd double identity of ?\s, but I'm not sure
> what alternative there is... Perhaps kim's idea (?\SPC), but with a less
> ambiguous syntax, e.g., #\SPC or something.
Ah! I completely forgot about `#' syntax. I think it's a
good idea.
Currently single-key-description produces these: TAB, RET,
ESC, SPC, DEL. Allowing the corresponding #\TAB, #\RET,
#\ESC, #\SPC, #\DEL seems nifty.
---
Ken'ichi HANDA
handa@m17n.org
^ permalink raw reply [flat|nested] 43+ messages in thread
* Re: ?\_ patch
2003-02-07 8:56 ` Kenichi Handa
@ 2003-02-07 14:17 ` Kim F. Storm
2003-02-07 13:28 ` Miles Bader
0 siblings, 1 reply; 43+ messages in thread
From: Kim F. Storm @ 2003-02-07 14:17 UTC (permalink / raw)
Cc: miles
Kenichi Handa <handa@m17n.org> writes:
> In article <buo65rwbibj.fsf@mcspd15.ucom.lsi.nec.co.jp>, Miles Bader <miles@lsi.nec.co.jp> writes:
>
> > I really don't like the wierd double identity of ?\s, but I'm not sure
> > what alternative there is... Perhaps kim's idea (?\SPC), but with a less
> > ambiguous syntax, e.g., #\SPC or something.
>
> Ah! I completely forgot about `#' syntax. I think it's a
> good idea.
I don't object to it, but I think it is unnecessary.
Why add a whole new syntax just because we need ?\s which can be added
with no hazzle at all?
>
> Currently single-key-description produces these: TAB, RET,
> ESC, SPC, DEL. Allowing the corresponding #\TAB, #\RET,
> #\ESC, #\SPC, #\DEL seems nifty.
If everyone else agrees this is a good idea, I'd suggest
using #?SPC, #?TAB, etc.
--
Kim F. Storm <storm@cua.dk> http://www.cua.dk
^ permalink raw reply [flat|nested] 43+ messages in thread
* Re: ?\_ patch
2003-02-07 14:17 ` Kim F. Storm
@ 2003-02-07 13:28 ` Miles Bader
2003-02-07 14:52 ` Kim F. Storm
0 siblings, 1 reply; 43+ messages in thread
From: Miles Bader @ 2003-02-07 13:28 UTC (permalink / raw)
Cc: Kenichi Handa
On Fri, Feb 07, 2003 at 03:17:33PM +0100, Kim F. Storm wrote:
> > > I really don't like the wierd double identity of ?\s, but I'm not sure
> > > what alternative there is... Perhaps kim's idea (?\SPC), but with a less
> > > ambiguous syntax, e.g., #\SPC or something.
> >
> > Ah! I completely forgot about `#' syntax. I think it's a
> > good idea.
>
> I don't object to it, but I think it is unnecessary.
>
> Why add a whole new syntax just because we need ?\s which can be added
> with no hazzle at all?
Because #\SPC is actually pretty self-explanatory whereas ?\s isn't.
> If everyone else agrees this is a good idea, I'd suggest
> using #?SPC, #?TAB, etc.
I thought about that too, but I think #\SPC is better, because the `\' leaves
a bit of whitespace between itself and the following character so the `SPC'
stands out quite distinctly. `?' on the other isn't visually distinct, so
#?SPC looks like a bit of a muddle.
-Miles
--
"1971 pickup truck; will trade for guns"
^ permalink raw reply [flat|nested] 43+ messages in thread
* Re: ?\_ patch
2003-02-07 13:28 ` Miles Bader
@ 2003-02-07 14:52 ` Kim F. Storm
2003-02-07 14:02 ` Miles Bader
2003-02-10 10:47 ` Andreas Schwab
0 siblings, 2 replies; 43+ messages in thread
From: Kim F. Storm @ 2003-02-07 14:52 UTC (permalink / raw)
Cc: Kenichi Handa
Miles Bader <miles@gnu.org> writes:
> On Fri, Feb 07, 2003 at 03:17:33PM +0100, Kim F. Storm wrote:
> > > > I really don't like the wierd double identity of ?\s, but I'm not sure
> > > > what alternative there is... Perhaps kim's idea (?\SPC), but with a less
> > > > ambiguous syntax, e.g., #\SPC or something.
> > >
> > > Ah! I completely forgot about `#' syntax. I think it's a
> > > good idea.
> >
> > I don't object to it, but I think it is unnecessary.
> >
> > Why add a whole new syntax just because we need ?\s which can be added
> > with no hazzle at all?
>
> Because #\SPC is actually pretty self-explanatory whereas ?\s isn't.
IMO, \s is just as self-explanatory as \t, \n, and \r.
>
> > If everyone else agrees this is a good idea, I'd suggest
> > using #?SPC, #?TAB, etc.
>
> I thought about that too, but I think #\SPC is better, because the `\' leaves
> a bit of whitespace between itself and the following character so the `SPC'
> stands out quite distinctly. `?' on the other isn't visually distinct, so
> #?SPC looks like a bit of a muddle.
>
Then what about simply using ?SPC, ?TAB, etc.
Today, if I eval (using C-j) the following in *scratch*, I get:
?S => 83
?SPC => 83
'(?SPC) => (83 PC)
but if I do
M-: ? S P C RET
I get
list: Trailing garbage following expression
so the current character syntax really is pretty obscure.
This could easily be changed to:
?S => 83
?SPC => 32
'(?SPC) => (32)
Can anyone think of existing code which will be broken by that
approach?
--
Kim F. Storm <storm@cua.dk> http://www.cua.dk
^ permalink raw reply [flat|nested] 43+ messages in thread
* Re: ?\_ patch
2003-02-07 14:52 ` Kim F. Storm
@ 2003-02-07 14:02 ` Miles Bader
2003-02-07 14:30 ` Dmitry Paduchikh
` (2 more replies)
2003-02-10 10:47 ` Andreas Schwab
1 sibling, 3 replies; 43+ messages in thread
From: Miles Bader @ 2003-02-07 14:02 UTC (permalink / raw)
Cc: Kenichi Handa
On Fri, Feb 07, 2003 at 03:52:02PM +0100, Kim F. Storm wrote:
> > Because #\SPC is actually pretty self-explanatory whereas ?\s isn't.
>
> IMO, \s is just as self-explanatory as \t, \n, and \r.
The latter are `self-explanatory' only because they're used in C, and so are
very familar to programmers. \s is not.
> > I thought about that too, but I think #\SPC is better, because the `\'
> > leaves a bit of whitespace between itself and the following character so
> > the `SPC' stands out quite distinctly. `?' on the other isn't visually
> > distinct, so #?SPC looks like a bit of a muddle.
>
> Then what about simply using ?SPC, ?TAB, etc.
No, you're missing the point. My object to `?' is that the `?' is not
visually distinct from the `S' -- they tend to `run into' each other.
`\', on the other hand has a bunch of whitespace on the right side of it's
glyph, and so is much more visually distinct from the following character.
So getting rid of the `#' doesn't help at all.
Morever, `#' is _good_ becaues it's the general lisp syntax for special
syntax, so a lisp programmer will be much more likely to realize what's going
on (if he's unfamiliar with this particular bit of syntax) if he sees #\SPC
than if he sees ?SPC.
> Can anyone think of existing code which will be broken by that
> approach?
I don't know, but I think it doesn't matter; we should just use a `#' escape.
-Miles
--
I'd rather be consing.
^ permalink raw reply [flat|nested] 43+ messages in thread
* Re: ?\_ patch
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:51 ` Kim F. Storm
2003-02-09 12:39 ` Richard Stallman
2 siblings, 1 reply; 43+ messages in thread
From: Dmitry Paduchikh @ 2003-02-07 14:30 UTC (permalink / raw)
Cc: Kim F. Storm
Hi!
>>>>> Miles Bader <miles@gnu.org> writes:
> Morever, `#' is _good_ becaues it's the general lisp syntax for special
> syntax, so a lisp programmer will be much more likely to realize what's going
> on (if he's unfamiliar with this particular bit of syntax) if he sees #\SPC
> than if he sees ?SPC.
If you will do this, why not introduce such alternative syntax for
_all_ characters? It would give the advantage of being consistent with
other lispish languages since both CL and Scheme use `#\' to denote
characters.
^ permalink raw reply [flat|nested] 43+ messages in thread
* Re: ?\_ patch
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:09 ` Dmitry Paduchikh
0 siblings, 2 replies; 43+ messages in thread
From: Kim F. Storm @ 2003-02-07 16:07 UTC (permalink / raw)
Cc: Miles Bader
Dmitry Paduchikh <paduch@imm.uran.ru> writes:
> Hi!
>
> >>>>> Miles Bader <miles@gnu.org> writes:
>
> > Morever, `#' is _good_ becaues it's the general lisp syntax for special
> > syntax, so a lisp programmer will be much more likely to realize what's going
> > on (if he's unfamiliar with this particular bit of syntax) if he sees #\SPC
> > than if he sees ?SPC.
>
> If you will do this, why not introduce such alternative syntax for
> _all_ characters? It would give the advantage of being consistent with
> other lispish languages since both CL and Scheme use `#\' to denote
> characters.
What is the CL and Scheme syntax for a space character ?
--
Kim F. Storm <storm@cua.dk> http://www.cua.dk
^ permalink raw reply [flat|nested] 43+ messages in thread
* Re: ?\_ patch
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:09 ` Dmitry Paduchikh
1 sibling, 1 reply; 43+ messages in thread
From: John Paul Wallington @ 2003-02-07 15:53 UTC (permalink / raw)
Cc: Miles Bader
Kim F. Storm wrote:
> What is the CL and Scheme syntax for a space character ?
#\Space
^ permalink raw reply [flat|nested] 43+ messages in thread
* Re: ?\_ patch
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
0 siblings, 2 replies; 43+ messages in thread
From: Kim F. Storm @ 2003-02-07 16:50 UTC (permalink / raw)
Cc: Miles Bader
John Paul Wallington <jpw@gnu.org> writes:
> Kim F. Storm wrote:
>
> > What is the CL and Scheme syntax for a space character ?
>
> #\Space
>
So I guess introducing #\SPC for space in emacs would be even more
confusing than ?\s or ?\SPC.
--
Kim F. Storm <storm@cua.dk> http://www.cua.dk
^ permalink raw reply [flat|nested] 43+ messages in thread
* Re: ?\_ patch
2003-02-07 16:50 ` Kim F. Storm
@ 2003-02-07 16:23 ` John Paul Wallington
2003-02-08 1:44 ` Miles Bader
1 sibling, 0 replies; 43+ messages in thread
From: John Paul Wallington @ 2003-02-07 16:23 UTC (permalink / raw)
Cc: Miles Bader
Kim F. Storm wrote:
> > > What is the CL and Scheme syntax for a space character ?
> >
> > #\Space
> >
>
> So I guess introducing #\SPC for space in emacs would be even more
> confusing than ?\s or ?\SPC.
CL, Scheme, and other dialects like rep support #\ syntax for chars
where you can have symbolic names like space or newline.
Maybe emacs lisp could do likewise.
^ permalink raw reply [flat|nested] 43+ messages in thread
* Re: ?\_ patch
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
1 sibling, 1 reply; 43+ messages in thread
From: Miles Bader @ 2003-02-08 1:44 UTC (permalink / raw)
Cc: emacs-devel
On Fri, Feb 07, 2003 at 05:50:21PM +0100, Kim F. Storm wrote:
> > > What is the CL and Scheme syntax for a space character ?
> >
> > #\Space
>
> So I guess introducing #\SPC for space in emacs would be even more
> confusing than ?\s or ?\SPC.
Oh, don't be silly. _all_ of the above are pretty clear to anyone with even
a modicum of clue, except ?\s.
-miles
--
`Cars give people wonderful freedom and increase their opportunities.
But they also destroy the environment, to an extent so drastic that
they kill all social life' (from _A Pattern Language_)
^ permalink raw reply [flat|nested] 43+ messages in thread
* Re: ?\_ patch
2003-02-08 1:44 ` Miles Bader
@ 2003-02-09 2:07 ` Kim F. Storm
2003-02-10 1:48 ` Miles Bader
0 siblings, 1 reply; 43+ messages in thread
From: Kim F. Storm @ 2003-02-09 2:07 UTC (permalink / raw)
Cc: emacs-devel
Miles Bader <miles@gnu.org> writes:
> On Fri, Feb 07, 2003 at 05:50:21PM +0100, Kim F. Storm wrote:
> > > > What is the CL and Scheme syntax for a space character ?
> > >
> > > #\Space
> >
> > So I guess introducing #\SPC for space in emacs would be even more
> > confusing than ?\s or ?\SPC.
>
> Oh, don't be silly. _all_ of the above are pretty clear to anyone with even
> a modicum of clue, except ?\s.
IMO, it would be silly to adapt the CL and Scheme syntax for
characters, but use different names for the characters. If we want to
use #\<something> to denote a space, it should be #\Space - not #\SPC.
--
Kim F. Storm <storm@cua.dk> http://www.cua.dk
^ permalink raw reply [flat|nested] 43+ messages in thread
* Re: ?\_ patch
2003-02-07 16:07 ` Kim F. Storm
2003-02-07 15:53 ` John Paul Wallington
@ 2003-02-07 16:09 ` Dmitry Paduchikh
1 sibling, 0 replies; 43+ messages in thread
From: Dmitry Paduchikh @ 2003-02-07 16:09 UTC (permalink / raw)
Cc: Miles Bader
>>>>> Kim F Storm <no-spam@cua.dk> writes:
> What is the CL and Scheme syntax for a space character ?
Standard syntax for space in CL is `#\ ' or `#\Space'. See
<http://www.lispworks.com/reference/HyperSpec/Body/02_dha.htm> for
details.
^ permalink raw reply [flat|nested] 43+ messages in thread
* Re: ?\_ patch
2003-02-07 14:02 ` Miles Bader
2003-02-07 14:30 ` Dmitry Paduchikh
@ 2003-02-07 15:51 ` Kim F. Storm
2003-02-07 15:13 ` Damien Elmes
2003-02-09 12:39 ` Richard Stallman
2 siblings, 1 reply; 43+ messages in thread
From: Kim F. Storm @ 2003-02-07 15:51 UTC (permalink / raw)
Cc: Kenichi Handa
Miles Bader <miles@gnu.org> writes:
> On Fri, Feb 07, 2003 at 03:52:02PM +0100, Kim F. Storm wrote:
> > > Because #\SPC is actually pretty self-explanatory whereas ?\s isn't.
> >
> > IMO, \s is just as self-explanatory as \t, \n, and \r.
>
> The latter are `self-explanatory' only because they're used in C, and so are
> very familar to programmers. \s is not.
The Lisp manual doesn't refer to C syntax to explain e.g. ?\t.
So to me, \s and \t are equally self-explanatory.
On the other hand, I don't find #\SPC self-explanatory (but ?\SPC is).
>
> > > I thought about that too, but I think #\SPC is better, because the `\'
> > > leaves a bit of whitespace between itself and the following character so
> > > the `SPC' stands out quite distinctly. `?' on the other isn't visually
> > > distinct, so #?SPC looks like a bit of a muddle.
> >
> > Then what about simply using ?SPC, ?TAB, etc.
>
> No, you're missing the point. My object to `?' is that the `?' is not
> visually distinct from the `S' -- they tend to `run into' each other.
> `\', on the other hand has a bunch of whitespace on the right side of it's
> glyph, and so is much more visually distinct from the following character.
Ok, I agree. However, I still think it is best to keep the ? as part
of the read syntax for a character, i.e. I prefer ?\SPC to #\SPC as
the ?\ prefix clearly identifies this as a character, e.g. I find the
use of ? in the following example more consistent than #:
(memq ch '(?\SPC ?\- ?\n ?\t))
(memq ch '(#\SPC ?\- ?\n ?\t))
I just grepped for "[?][\\][A-Z][^-]" in all of lisp/ and there isn't
a single occurrence. So the ?\XXX syntax should be safe.
> Morever, `#' is _good_ becaues it's the general lisp syntax for special
> syntax, so a lisp programmer will be much more likely to realize what's going
> on (if he's unfamiliar with this particular bit of syntax) if he sees #\SPC
> than if he sees ?SPC.
But `?' is _much better_ than `#' here, since _any_ lisp programmer
should know that this denotes a character, whereas `#' just denotes it
as "special" (but there's nothing special about a space character?).
I vote for ?\SPC over #\SPC.
But I still think adding ?\s is the best choice; it's simple, it
doesn't break anything, and it doesn't require us to introduce a
completely new character syntax.
--
Kim F. Storm <storm@cua.dk> http://www.cua.dk
^ permalink raw reply [flat|nested] 43+ messages in thread
* Re: ?\_ patch
2003-02-07 15:51 ` Kim F. Storm
@ 2003-02-07 15:13 ` Damien Elmes
2003-02-07 20:20 ` Luc Teirlinck
0 siblings, 1 reply; 43+ messages in thread
From: Damien Elmes @ 2003-02-07 15:13 UTC (permalink / raw)
storm@cua.dk (Kim F. Storm) writes:
> The Lisp manual doesn't refer to C syntax to explain e.g. ?\t.
> So to me, \s and \t are equally self-explanatory.
I agree. I also think that the more verbose you make the "proper" way to go
about it, the more likely people are going to be lazy and just use "? ". Why
introduce a whole new #\ syntax when ?foo is currently widely used to
represent characters?
Regards,
--
Damien Elmes
^ permalink raw reply [flat|nested] 43+ messages in thread
* Re: ?\_ patch
2003-02-07 15:13 ` Damien Elmes
@ 2003-02-07 20:20 ` Luc Teirlinck
0 siblings, 0 replies; 43+ messages in thread
From: Luc Teirlinck @ 2003-02-07 20:20 UTC (permalink / raw)
Cc: emacs-devel
Damien Elmes wrote:
storm@cua.dk (Kim F. Storm) writes:
> The Lisp manual doesn't refer to C syntax to explain e.g. ?\t.
> So to me, \s and \t are equally self-explanatory.
I agree. I also think that the more verbose you make the "proper"
way to go about it, the more likely people are going to be lazy and
just use "? ". Why introduce a whole new #\ syntax when ?foo is
currently widely used to represent characters?
I agree with Damien and Kim on this. I believe that the few times
that one actually needs ?\ are not sufficient to introduce an entirely
new style of character syntax into emacs. This seems like the
proverbial sledgehammer to crush an almond. I do not believe that we
should try to emulate Common Lisp in this particular respect. I like
Common Lisp, but its treatment of characters is quite simply not its
strongest point. Whenever I have to play around with characters, I
would much rather use Elisp.
I prefer to go for Kim's latest ?\s version (where \s denotes a space
even in "\s-a", since the super modifier is invalid inside strings
anyway). Short of that, I would rather stay with ?\040 or ?\x20 than
to introduce entirely new-style character syntax.
Sincerely,
Luc.
^ permalink raw reply [flat|nested] 43+ messages in thread
* Re: ?\_ patch
2003-02-07 14:02 ` Miles Bader
2003-02-07 14:30 ` Dmitry Paduchikh
2003-02-07 15:51 ` Kim F. Storm
@ 2003-02-09 12:39 ` Richard Stallman
2 siblings, 0 replies; 43+ messages in thread
From: Richard Stallman @ 2003-02-09 12:39 UTC (permalink / raw)
Cc: storm
Morever, `#' is _good_ becaues it's the general lisp syntax for special
syntax, so a lisp programmer will be much more likely to realize what's going
on (if he's unfamiliar with this particular bit of syntax) if he sees #\SPC
than if he sees ?SPC.
? is already our syntax for character constants; I see no reason
for changing that.
^ permalink raw reply [flat|nested] 43+ messages in thread
* Re: ?\_ patch
2003-02-07 14:52 ` Kim F. Storm
2003-02-07 14:02 ` Miles Bader
@ 2003-02-10 10:47 ` Andreas Schwab
1 sibling, 0 replies; 43+ messages in thread
From: Andreas Schwab @ 2003-02-10 10:47 UTC (permalink / raw)
Cc: Miles Bader
storm@cua.dk (Kim F. Storm) writes:
|> IMO, \s is just as self-explanatory as \t, \n, and \r.
IMHO, \s is bad because it has already two other meanings, one as the
super prefix, another as the syntax matcher in a regex. Both have nothing
to do with spaces.
Andreas.
--
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux AG, Deutschherrnstr. 15-19, D-90429 Nürnberg
Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"And now for something completely different."
^ permalink raw reply [flat|nested] 43+ messages in thread
* Re: ?\_ patch
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 9:18 ` Richard Stallman
2003-02-07 10:42 ` Kim F. Storm
2 siblings, 1 reply; 43+ messages in thread
From: Richard Stallman @ 2003-02-07 9:18 UTC (permalink / raw)
Cc: miles
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.
Perhaps we could introduce the \s feature only for character constants.
In that particular context, there is no ambiguity.
^ permalink raw reply [flat|nested] 43+ messages in thread
* Re: ?\_ patch
2003-02-07 9:18 ` Richard Stallman
@ 2003-02-07 10:42 ` Kim F. Storm
2003-02-07 11:05 ` Andreas Schwab
2003-02-10 10:35 ` Richard Stallman
0 siblings, 2 replies; 43+ messages in thread
From: Kim F. Storm @ 2003-02-07 10:42 UTC (permalink / raw)
Cc: miles
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
^ permalink raw reply [flat|nested] 43+ messages in thread
* Re: ?\_ patch
2003-02-07 10:42 ` Kim F. Storm
@ 2003-02-07 11:05 ` Andreas Schwab
2003-02-10 10:35 ` Richard Stallman
1 sibling, 0 replies; 43+ messages in thread
From: Andreas Schwab @ 2003-02-07 11:05 UTC (permalink / raw)
Cc: emacs-devel
storm@cua.dk (Kim F. Storm) writes:
|> BTW, why is `backslash space' ignored in a string?
|> "\ " => ""
For writing things like "\xdead\ beef" .
Andreas.
--
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux AG, Deutschherrnstr. 15-19, D-90429 Nürnberg
Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"And now for something completely different."
^ permalink raw reply [flat|nested] 43+ messages in thread
* Re: ?\_ patch
2003-02-07 10:42 ` Kim F. Storm
2003-02-07 11:05 ` Andreas Schwab
@ 2003-02-10 10:35 ` Richard Stallman
2003-02-10 12:51 ` Kim F. Storm
1 sibling, 1 reply; 43+ messages in thread
From: Richard Stallman @ 2003-02-10 10:35 UTC (permalink / raw)
Cc: miles
case 's':
+ if (stringp)
+ return ' ';
c = READCHAR;
! if (c != '-') {
! UNREAD (c);
! return ' ';
! }
c = READCHAR;
if (c == '\\')
This might be a good idea if we combine it with the feature that it is
an error to put a digit or a symbol character or # after a character
constant with no space in between.
^ permalink raw reply [flat|nested] 43+ messages in thread
* Re: ?\_ patch
2003-02-10 10:35 ` Richard Stallman
@ 2003-02-10 12:51 ` Kim F. Storm
2003-02-11 22:25 ` Richard Stallman
0 siblings, 1 reply; 43+ messages in thread
From: Kim F. Storm @ 2003-02-10 12:51 UTC (permalink / raw)
Cc: miles
Richard Stallman <rms@gnu.org> writes:
> case 's':
> + if (stringp)
> + return ' ';
> c = READCHAR;
> ! if (c != '-') {
> ! UNREAD (c);
> ! return ' ';
> ! }
> c = READCHAR;
> if (c == '\\')
>
> This might be a good idea if we combine it with the feature that it is
> an error to put a digit or a symbol character or # after a character
> constant with no space in between.
There are several places where something like '(? ?...) or '(?\ ?...)
is used, i.e. where no additional space separates the "? " character
from the "?" of the next character.
So we would at least need to make an exception that no additional
space is needed after a (real) space.
--
Kim F. Storm <storm@cua.dk> http://www.cua.dk
^ permalink raw reply [flat|nested] 43+ messages in thread
* Re: ?\_ patch
2003-02-10 12:51 ` Kim F. Storm
@ 2003-02-11 22:25 ` Richard Stallman
2003-02-12 13:00 ` Kim F. Storm
0 siblings, 1 reply; 43+ messages in thread
From: Richard Stallman @ 2003-02-11 22:25 UTC (permalink / raw)
Cc: miles
> This might be a good idea if we combine it with the feature that it is
> an error to put a digit or a symbol character or # after a character
> constant with no space in between.
There are several places where something like '(? ?...) or '(?\ ?...)
is used, i.e. where no additional space separates the "? " character
from the "?" of the next character.
Looking closely, there is no overlap between these cases and the ones
I said should be an error.
^ permalink raw reply [flat|nested] 43+ messages in thread
* Re: ?\_ patch
2003-02-11 22:25 ` Richard Stallman
@ 2003-02-12 13:00 ` Kim F. Storm
2003-02-13 10:08 ` Richard Stallman
0 siblings, 1 reply; 43+ messages in thread
From: Kim F. Storm @ 2003-02-12 13:00 UTC (permalink / raw)
Cc: emacs-devel
Richard Stallman <rms@gnu.org> writes:
> > This might be a good idea if we combine it with the feature that it is
> > an error to put a digit or a symbol character or # after a character
> > constant with no space in between.
>
> There are several places where something like '(? ?...) or '(?\ ?...)
> is used, i.e. where no additional space separates the "? " character
> from the "?" of the next character.
>
> Looking closely, there is no overlap between these cases and the ones
> I said should be an error.
Ok. So I assume that you want ?XY to be invalid syntax
unless Y is <= 040 or one of " ' ; ( ) [ ] ? or #
--
Kim F. Storm http://www.cua.dk
^ permalink raw reply [flat|nested] 43+ messages in thread
* Re: ?\_ patch
2003-02-12 13:00 ` Kim F. Storm
@ 2003-02-13 10:08 ` Richard Stallman
2003-02-13 14:19 ` Kim F. Storm
0 siblings, 1 reply; 43+ messages in thread
From: Richard Stallman @ 2003-02-13 10:08 UTC (permalink / raw)
Cc: emacs-devel
Ok. So I assume that you want ?XY to be invalid syntax
unless Y is <= 040 or one of " ' ; ( ) [ ] ? or #
That is the idea. I can see how someone could have written (?a(b))
and think it legitimate, but a person could hardly argue that (?ab)
instead of (?a b) is legitimate.
It's possible there is some other syntax char I have forgotten
that should be legitimate there too. If you can think of one,
please add it.
^ permalink raw reply [flat|nested] 43+ messages in thread
* Re: ?\_ patch
2003-02-13 10:08 ` Richard Stallman
@ 2003-02-13 14:19 ` Kim F. Storm
0 siblings, 0 replies; 43+ messages in thread
From: Kim F. Storm @ 2003-02-13 14:19 UTC (permalink / raw)
Cc: emacs-devel
Richard Stallman <rms@gnu.org> writes:
> Ok. So I assume that you want ?XY to be invalid syntax
> unless Y is <= 040 or one of " ' ; ( ) [ ] ? or #
>
> That is the idea. I can see how someone could have written (?a(b))
> and think it legitimate, but a person could hardly argue that (?ab)
> instead of (?a b) is legitimate.
>
> It's possible there is some other syntax char I have forgotten
> that should be legitimate there too. If you can think of one,
> please add it.
I have installed the changes.
Edward O'Connor suggested to modify checkdoc to look for ?\ at the end
of lines and replace them with the new syntax. That's a good idea,
but I have not done this.
--
Kim F. Storm <storm@cua.dk> http://www.cua.dk
^ permalink raw reply [flat|nested] 43+ messages in thread
* Re: ?\_ patch
2003-02-06 0:44 ` Luc Teirlinck
2003-02-06 1:06 ` Luc Teirlinck
@ 2003-02-06 1:31 ` Kenichi Handa
2003-02-06 10:40 ` Andreas Schwab
1 sibling, 1 reply; 43+ messages in thread
From: Kenichi Handa @ 2003-02-06 1:31 UTC (permalink / raw)
Cc: emacs-devel
In article <200302060044.SAA21429@eel.dms.auburn.edu>, Luc Teirlinck <teirllm@dms.auburn.edu> writes:
> I now lean toward the original solution of using ?\s.
I've just found that (eq 's '\s) => t.
But, as (eq 'e '\e) is also t, this is not a problem,
perhaps.
> Alternatives like using 32, ?\040 or ?\x20 do not look attractive.
To me the last two are attractive because we only have to
change a manual to promote them instead of "? " or "?\ ". :-)
---
Ken'ichi HANDA
handa@m17n.org
^ permalink raw reply [flat|nested] 43+ messages in thread
* Re: ?\_ patch
2003-02-06 1:31 ` Kenichi Handa
@ 2003-02-06 10:40 ` Andreas Schwab
0 siblings, 0 replies; 43+ messages in thread
From: Andreas Schwab @ 2003-02-06 10:40 UTC (permalink / raw)
Cc: emacs-devel
Kenichi Handa <handa@m17n.org> writes:
|> In article <200302060044.SAA21429@eel.dms.auburn.edu>, Luc Teirlinck <teirllm@dms.auburn.edu> writes:
|> > I now lean toward the original solution of using ?\s.
|>
|> I've just found that (eq 's '\s) => t.
|>
|> But, as (eq 'e '\e) is also t, this is not a problem,
|> perhaps.
Symbols and characters have quite different quoting rules. In symbols,
the backslash is always ignored except to make it syntactically different
from a number.
Andreas.
--
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux AG, Deutschherrnstr. 15-19, D-90429 Nürnberg
Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"And now for something completely different."
^ permalink raw reply [flat|nested] 43+ messages in thread
end of thread, other threads:[~2003-02-13 14:19 UTC | newest]
Thread overview: 43+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
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
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.