comparison src/callint.c @ 43039:531bd3a9e67a

(check_mark): New arg to specify clearer error message. Callers changed.
author Richard M. Stallman <rms@gnu.org>
date Fri, 01 Feb 2002 04:32:24 +0000
parents 81176c96cc2f
children 0ed69545b5f3
comparison
equal deleted inserted replaced
43038:45598283ce0d 43039:531bd3a9e67a
158 158
159 char *callint_argfuns[] 159 char *callint_argfuns[]
160 = {"", "point", "mark", "region-beginning", "region-end"}; 160 = {"", "point", "mark", "region-beginning", "region-end"};
161 161
162 static void 162 static void
163 check_mark () 163 check_mark (for_region)
164 int for_region;
164 { 165 {
165 Lisp_Object tem; 166 Lisp_Object tem;
166 tem = Fmarker_buffer (current_buffer->mark); 167 tem = Fmarker_buffer (current_buffer->mark);
167 if (NILP (tem) || (XBUFFER (tem) != current_buffer)) 168 if (NILP (tem) || (XBUFFER (tem) != current_buffer))
168 error ("The mark is not set now"); 169 error (for_region ? "The mark is not set now, so there is no region"
170 : "The mark is not set now");
169 if (!NILP (Vtransient_mark_mode) && NILP (Vmark_even_if_inactive) 171 if (!NILP (Vtransient_mark_mode) && NILP (Vmark_even_if_inactive)
170 && NILP (current_buffer->mark_active)) 172 && NILP (current_buffer->mark_active))
171 Fsignal (Qmark_inactive, Qnil); 173 Fsignal (Qmark_inactive, Qnil);
172 } 174 }
173 175
607 next_event++; 609 next_event++;
608 610
609 break; 611 break;
610 612
611 case 'm': /* Value of mark. Does not do I/O. */ 613 case 'm': /* Value of mark. Does not do I/O. */
612 check_mark (); 614 check_mark (0);
613 /* visargs[i] = Qnil; */ 615 /* visargs[i] = Qnil; */
614 args[i] = current_buffer->mark; 616 args[i] = current_buffer->mark;
615 varies[i] = 2; 617 varies[i] = 2;
616 break; 618 break;
617 619
662 /* visargs[i] = Qnil; */ 664 /* visargs[i] = Qnil; */
663 varies[i] = -1; 665 varies[i] = -1;
664 break; 666 break;
665 667
666 case 'r': /* Region, point and mark as 2 args. */ 668 case 'r': /* Region, point and mark as 2 args. */
667 check_mark (); 669 check_mark (1);
668 set_marker_both (point_marker, Qnil, PT, PT_BYTE); 670 set_marker_both (point_marker, Qnil, PT, PT_BYTE);
669 /* visargs[i+1] = Qnil; */ 671 /* visargs[i+1] = Qnil; */
670 foo = marker_position (current_buffer->mark); 672 foo = marker_position (current_buffer->mark);
671 /* visargs[i] = Qnil; */ 673 /* visargs[i] = Qnil; */
672 args[i] = PT < foo ? point_marker : current_buffer->mark; 674 args[i] = PT < foo ? point_marker : current_buffer->mark;