aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDave Love2000-05-29 11:41:13 +0000
committerDave Love2000-05-29 11:41:13 +0000
commit6a7dccef4a8a69d12ee6a4561906644d662bd8f0 (patch)
treeec39129d2e56c70f854f393c3714f4ad56ea5258 /src
parentb332a42260f88164071ee6a99b5276e2df5fd339 (diff)
downloademacs-6a7dccef4a8a69d12ee6a4561906644d662bd8f0.tar.gz
emacs-6a7dccef4a8a69d12ee6a4561906644d662bd8f0.zip
(get_local_map): Extra arg to allow looking for `keymap' too.
Diffstat (limited to 'src')
-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)
2161 return 1; 2161 return 1;
2162} 2162}
2163 2163
2164/* Return the proper local map for position POSITION in BUFFER. 2164/* If TYPE is `keymap', return the map specified by the `keymap'
2165 Use the map specified by the local-map property, if any. 2165 property at POSITION in BUFFER or nil.
2166
2167 Otherwise return the proper local map for position POSITION in
2168 BUFFER. Use the map specified by the local-map property, if any.
2166 Otherwise, use BUFFER's local map. */ 2169 Otherwise, use BUFFER's local map. */
2167 2170
2168Lisp_Object 2171Lisp_Object
2169get_local_map (position, buffer) 2172get_local_map (position, buffer, type)
2170 register int position; 2173 register int position;
2171 register struct buffer *buffer; 2174 register struct buffer *buffer;
2175 enum map_property type;
2172{ 2176{
2173 Lisp_Object prop, tem, lispy_position, lispy_buffer; 2177 Lisp_Object prop, tem, lispy_position, lispy_buffer;
2174 int old_begv, old_zv, old_begv_byte, old_zv_byte; 2178 int old_begv, old_zv, old_begv_byte, old_zv_byte;
@@ -2194,7 +2198,9 @@ get_local_map (position, buffer)
2194 --position; 2198 --position;
2195 XSETFASTINT (lispy_position, position); 2199 XSETFASTINT (lispy_position, position);
2196 XSETBUFFER (lispy_buffer, buffer); 2200 XSETBUFFER (lispy_buffer, buffer);
2197 prop = Fget_char_property (lispy_position, Qlocal_map, lispy_buffer); 2201 prop = Fget_char_property (lispy_position,
2202 type == keymap ? Qkeymap : Qlocal_map,
2203 lispy_buffer);
2198 2204
2199 BUF_BEGV (buffer) = old_begv; 2205 BUF_BEGV (buffer) = old_begv;
2200 BUF_ZV (buffer) = old_zv; 2206 BUF_ZV (buffer) = old_zv;
@@ -2209,7 +2215,10 @@ get_local_map (position, buffer)
2209 && (tem = Fkeymapp (prop), !NILP (tem))) 2215 && (tem = Fkeymapp (prop), !NILP (tem)))
2210 return prop; 2216 return prop;
2211 2217
2212 return buffer->keymap; 2218 if (type == keymap)
2219 return Qnil;
2220 else
2221 return buffer->keymap;
2213} 2222}
2214 2223
2215/* Produce an interval tree reflecting the intervals in 2224/* Produce an interval tree reflecting the intervals in