diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/keymap.c | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/src/keymap.c b/src/keymap.c index 720eb5c32a4..634c4e33bbd 100644 --- a/src/keymap.c +++ b/src/keymap.c | |||
| @@ -1740,17 +1740,27 @@ like in the respective argument of `key-binding'. */) | |||
| 1740 | if (CONSP (string) && STRINGP (XCAR (string))) | 1740 | if (CONSP (string) && STRINGP (XCAR (string))) |
| 1741 | { | 1741 | { |
| 1742 | Lisp_Object pos = XCDR (string); | 1742 | Lisp_Object pos = XCDR (string); |
| 1743 | Lisp_Object pos_area = POSN_POSN (position); | ||
| 1743 | string = XCAR (string); | 1744 | string = XCAR (string); |
| 1744 | if (FIXNUMP (pos) | 1745 | if (FIXNUMP (pos) |
| 1745 | && XFIXNUM (pos) >= 0 | 1746 | && XFIXNUM (pos) >= 0 |
| 1746 | && XFIXNUM (pos) < SCHARS (string)) | 1747 | && XFIXNUM (pos) < SCHARS (string)) |
| 1747 | { | 1748 | { |
| 1748 | Lisp_Object map = Fget_text_property (pos, Qlocal_map, string); | 1749 | Lisp_Object map = Fget_text_property (pos, Qlocal_map, |
| 1749 | if (!NILP (map)) | 1750 | string); |
| 1751 | /* For clicks on mode line or header line, override | ||
| 1752 | the maps we found at POSITION unconditionally, even | ||
| 1753 | if the corresponding properties of the mode- or | ||
| 1754 | header-line string are nil, because propertries at | ||
| 1755 | point are not relevant in that case. */ | ||
| 1756 | if (!NILP (map) | ||
| 1757 | || EQ (pos_area, Qmode_line) | ||
| 1758 | || EQ (pos_area, Qheader_line)) | ||
| 1750 | local_map = map; | 1759 | local_map = map; |
| 1751 | |||
| 1752 | map = Fget_text_property (pos, Qkeymap, string); | 1760 | map = Fget_text_property (pos, Qkeymap, string); |
| 1753 | if (!NILP (map)) | 1761 | if (!NILP (map) |
| 1762 | || EQ (pos_area, Qmode_line) | ||
| 1763 | || EQ (pos_area, Qheader_line)) | ||
| 1754 | keymap = map; | 1764 | keymap = map; |
| 1755 | } | 1765 | } |
| 1756 | } | 1766 | } |