diff options
| author | Gerd Möllmann | 2025-02-19 08:33:32 +0100 |
|---|---|---|
| committer | Gerd Möllmann | 2025-02-19 08:36:59 +0100 |
| commit | 23bf94a0111474419ca84145c8ede95c6915bd35 (patch) | |
| tree | 3f0906504e55147f50cc8825b9bd5fd3c62404bd /src/menu.c | |
| parent | 4fb5ff5426a994aa139614639f60333fd07c06b4 (diff) | |
| download | emacs-23bf94a0111474419ca84145c8ede95c6915bd35.tar.gz emacs-23bf94a0111474419ca84145c8ede95c6915bd35.zip | |
Don't call x-popup-function for non-tty frames
* src/menu.c (x_popup_menu_1): Don't call x-popup-function for non-tty
frames
(syms_of_menu): Remove Qx_popup_menu_function because unused, extend doc
string of x-popup-menu-function.
Diffstat (limited to 'src/menu.c')
| -rw-r--r-- | src/menu.c | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/src/menu.c b/src/menu.c index 11a0a10d87d..d98135afbfd 100644 --- a/src/menu.c +++ b/src/menu.c | |||
| @@ -1111,9 +1111,6 @@ into menu items. */) | |||
| 1111 | Lisp_Object | 1111 | Lisp_Object |
| 1112 | x_popup_menu_1 (Lisp_Object position, Lisp_Object menu) | 1112 | x_popup_menu_1 (Lisp_Object position, Lisp_Object menu) |
| 1113 | { | 1113 | { |
| 1114 | if (!NILP (Vx_popup_menu_function)) | ||
| 1115 | return calln (Vx_popup_menu_function, position, menu); | ||
| 1116 | |||
| 1117 | Lisp_Object keymap, tem, tem2 = Qnil; | 1114 | Lisp_Object keymap, tem, tem2 = Qnil; |
| 1118 | int xpos = 0, ypos = 0; | 1115 | int xpos = 0, ypos = 0; |
| 1119 | Lisp_Object title; | 1116 | Lisp_Object title; |
| @@ -1411,8 +1408,13 @@ x_popup_menu_1 (Lisp_Object position, Lisp_Object menu) | |||
| 1411 | doesn't have its hooks set (e.g., in a batch session), because | 1408 | doesn't have its hooks set (e.g., in a batch session), because |
| 1412 | such a frame cannot display menus. */ | 1409 | such a frame cannot display menus. */ |
| 1413 | if (!FRAME_INITIAL_P (f)) | 1410 | if (!FRAME_INITIAL_P (f)) |
| 1414 | selection = FRAME_TERMINAL (f)->menu_show_hook (f, xpos, ypos, menuflags, | 1411 | { |
| 1415 | title, &error_name); | 1412 | if (FRAME_TERMCAP_P (f) && !NILP (Vx_popup_menu_function)) |
| 1413 | selection = calln (Vx_popup_menu_function, position, menu); | ||
| 1414 | else | ||
| 1415 | selection = FRAME_TERMINAL (f)->menu_show_hook (f, xpos, ypos, menuflags, | ||
| 1416 | title, &error_name); | ||
| 1417 | } | ||
| 1416 | 1418 | ||
| 1417 | unbind_to (specpdl_count, Qnil); | 1419 | unbind_to (specpdl_count, Qnil); |
| 1418 | 1420 | ||
| @@ -1617,7 +1619,6 @@ syms_of_menu (void) | |||
| 1617 | 1619 | ||
| 1618 | DEFSYM (Qhide, "hide"); | 1620 | DEFSYM (Qhide, "hide"); |
| 1619 | DEFSYM (Qx_pre_popup_menu_hook, "x-pre-popup-menu-hook"); | 1621 | DEFSYM (Qx_pre_popup_menu_hook, "x-pre-popup-menu-hook"); |
| 1620 | DEFSYM (Qx_popup_menu_function, "x-popup-menu-function"); | ||
| 1621 | 1622 | ||
| 1622 | DEFVAR_LISP ("x-pre-popup-menu-hook", Vx_pre_popup_menu_hook, | 1623 | DEFVAR_LISP ("x-pre-popup-menu-hook", Vx_pre_popup_menu_hook, |
| 1623 | doc: /* Hook run before `x-popup-menu' displays a popup menu. | 1624 | doc: /* Hook run before `x-popup-menu' displays a popup menu. |
| @@ -1627,8 +1628,9 @@ won't be run if `x-popup-menu' fails or returns for some other reason | |||
| 1627 | Vx_pre_popup_menu_hook = Qnil; | 1628 | Vx_pre_popup_menu_hook = Qnil; |
| 1628 | 1629 | ||
| 1629 | DEFVAR_LISP ("x-popup-menu-function", Vx_popup_menu_function, | 1630 | DEFVAR_LISP ("x-popup-menu-function", Vx_popup_menu_function, |
| 1630 | doc: /* Function to call to pop up a menu. | 1631 | doc : /* Function to call to pop up a menu. |
| 1631 | The function is called like `x-popup-menu'. */); | 1632 | The function is called like `x-popup-menu'. This is currently only |
| 1633 | used for frames on text terminals. */); | ||
| 1632 | Vx_popup_menu_function = Qnil; | 1634 | Vx_popup_menu_function = Qnil; |
| 1633 | 1635 | ||
| 1634 | defsubr (&Sx_popup_menu); | 1636 | defsubr (&Sx_popup_menu); |