comparison src/intervals.c @ 70655:089c7a7af5c9

(get_local_map): Abort if POSITION outside BEGV, ZV.
author Richard M. Stallman <rms@gnu.org>
date Sun, 14 May 2006 21:53:45 +0000
parents f5917c21d187
children 8b271981e0c5 a5812696f7bf
comparison
equal deleted inserted replaced
70654:a08c78ccc9af 70655:089c7a7af5c9
2339 } 2339 }
2340 2340
2341 /* Return the proper local keymap TYPE for position POSITION in 2341 /* Return the proper local keymap TYPE for position POSITION in
2342 BUFFER; TYPE should be one of `keymap' or `local-map'. Use the map 2342 BUFFER; TYPE should be one of `keymap' or `local-map'. Use the map
2343 specified by the PROP property, if any. Otherwise, if TYPE is 2343 specified by the PROP property, if any. Otherwise, if TYPE is
2344 `local-map' use BUFFER's local map. */ 2344 `local-map' use BUFFER's local map.
2345
2346 POSITION must be in the accessible part of BUFFER. */
2345 2347
2346 Lisp_Object 2348 Lisp_Object
2347 get_local_map (position, buffer, type) 2349 get_local_map (position, buffer, type)
2348 register int position; 2350 register int position;
2349 register struct buffer *buffer; 2351 register struct buffer *buffer;
2351 { 2353 {
2352 Lisp_Object prop, lispy_position, lispy_buffer; 2354 Lisp_Object prop, lispy_position, lispy_buffer;
2353 int old_begv, old_zv, old_begv_byte, old_zv_byte; 2355 int old_begv, old_zv, old_begv_byte, old_zv_byte;
2354 2356
2355 /* Perhaps we should just change `position' to the limit. */ 2357 /* Perhaps we should just change `position' to the limit. */
2356 if (position > BUF_Z (buffer) || position < BUF_BEG (buffer)) 2358 if (position > BUF_ZV (buffer) || position < BUF_BEGV (buffer))
2357 abort (); 2359 abort ();
2358 2360
2359 /* Ignore narrowing, so that a local map continues to be valid even if 2361 /* Ignore narrowing, so that a local map continues to be valid even if
2360 the visible region contains no characters and hence no properties. */ 2362 the visible region contains no characters and hence no properties. */
2361 old_begv = BUF_BEGV (buffer); 2363 old_begv = BUF_BEGV (buffer);