From: Gerd Möllmann Date: Mon, 9 Dec 2024 14:08:01 +0000 (+0100) Subject: Support menu separator types in tty menus (bug#74740) X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=37a034884ee2dbb725368ac962eb332a6cfe8b3b;p=emacs.git Support menu separator types in tty menus (bug#74740) * src/xdisp.c (display_tty_menu_item): Display "--" for all menu separator types. (cherry picked from commit d719a8140917e3b1dd6889f064ffb8e8b0621c7d) --- diff --git a/src/xdisp.c b/src/xdisp.c index 5c120386454..f02e6056253 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -27340,6 +27340,17 @@ display_tty_menu_item (const char *item_text, int width, int face_id, display_string (" >", Qnil, Qnil, 0, 0, &it, width, 0, FRAME_COLS (f) - 1, -1); } + else if (menu_separator_name_p (item_text)) + { + /* FIXME: This is only a "good enough for now" implementation of + menu separators as described in the Elisp info manual. We + should probably ignore menu separators when computing the width + of a menu. Secondly, we could draw actual horizontal lines of + different styles on ttys, maybe optionally using Unicode + characters via display table entries. Patches very welcome. */ + display_string ("--", Qnil, Qnil, 0, 0, &it, width, 0, + FRAME_COLS (f) - 1, -1); + } else display_string (item_text, Qnil, Qnil, 0, 0, &it, width, 0, FRAME_COLS (f) - 1, -1);