summaryrefslogtreecommitdiff
path: root/src/intervals.c
diff options
context:
space:
mode:
authorDave Love <fx@gnu.org>2000-05-29 11:41:13 +0000
committerDave Love <fx@gnu.org>2000-05-29 11:41:13 +0000
commit6a7dccef4a8a69d12ee6a4561906644d662bd8f0 (patch)
treeec39129d2e56c70f854f393c3714f4ad56ea5258 /src/intervals.c
parentb332a42260f88164071ee6a99b5276e2df5fd339 (diff)
downloademacs-6a7dccef4a8a69d12ee6a4561906644d662bd8f0.tar.gz
(get_local_map): Extra arg to allow looking for `keymap' too.
Diffstat (limited to 'src/intervals.c')
-rw-r--r--src/intervals.c19
1 files changed, 14 insertions, 5 deletions
diff --git a/src/intervals.c b/src/intervals.c
index f925d222db2..2b1b08219d4 100644
--- a/src/intervals.c
+++ b/src/intervals.c
@@ -2161,14 +2161,18 @@ get_property_and_range (pos, prop, val, start, end, object)
return 1;
}
-/* 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;
@@ -2194,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;
@@ -2209,7 +2215,10 @@ get_local_map (position, buffer)
&& (tem = Fkeymapp (prop), !NILP (tem)))
return prop;
- return buffer->keymap;
+ if (type == keymap)
+ return Qnil;
+ else
+ return buffer->keymap;
}
/* Produce an interval tree reflecting the intervals in