(RUI6-E0AF): New character.
[chise/xemacs-chise.git.1] / src / cmds.c
index 82e7568..ec8d39e 100644 (file)
@@ -1,5 +1,6 @@
 /* Simple built-in editing commands.
    Copyright (C) 1985, 1992, 1993, 1994, 1995 Free Software Foundation, Inc.
 /* Simple built-in editing commands.
    Copyright (C) 1985, 1992, 1993, 1994, 1995 Free Software Foundation, Inc.
+   Copyright (C) 2001 MORIOKA Tomohiko
 
 This file is part of XEmacs.
 
 
 This file is part of XEmacs.
 
@@ -50,6 +51,11 @@ Move point right COUNT characters (left if COUNT is negative).
 On attempt to pass end of buffer, stop and signal `end-of-buffer'.
 On attempt to pass beginning of buffer, stop and signal `beginning-of-buffer'.
 On reaching end of buffer, stop and signal error.
 On attempt to pass end of buffer, stop and signal `end-of-buffer'.
 On attempt to pass beginning of buffer, stop and signal `beginning-of-buffer'.
 On reaching end of buffer, stop and signal error.
+
+The characters that are moved over may be added to the current selection
+\(i.e. active region) if the Shift key is held down, a motion key is used
+to invoke this command, and `shifted-motion-keys-select-region' is t; see
+the documentation for this variable for more details.
 */
        (count, buffer))
 {
 */
        (count, buffer))
 {
@@ -95,6 +101,11 @@ DEFUN ("backward-char", Fbackward_char, 0, 2, "_p", /*
 Move point left COUNT characters (right if COUNT is negative).
 On attempt to pass end of buffer, stop and signal `end-of-buffer'.
 On attempt to pass beginning of buffer, stop and signal `beginning-of-buffer'.
 Move point left COUNT characters (right if COUNT is negative).
 On attempt to pass end of buffer, stop and signal `end-of-buffer'.
 On attempt to pass beginning of buffer, stop and signal `beginning-of-buffer'.
+
+The characters that are moved over may be added to the current selection
+\(i.e. active region) if the Shift key is held down, a motion key is used
+to invoke this command, and `shifted-motion-keys-select-region' is t; see
+the documentation for this variable for more details.
 */
        (count, buffer))
 {
 */
        (count, buffer))
 {
@@ -117,6 +128,11 @@ that is COUNT - number of lines moved; if backward, COUNT + number moved.
 With positive COUNT, a non-empty line at the end counts as one line
   successfully moved (for the return value).
 If BUFFER is nil, the current buffer is assumed.
 With positive COUNT, a non-empty line at the end counts as one line
   successfully moved (for the return value).
 If BUFFER is nil, the current buffer is assumed.
+
+The characters that are moved over may be added to the current selection
+\(i.e. active region) if the Shift key is held down, a motion key is used
+to invoke this command, and `shifted-motion-keys-select-region' is t; see
+the documentation for this variable for more details.
 */
        (count, buffer))
 {
 */
        (count, buffer))
 {
@@ -178,6 +194,11 @@ Move point to beginning of current line.
 With argument COUNT not nil or 1, move forward COUNT - 1 lines first.
 If scan reaches end of buffer, stop there without error.
 If BUFFER is nil, the current buffer is assumed.
 With argument COUNT not nil or 1, move forward COUNT - 1 lines first.
 If scan reaches end of buffer, stop there without error.
 If BUFFER is nil, the current buffer is assumed.
+
+The characters that are moved over may be added to the current selection
+\(i.e. active region) if the Shift key is held down, a motion key is used
+to invoke this command, and `shifted-motion-keys-select-region' is t; see
+the documentation for this variable for more details.
 */
        (count, buffer))
 {
 */
        (count, buffer))
 {
@@ -196,7 +217,7 @@ This function does not move point.
        (count, buffer))
 {
   struct buffer *buf = decode_buffer (buffer, 1);
        (count, buffer))
 {
   struct buffer *buf = decode_buffer (buffer, 1);
-  int n;
+  EMACS_INT n;
 
   if (NILP (count))
     n = 1;
 
   if (NILP (count))
     n = 1;
@@ -215,6 +236,11 @@ Move point to end of current line.
 With argument COUNT not nil or 1, move forward COUNT - 1 lines first.
 If scan reaches end of buffer, stop there without error.
 If BUFFER is nil, the current buffer is assumed.
 With argument COUNT not nil or 1, move forward COUNT - 1 lines first.
 If scan reaches end of buffer, stop there without error.
 If BUFFER is nil, the current buffer is assumed.
+
+The characters that are moved over may be added to the current selection
+\(i.e. active region) if the Shift key is held down, a motion key is used
+to invoke this command, and `shifted-motion-keys-select-region' is t; see
+the documentation for this variable for more details.
 */
        (count, buffer))
 {
 */
        (count, buffer))
 {
@@ -224,7 +250,7 @@ If BUFFER is nil, the current buffer is assumed.
   return Qnil;
 }
 
   return Qnil;
 }
 
-DEFUN ("delete-char", Fdelete_char, 1, 2, "*p\nP", /*
+DEFUN ("delete-char", Fdelete_char, 0, 2, "*p\nP", /*
 Delete the following COUNT characters (previous, with negative COUNT).
 Optional second arg KILLP non-nil means kill instead (save in kill ring).
 Interactively, COUNT is the prefix arg, and KILLP is set if
 Delete the following COUNT characters (previous, with negative COUNT).
 Optional second arg KILLP non-nil means kill instead (save in kill ring).
 Interactively, COUNT is the prefix arg, and KILLP is set if
@@ -235,10 +261,15 @@ COUNT was explicitly specified.
   /* This function can GC */
   Bufpos pos;
   struct buffer *buf = current_buffer;
   /* This function can GC */
   Bufpos pos;
   struct buffer *buf = current_buffer;
-  int n;
+  EMACS_INT n;
 
 
-  CHECK_INT (count);
-  n = XINT (count);
+  if (NILP (count))
+    n = 1;
+  else
+    {
+      CHECK_INT (count);
+      n = XINT (count);
+    }
 
   pos = BUF_PT (buf) + n;
   if (NILP (killp))
 
   pos = BUF_PT (buf) + n;
   if (NILP (killp))
@@ -265,7 +296,7 @@ COUNT was explicitly specified.
   return Qnil;
 }
 
   return Qnil;
 }
 
-DEFUN ("delete-backward-char", Fdelete_backward_char, 1, 2, "*p\nP", /*
+DEFUN ("delete-backward-char", Fdelete_backward_char, 0, 2, "*p\nP", /*
 Delete the previous COUNT characters (following, with negative COUNT).
 Optional second arg KILLP non-nil means kill instead (save in kill ring).
 Interactively, COUNT is the prefix arg, and KILLP is set if
 Delete the previous COUNT characters (following, with negative COUNT).
 Optional second arg KILLP non-nil means kill instead (save in kill ring).
 Interactively, COUNT is the prefix arg, and KILLP is set if
@@ -274,8 +305,17 @@ COUNT was explicitly specified.
        (count, killp))
 {
   /* This function can GC */
        (count, killp))
 {
   /* This function can GC */
-  CHECK_INT (count);
-  return Fdelete_char (make_int (- XINT (count)), killp);
+  EMACS_INT n;
+
+  if (NILP (count))
+    n = 1;
+  else
+    {
+      CHECK_INT (count);
+      n = XINT (count);
+    }
+
+  return Fdelete_char (make_int (- n), killp);
 }
 
 static void internal_self_insert (Emchar ch, int noautofill);
 }
 
 static void internal_self_insert (Emchar ch, int noautofill);
@@ -290,7 +330,7 @@ If a prefix arg COUNT is specified, the character is inserted COUNT times.
   /* This function can GC */
   Emchar ch;
   Lisp_Object c;
   /* This function can GC */
   Emchar ch;
   Lisp_Object c;
-  int n;
+  EMACS_INT n;
 
   CHECK_NATNUM (count);
   n = XINT (count);
 
   CHECK_NATNUM (count);
   n = XINT (count);
@@ -336,7 +376,11 @@ internal_self_insert (Emchar c1, int noautofill)
   int tab_width;
 
   overwrite = buf->overwrite_mode;
   int tab_width;
 
   overwrite = buf->overwrite_mode;
+#ifdef UTF2000
+  syntax_table = XCHAR_TABLE (buf->syntax_table);
+#else
   syntax_table = XCHAR_TABLE (buf->mirror_syntax_table);
   syntax_table = XCHAR_TABLE (buf->mirror_syntax_table);
+#endif
 
 #if 0
   /* No, this is very bad, it makes undo *always* undo a character at a time
 
 #if 0
   /* No, this is very bad, it makes undo *always* undo a character at a time
@@ -510,6 +554,11 @@ A char-table for characters which invoke auto-filling.
 Such characters have value t in this table.
 */);
   Vauto_fill_chars = Fmake_char_table (Qgeneric);
 Such characters have value t in this table.
 */);
   Vauto_fill_chars = Fmake_char_table (Qgeneric);
+#ifdef UTF2000
+  put_char_id_table_0 (XCHAR_TABLE (Vauto_fill_chars), ' ', Qt);
+  put_char_id_table_0 (XCHAR_TABLE (Vauto_fill_chars), '\n', Qt);
+#else
   XCHAR_TABLE (Vauto_fill_chars)->ascii[' '] = Qt;
   XCHAR_TABLE (Vauto_fill_chars)->ascii['\n'] = Qt;
   XCHAR_TABLE (Vauto_fill_chars)->ascii[' '] = Qt;
   XCHAR_TABLE (Vauto_fill_chars)->ascii['\n'] = Qt;
+#endif
 }
 }