unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* ?\_ 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

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 public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).