diff options
| author | Eli Zaretskii | 2025-01-12 08:22:24 +0200 |
|---|---|---|
| committer | Eli Zaretskii | 2025-02-28 09:53:42 +0200 |
| commit | b3181a807124d5c6226fdcf1e42bf4b6fcdc4ad2 (patch) | |
| tree | 04ffec1dab9c29c4c8087e2b75d2b8dd4036228b /src | |
| parent | 6f5c322f5974786290b1b3e68b5a0685ddec3410 (diff) | |
| download | emacs-b3181a807124d5c6226fdcf1e42bf4b6fcdc4ad2.tar.gz emacs-b3181a807124d5c6226fdcf1e42bf4b6fcdc4ad2.zip | |
Fix mouse-2 clicks on mode line and header line
* src/keymap.c (Fcurrent_active_maps): For clicks on mode-line and
header-line, always override the keymaps at buffer position.
(Bug#75219)
(cherry picked from commit c41ea047a434710c4b7bc8280695c83fbe5fff35)
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 | } |