Mercurial > hg > xemacs-beta
comparison src/cmds.c @ 265:8efd647ea9ca r20-5b31
Import from CVS: tag r20-5b31
author | cvs |
---|---|
date | Mon, 13 Aug 2007 10:25:37 +0200 |
parents | 0e522484dd2a |
children | c5d627a313b1 |
comparison
equal
deleted
inserted
replaced
264:682d2a9d41a5 | 265:8efd647ea9ca |
---|---|
39 /* Non-nil means put this face on the next self-inserting character. */ | 39 /* Non-nil means put this face on the next self-inserting character. */ |
40 Lisp_Object Vself_insert_face; | 40 Lisp_Object Vself_insert_face; |
41 | 41 |
42 /* This is the command that set up Vself_insert_face. */ | 42 /* This is the command that set up Vself_insert_face. */ |
43 Lisp_Object Vself_insert_face_command; | 43 Lisp_Object Vself_insert_face_command; |
44 | |
45 /* t means beep when movement would take point past (point-min) or */ | |
46 /* (point-max) */ | |
47 int signal_error_on_buffer_boundary; | |
48 | 44 |
49 DEFUN ("forward-char", Fforward_char, 0, 2, "_p", /* | 45 DEFUN ("forward-char", Fforward_char, 0, 2, "_p", /* |
50 Move point right ARG characters (left if ARG negative). | 46 Move point right ARG characters (left if ARG negative). |
47 On attempt to pass end of buffer, stop and signal `end-of-buffer'. | |
48 On attempt to pass beginning of buffer, stop and signal `beginning-of-buffer'. | |
51 On reaching end of buffer, stop and signal error. | 49 On reaching end of buffer, stop and signal error. |
52 Error signaling is suppressed if `signal-error-on-buffer-boundary' | |
53 is nil. If BUFFER is nil, the current buffer is assumed. | |
54 */ | 50 */ |
55 (arg, buffer)) | 51 (arg, buffer)) |
56 { | 52 { |
57 struct buffer *buf = decode_buffer (buffer, 1); | 53 struct buffer *buf = decode_buffer (buffer, 1); |
58 | 54 |
70 Bufpos new_point = BUF_PT (buf) + XINT (arg); | 66 Bufpos new_point = BUF_PT (buf) + XINT (arg); |
71 | 67 |
72 if (new_point < BUF_BEGV (buf)) | 68 if (new_point < BUF_BEGV (buf)) |
73 { | 69 { |
74 BUF_SET_PT (buf, BUF_BEGV (buf)); | 70 BUF_SET_PT (buf, BUF_BEGV (buf)); |
75 if (signal_error_on_buffer_boundary) | 71 Fsignal (Qbeginning_of_buffer, Qnil); |
76 Fsignal (Qbeginning_of_buffer, Qnil); | 72 return Qnil; |
77 else | |
78 return Qnil; | |
79 } | 73 } |
80 if (new_point > BUF_ZV (buf)) | 74 if (new_point > BUF_ZV (buf)) |
81 { | 75 { |
82 BUF_SET_PT (buf, BUF_ZV (buf)); | 76 BUF_SET_PT (buf, BUF_ZV (buf)); |
83 if (signal_error_on_buffer_boundary) | 77 Fsignal (Qend_of_buffer, Qnil); |
84 Fsignal (Qend_of_buffer, Qnil); | 78 return Qnil; |
85 else | |
86 return Qnil; | |
87 } | 79 } |
88 | 80 |
89 BUF_SET_PT (buf, new_point); | 81 BUF_SET_PT (buf, new_point); |
90 } | 82 } |
91 | 83 |
92 return Qnil; | 84 return Qnil; |
93 } | 85 } |
94 | 86 |
95 DEFUN ("backward-char", Fbackward_char, 0, 2, "_p", /* | 87 DEFUN ("backward-char", Fbackward_char, 0, 2, "_p", /* |
96 Move point left ARG characters (right if ARG negative). | 88 Move point left ARG characters (right if ARG negative). |
97 On attempt to pass beginning or end of buffer, stop and signal error. | 89 On attempt to pass end of buffer, stop and signal `end-of-buffer'. |
98 Error signaling is suppressed if `signal-error-on-buffer-boundary' | 90 On attempt to pass beginning of buffer, stop and signal `beginning-of-buffer'. |
99 is nil. If BUFFER is nil, the current buffer is assumed. | |
100 */ | 91 */ |
101 (arg, buffer)) | 92 (arg, buffer)) |
102 { | 93 { |
103 if (NILP (arg)) | 94 if (NILP (arg)) |
104 arg = make_int (1); | 95 arg = make_int (1); |
508 DEFVAR_LISP ("blink-paren-function", &Vblink_paren_function /* | 499 DEFVAR_LISP ("blink-paren-function", &Vblink_paren_function /* |
509 Function called, if non-nil, whenever a close parenthesis is inserted. | 500 Function called, if non-nil, whenever a close parenthesis is inserted. |
510 More precisely, a char with closeparen syntax is self-inserted. | 501 More precisely, a char with closeparen syntax is self-inserted. |
511 */ ); | 502 */ ); |
512 Vblink_paren_function = Qnil; | 503 Vblink_paren_function = Qnil; |
513 | 504 } |
514 DEFVAR_BOOL ("signal-error-on-buffer-boundary", &signal_error_on_buffer_boundary /* | |
515 *t means beep when movement would take point past (point-min) or | |
516 \(point-max). | |
517 */ ); | |
518 signal_error_on_buffer_boundary = 1; | |
519 } |