(Fwindow_list): Change parameter list to be XEmacs
[bpt/emacs.git] / src / intervals.c
index 2a03abb..1bacd10 100644 (file)
@@ -570,6 +570,8 @@ interval_start_pos (source)
   if (NULL_INTERVAL_P (source))
     return 0;
 
+  if (! INTERVAL_HAS_OBJECT (source))
+    return 0;
   GET_INTERVAL_OBJECT (parent, source);
   if (BUFFERP (parent))
     return BUF_BEG (XBUFFER (parent));
@@ -2159,14 +2161,18 @@ get_property_and_range (pos, prop, val, start, end, object)
   return 1;
 }
 \f
-/* Return the proper local map for position POSITION in BUFFER.
-   Use the map specified by the local-map property, if any.
+/* If TYPE is `keymap', return the map specified by the `keymap'
+   property at POSITION in BUFFER or nil.
+
+   Otherwise return the proper local map for position POSITION in
+   BUFFER.  Use the map specified by the local-map property, if any.
    Otherwise, use BUFFER's local map.  */
 
 Lisp_Object
-get_local_map (position, buffer)
+get_local_map (position, buffer, type)
      register int position;
      register struct buffer *buffer;
+     enum map_property type;
 {
   Lisp_Object prop, tem, lispy_position, lispy_buffer;
   int old_begv, old_zv, old_begv_byte, old_zv_byte;
@@ -2192,7 +2198,9 @@ get_local_map (position, buffer)
     --position;
   XSETFASTINT (lispy_position, position);
   XSETBUFFER (lispy_buffer, buffer);
-  prop = Fget_char_property (lispy_position, Qlocal_map, lispy_buffer);
+  prop = Fget_char_property (lispy_position,
+                            type == keymap ? Qkeymap : Qlocal_map,
+                            lispy_buffer);
 
   BUF_BEGV (buffer) = old_begv;
   BUF_ZV (buffer) = old_zv;
@@ -2200,14 +2208,14 @@ get_local_map (position, buffer)
   BUF_ZV_BYTE (buffer) = old_zv_byte;
 
   /* Use the local map only if it is valid.  */
-  /* Do allow symbols that are defined as keymaps.  */
-  if (SYMBOLP (prop) && !NILP (prop))
-    prop = indirect_function (prop);
-  if (!NILP (prop)
-      && (tem = Fkeymapp (prop), !NILP (tem)))
+  prop = get_keymap (prop, 0, 0);
+  if (CONSP (prop))
     return prop;
 
-  return buffer->keymap;
+  if (type == keymap)
+    return Qnil;
+  else
+    return buffer->keymap;
 }
 \f
 /* Produce an interval tree reflecting the intervals in