Mercurial > hg > xemacs-beta
comparison src/cmds.c @ 98:0d2f883870bc r20-1b1
Import from CVS: tag r20-1b1
author | cvs |
---|---|
date | Mon, 13 Aug 2007 09:13:56 +0200 |
parents | 54cc21c15cbb |
children | 1856695b1fa9 |
comparison
equal
deleted
inserted
replaced
97:498bf5da1c90 | 98:0d2f883870bc |
---|---|
39 Lisp_Object Vself_insert_face; | 39 Lisp_Object Vself_insert_face; |
40 | 40 |
41 /* This is the command that set up Vself_insert_face. */ | 41 /* This is the command that set up Vself_insert_face. */ |
42 Lisp_Object Vself_insert_face_command; | 42 Lisp_Object Vself_insert_face_command; |
43 | 43 |
44 /* t means beep when movement would take point past (point-min) or */ | |
45 /* (point-max) */ | |
46 int signal_error_on_buffer_boundary; | |
44 | 47 |
45 DEFUN ("forward-char", Fforward_char, 0, 2, "_p", /* | 48 DEFUN ("forward-char", Fforward_char, 0, 2, "_p", /* |
46 Move point right ARG characters (left if ARG negative). | 49 Move point right ARG characters (left if ARG negative). |
47 On reaching end of buffer, stop and signal error. | 50 On reaching end of buffer, stop and signal error. |
48 If BUFFER is nil, the current buffer is assumed. | 51 Error signaling is suppressed if `signal-error-on-buffer-boundary' |
52 is nil. If BUFFER is nil, the current buffer is assumed. | |
49 */ | 53 */ |
50 (arg, buffer)) | 54 (arg, buffer)) |
51 { | 55 { |
52 struct buffer *buf = decode_buffer (buffer, 1); | 56 struct buffer *buf = decode_buffer (buffer, 1); |
53 | 57 |
65 Bufpos new_point = BUF_PT (buf) + XINT (arg); | 69 Bufpos new_point = BUF_PT (buf) + XINT (arg); |
66 | 70 |
67 if (new_point < BUF_BEGV (buf)) | 71 if (new_point < BUF_BEGV (buf)) |
68 { | 72 { |
69 BUF_SET_PT (buf, BUF_BEGV (buf)); | 73 BUF_SET_PT (buf, BUF_BEGV (buf)); |
70 Fsignal (Qbeginning_of_buffer, Qnil); | 74 if (signal_error_on_buffer_boundary) |
75 Fsignal (Qbeginning_of_buffer, Qnil); | |
76 else | |
77 return Qnil; | |
71 } | 78 } |
72 if (new_point > BUF_ZV (buf)) | 79 if (new_point > BUF_ZV (buf)) |
73 { | 80 { |
74 BUF_SET_PT (buf, BUF_ZV (buf)); | 81 BUF_SET_PT (buf, BUF_ZV (buf)); |
75 Fsignal (Qend_of_buffer, Qnil); | 82 if (signal_error_on_buffer_boundary) |
83 Fsignal (Qend_of_buffer, Qnil); | |
84 else | |
85 return Qnil; | |
76 } | 86 } |
77 | 87 |
78 BUF_SET_PT (buf, new_point); | 88 BUF_SET_PT (buf, new_point); |
79 } | 89 } |
80 | 90 |
82 } | 92 } |
83 | 93 |
84 DEFUN ("backward-char", Fbackward_char, 0, 2, "_p", /* | 94 DEFUN ("backward-char", Fbackward_char, 0, 2, "_p", /* |
85 Move point left ARG characters (right if ARG negative). | 95 Move point left ARG characters (right if ARG negative). |
86 On attempt to pass beginning or end of buffer, stop and signal error. | 96 On attempt to pass beginning or end of buffer, stop and signal error. |
87 If BUFFER is nil, the current buffer is assumed. | 97 Error signaling is suppressed if `signal-error-on-buffer-boundary' |
98 is nil. If BUFFER is nil, the current buffer is assumed. | |
88 */ | 99 */ |
89 (arg, buffer)) | 100 (arg, buffer)) |
90 { | 101 { |
91 if (NILP (arg)) | 102 if (NILP (arg)) |
92 arg = make_int (1); | 103 arg = make_int (1); |
477 DEFVAR_LISP ("blink-paren-function", &Vblink_paren_function /* | 488 DEFVAR_LISP ("blink-paren-function", &Vblink_paren_function /* |
478 Function called, if non-nil, whenever a close parenthesis is inserted. | 489 Function called, if non-nil, whenever a close parenthesis is inserted. |
479 More precisely, a char with closeparen syntax is self-inserted. | 490 More precisely, a char with closeparen syntax is self-inserted. |
480 */ ); | 491 */ ); |
481 Vblink_paren_function = Qnil; | 492 Vblink_paren_function = Qnil; |
482 } | 493 |
494 DEFVAR_BOOL ("signal-error-on-buffer-boundary", &signal_error_on_buffer_boundary /* | |
495 t means beep when movement would take point past (point-min) or | |
496 \(point-max). | |
497 */ ); | |
498 signal_error_on_buffer_boundary = 1; | |
499 } |