emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master d719a814091 2/2: Support menu separator types in tty menus (bug#7


From: Gerd Moellmann
Subject: master d719a814091 2/2: Support menu separator types in tty menus (bug#74740)
Date: Mon, 9 Dec 2024 09:18:16 -0500 (EST)

branch: master
commit d719a8140917e3b1dd6889f064ffb8e8b0621c7d
Author: Gerd Möllmann <gerd@gnu.org>
Commit: Gerd Möllmann <gerd@gnu.org>

    Support menu separator types in tty menus (bug#74740)
    
    * src/xdisp.c (display_tty_menu_item): Display "--" for all menu
    separator types.
---
 src/xdisp.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/src/xdisp.c b/src/xdisp.c
index 0fa3c34c314..7b0e2644078 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);



reply via email to

[Prev in Thread] Current Thread [Next in Thread]