From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Gerd =?UTF-8?Q?M=C3=B6llmann?= Newsgroups: gmane.emacs.bugs Subject: bug#74740: 31.0.50; tty menus not displaying separators Date: Mon, 09 Dec 2024 05:29:43 +0100 Message-ID: References: <864j3ef2ii.fsf@gnu.org> <86y10qdmhz.fsf@gnu.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="36009"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: 74740@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Dec 09 05:31:59 2024 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1tKVR8-0009Ei-JO for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 09 Dec 2024 05:31:58 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tKVQW-0007mQ-Gw; Sun, 08 Dec 2024 23:31:20 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tKVQE-0007kN-S4 for bug-gnu-emacs@gnu.org; Sun, 08 Dec 2024 23:31:03 -0500 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tKVQE-0000mv-IL for bug-gnu-emacs@gnu.org; Sun, 08 Dec 2024 23:31:02 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:Date:References:In-Reply-To:From:To:Subject; bh=K7xBHVD80XLeHdIWFOFYbn3VSGLnKR1CjTAGWpjPGe0=; b=a2CjH1eZt2iJwczLxM0NzdIaX8q5XPH3H84Cn60/mOeEKPI6vy1OlP5dWm9Bp/cdb21V2XTO1XXhKdAMtF06E0wHVIYYGJPdSvEncWIKWcdJW5AuDmHsMCIQ5ljV47pSoKt/TGRcSpZ5JBMADbLreKNCjlMHd7+HhJacYoy+TZ7pMxVxDDV5+6Ry9XnHTUNekgBu5I40HCmgG5BCJl9FNBxUlAC5UAt7WBM3OuGrXKEGgocZ3bNpcllL9J6Z0bU/saqlAbo4lYz7thos4FhfZ9Et0E2zIrDog1PEwbNuoqBD8wp4lOvmZxbuOsTfH2X2mHM8ZIXjDPaCZg0mpK7Fng==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tKVQE-0004Lp-Df for bug-gnu-emacs@gnu.org; Sun, 08 Dec 2024 23:31:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Gerd =?UTF-8?Q?M=C3=B6llmann?= Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 09 Dec 2024 04:31:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 74740 X-GNU-PR-Package: emacs Original-Received: via spool by 74740-submit@debbugs.gnu.org id=B74740.173371865516691 (code B ref 74740); Mon, 09 Dec 2024 04:31:02 +0000 Original-Received: (at 74740) by debbugs.gnu.org; 9 Dec 2024 04:30:55 +0000 Original-Received: from localhost ([127.0.0.1]:52505 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tKVQ6-0004L3-So for submit@debbugs.gnu.org; Sun, 08 Dec 2024 23:30:55 -0500 Original-Received: from mail-wm1-f54.google.com ([209.85.128.54]:61894) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tKVQ4-0004KY-9A for 74740@debbugs.gnu.org; Sun, 08 Dec 2024 23:30:52 -0500 Original-Received: by mail-wm1-f54.google.com with SMTP id 5b1f17b1804b1-434a2f3bae4so43553775e9.3 for <74740@debbugs.gnu.org>; Sun, 08 Dec 2024 20:30:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1733718586; x=1734323386; darn=debbugs.gnu.org; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to; bh=K7xBHVD80XLeHdIWFOFYbn3VSGLnKR1CjTAGWpjPGe0=; b=FBUJ7Ei+Kla5eozNIFIQ4zfUsXM3xzVRYKcXYixiYOByNSXnmo0U4oOIa/FRioPT6G GyfQxWjpmMhKT6UBuC0GSR7LUQbIwhdGkpP7M3gvf8A918jOKoVwZlQ3Ed+PagpEj7J6 usL/pQ8fudQ0F1DFA94FAUXyQbkEEuF41MRKDarBDg67rHGnTvIpFaTaBc8uXjApXCfv a0rP7/87GsMGAK6d9CPbnFBvOF3FVa0wPx952HFslhMyp4EWZ3fCLIESZ8/A2d3A3idc 1dQEEDavXLcGgLmmQ3RJEevOeIf9Bsa8TSsqBpljiv90bUhoKHnFGVRL84pme5p1uwxP HxqA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733718586; x=1734323386; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=K7xBHVD80XLeHdIWFOFYbn3VSGLnKR1CjTAGWpjPGe0=; b=ct+B0h3pak1+tZqH5w5U/jmY4g7sc0T++NgdURfqG6RIHqZhcdwE5kEiNT5Dce3XUa EjSeCLIo84HDSmdq/gUGW2M23lfmYuaBwCp6cATOfDoKAjJsXDurCvGrD5/GX1XhWnig zyu8XY4DAZ676PN7dMSqNMwzO1pNThkO/b0uCTOH5Fza3HizoLnDSfDIkzZMuFISd26O NQha7hv6BLLXTMKrzmJDEW36FJLdM10cmotO9w2hRkHtqlgpDmf1Y+OLgLZ2WS6qk67f tNBibo8J6HiXl3Yaye0UgGJkE286QWswI0Z+vnPaGTQVy3Gw9ieA4tXgakYQ8gOUNHMX VM9w== X-Gm-Message-State: AOJu0Yw/8L8cW88nR97gProNWGeoS729v0JphenkSKzwdPzNXaMhA5ZI RR/oFFhceqdV1aVHqJDcIwu0o3bWAMofC4agnWs35YpGMZm0Y8ncZOSI1g== X-Gm-Gg: ASbGnctSryFaFafgIfrAp3j+wj6Kk9MrhBhdkxZvrV2UhhotpDmriDbtLiPl/T+LIlA b5v94os6nUp+udSIX/RHM70nolSUXfinXL2AOVCWBUKd8dyMU2ODszSAOO/OhDTfKUaMsNEDUfF GkP5O9CwHaZrsdyVLYYposbO/FM3GF/MCEUigbf58pAyop5LkFylR7GTUYELWgc6dRd+zCE3SWq hhLkJ9tS3IgXwS3914ZOMCSKb8CM1xfPbEeagb15OuRTpOTQh4Xq1ZgZJZZSOYczvmgrVmSytvC PudtWxH8GELD4gh5OE8kAnzN9g4Rbx4JoRM+Zr68knkkBs45tiS77yyVAxc= X-Google-Smtp-Source: AGHT+IGUjYMqKtRIzXP7JW5terTcgiqm3NSP2tOMHawzevwTjH7G3GKZtTak0C+fSMvWr/aS6YVZ4Q== X-Received: by 2002:a05:600c:4750:b0:434:a9bd:e67d with SMTP id 5b1f17b1804b1-434ddeb4997mr92087535e9.13.1733718586110; Sun, 08 Dec 2024 20:29:46 -0800 (PST) Original-Received: from pro2 (p200300e0b72dbc00686f49e61b8c6739.dip0.t-ipconnect.de. [2003:e0:b72d:bc00:686f:49e6:1b8c:6739]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-434f8836dbbsm18311705e9.0.2024.12.08.20.29.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 08 Dec 2024 20:29:45 -0800 (PST) In-Reply-To: <86y10qdmhz.fsf@gnu.org> (Eli Zaretskii's message of "Sun, 08 Dec 2024 21:04:56 +0200") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:296677 Archived-At: --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Eli Zaretskii writes: >> From: Gerd M=C3=B6llmann >> Cc: 74740@debbugs.gnu.org >> Date: Sun, 08 Dec 2024 19:46:35 +0100 >>=20 >> Eli Zaretskii writes: >>=20 >> >> From: Gerd M=C3=B6llmann >> >> Date: Sun, 08 Dec 2024 18:34:33 +0100 >> >>=20 >> >> To see this, emacs -nw -q and open a menu from the menubar. Simple >> >> separators there are displayed as "--". >> > >> > What did you expect instead? I think this always worked like that on >> > TTY frames. >> > >> >> More generally, all separator types are displayed as they appear in t= he >> >> menu item definition, '--double-line' as "--double-line" and so on. >>=20 >> I expected a horizontal line for "--". >>=20 >> > What do you mean by that? where do we have such separators, and how do >> > you display the menus which show them? I don't think I see them in >> > the default menu bar. >>=20 >> Concerning the separator types, Elisp Info says >>=20 >> 23.18.1.3 Menu Separators >> ......................... >>=20 >> A menu separator is a kind of menu item that doesn't display any >> text--instead, it divides the menu into subparts with a horizontal lin= e. >> A separator looks like this in the menu keymap: >>=20 >> (menu-item SEPARATOR-TYPE) >>=20 >> where SEPARATOR-TYPE is a string starting with two or more dashes. >>=20 >> followed by a list of separator types, among them the --double-line I >> mentioned. >>=20 >> One can get these from 3rd-party packages. Minion is an example, where >> --double-line appears in a popup menu on the mode line. > > This was never supported in TTY menus (I think I was completely > unaware of this feature when I wrote the code). Patches to support it > will be most welcome. The following patch displays "--" for all separator types. I'd say that's good enough, WDYT? --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-Support-menu-separator-types-in-tty-menus-bug-74740.patch Content-Description: separator types >From 09917757737d65fbb5bbcd57427a8e0528b87119 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gerd=20M=C3=B6llmann?= Date: Mon, 9 Dec 2024 05:20:29 +0100 Subject: [PATCH] Support menu separator types in tty menus (bug#74740) * src/xdisp.c (display_tty_menu_item): Display "--" If a menu item's text looks like a separator. --- src/xdisp.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/xdisp.c b/src/xdisp.c index 534c0520240..abbe665a2fd 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -27333,6 +27333,9 @@ 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)) + 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); -- 2.47.1 --=-=-=--