diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/keymap.c | 38 |
1 files changed, 16 insertions, 22 deletions
diff --git a/src/keymap.c b/src/keymap.c index 2c250578b00..295b209f06b 100644 --- a/src/keymap.c +++ b/src/keymap.c | |||
| @@ -1735,11 +1735,20 @@ means to return the active maps for that window's buffer. */) | |||
| 1735 | } | 1735 | } |
| 1736 | } | 1736 | } |
| 1737 | 1737 | ||
| 1738 | /* If on a mode line string with a local keymap, | 1738 | Lisp_Object pos_area = POSN_POSN (position); |
| 1739 | or for a click on a string, i.e. overlay string or a | 1739 | if (EQ (pos_area, Qmode_line) || EQ (pos_area, Qheader_line)) |
| 1740 | string displayed via the `display' property, | 1740 | { |
| 1741 | consider `local-map' and `keymap' properties of | 1741 | /* For clicks on mode line or header line, ignore the maps |
| 1742 | that string. */ | 1742 | we found at POSITION, because properties at point are |
| 1743 | not relevant in that case. */ | ||
| 1744 | local_map = Qnil; | ||
| 1745 | keymap = Qnil; | ||
| 1746 | } | ||
| 1747 | |||
| 1748 | /* If on a mode line string with a local keymap, or for a | ||
| 1749 | click on a string, i.e. overlay string or a string | ||
| 1750 | displayed via the `display' property, consider only the | ||
| 1751 | `local-map' and `keymap' properties of that string. */ | ||
| 1743 | 1752 | ||
| 1744 | if (CONSP (string) && STRINGP (XCAR (string))) | 1753 | if (CONSP (string) && STRINGP (XCAR (string))) |
| 1745 | { | 1754 | { |
| @@ -1749,23 +1758,8 @@ means to return the active maps for that window's buffer. */) | |||
| 1749 | && XFIXNUM (pos) >= 0 | 1758 | && XFIXNUM (pos) >= 0 |
| 1750 | && XFIXNUM (pos) < SCHARS (string)) | 1759 | && XFIXNUM (pos) < SCHARS (string)) |
| 1751 | { | 1760 | { |
| 1752 | Lisp_Object map = Fget_text_property (pos, Qlocal_map, | 1761 | local_map = Fget_text_property (pos, Qlocal_map, string); |
| 1753 | string); | 1762 | keymap = Fget_text_property (pos, Qkeymap, string); |
| 1754 | Lisp_Object pos_area = POSN_POSN (position); | ||
| 1755 | /* For clicks on mode line or header line, override | ||
| 1756 | the maps we found at POSITION unconditionally, even | ||
| 1757 | if the corresponding properties of the mode- or | ||
| 1758 | header-line string are nil, because propertries at | ||
| 1759 | point are not relevant in that case. */ | ||
| 1760 | if (!NILP (map) | ||
| 1761 | || EQ (pos_area, Qmode_line) | ||
| 1762 | || EQ (pos_area, Qheader_line)) | ||
| 1763 | local_map = map; | ||
| 1764 | map = Fget_text_property (pos, Qkeymap, string); | ||
| 1765 | if (!NILP (map) | ||
| 1766 | || EQ (pos_area, Qmode_line) | ||
| 1767 | || EQ (pos_area, Qheader_line)) | ||
| 1768 | keymap = map; | ||
| 1769 | } | 1763 | } |
| 1770 | } | 1764 | } |
| 1771 | 1765 | ||