]> code.delx.au - gnu-emacs/blobdiff - src/cmds.c
Minor fix in right-char and left-char, per Stefan's comments.
[gnu-emacs] / src / cmds.c
index c06a9edd1607f5a82b08d5aaaa789596afd4cda5..3ebad50184a06b49026131338c3e630476dd8355 100644 (file)
@@ -1,6 +1,6 @@
 /* Simple built-in editing commands.
 
 /* Simple built-in editing commands.
 
-Copyright (C) 1985, 1993-1998, 2001-201 Free Software Foundation, Inc.
+Copyright (C) 1985, 1993-1998, 2001-2013 Free Software Foundation, Inc.
 
 This file is part of GNU Emacs.
 
 
 This file is part of GNU Emacs.
 
@@ -19,7 +19,7 @@ along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.  */
 
 
 #include <config.h>
 
 
 #include <config.h>
-#include <setjmp.h>
+
 #include "lisp.h"
 #include "commands.h"
 #include "character.h"
 #include "lisp.h"
 #include "commands.h"
 #include "character.h"
@@ -47,10 +47,10 @@ DEFUN ("forward-point", Fforward_point, Sforward_point, 1, 1, 0,
   return make_number (PT + XINT (n));
 }
 
   return make_number (PT + XINT (n));
 }
 
-/* Add N to point; or subtract N if FORWARD is zero.  N defaults to 1.
+/* Add N to point; or subtract N if FORWARD is false.  N defaults to 1.
    Validate the new location.  Return nil.  */
 static Lisp_Object
    Validate the new location.  Return nil.  */
 static Lisp_Object
-move_point (Lisp_Object n, int forward)
+move_point (Lisp_Object n, bool forward)
 {
   /* This used to just set point to point + XINT (n), and then check
      to see if it was within boundaries.  But now that SET_PT can
 {
   /* This used to just set point to point + XINT (n), and then check
      to see if it was within boundaries.  But now that SET_PT can
@@ -85,6 +85,7 @@ move_point (Lisp_Object n, int forward)
 DEFUN ("forward-char", Fforward_char, Sforward_char, 0, 1, "^p",
        doc: /* Move point N characters forward (backward if N is negative).
 On reaching end or beginning of buffer, stop and signal error.
 DEFUN ("forward-char", Fforward_char, Sforward_char, 0, 1, "^p",
        doc: /* Move point N characters forward (backward if N is negative).
 On reaching end or beginning of buffer, stop and signal error.
+Interactively, N is the numeric prefix argument.
 
 Depending on the bidirectional context, the movement may be to the
 right or to the left on the screen.  This is in contrast with
 
 Depending on the bidirectional context, the movement may be to the
 right or to the left on the screen.  This is in contrast with
@@ -97,6 +98,7 @@ right or to the left on the screen.  This is in contrast with
 DEFUN ("backward-char", Fbackward_char, Sbackward_char, 0, 1, "^p",
        doc: /* Move point N characters backward (forward if N is negative).
 On attempt to pass beginning or end of buffer, stop and signal error.
 DEFUN ("backward-char", Fbackward_char, Sbackward_char, 0, 1, "^p",
        doc: /* Move point N characters backward (forward if N is negative).
 On attempt to pass beginning or end of buffer, stop and signal error.
+Interactively, N is the numeric prefix argument.
 
 Depending on the bidirectional context, the movement may be to the
 right or to the left on the screen.  This is in contrast with
 
 Depending on the bidirectional context, the movement may be to the
 right or to the left on the screen.  This is in contrast with
@@ -277,7 +279,7 @@ After insertion, the value of `auto-fill-function' is called if the
 At the end, it runs `post-self-insert-hook'.  */)
   (Lisp_Object n)
 {
 At the end, it runs `post-self-insert-hook'.  */)
   (Lisp_Object n)
 {
-  int remove_boundary = 1;
+  bool remove_boundary = 1;
   CHECK_NATNUM (n);
 
   if (!EQ (Vthis_command, KVAR (current_kboard, Vlast_command)))
   CHECK_NATNUM (n);
 
   if (!EQ (Vthis_command, KVAR (current_kboard, Vlast_command)))
@@ -301,7 +303,7 @@ At the end, it runs `post-self-insert-hook'.  */)
         added be explicit calls to undo-boundary.  */
       && EQ (BVAR (current_buffer, undo_list), last_undo_boundary))
     /* Remove the undo_boundary that was just pushed.  */
         added be explicit calls to undo-boundary.  */
       && EQ (BVAR (current_buffer, undo_list), last_undo_boundary))
     /* Remove the undo_boundary that was just pushed.  */
-    BVAR (current_buffer, undo_list) = XCDR (BVAR (current_buffer, undo_list));
+    bset_undo_list (current_buffer, XCDR (BVAR (current_buffer, undo_list)));
 
   /* Barf if the key that invoked this was not a character.  */
   if (!CHARACTERP (last_command_event))
 
   /* Barf if the key that invoked this was not a character.  */
   if (!CHARACTERP (last_command_event))
@@ -438,7 +440,7 @@ internal_self_insert (int c, EMACS_INT n)
                  : UNIBYTE_TO_CHAR (XFASTINT (Fprevious_char ())))
          == Sword))
     {
                  : UNIBYTE_TO_CHAR (XFASTINT (Fprevious_char ())))
          == Sword))
     {
-      int modiff = MODIFF;
+      EMACS_INT modiff = MODIFF;
       Lisp_Object sym;
 
       sym = call0 (Qexpand_abbrev);
       Lisp_Object sym;
 
       sym = call0 (Qexpand_abbrev);