From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Mauro Aranda Newsgroups: gmane.emacs.bugs Subject: bug#69457: unable to place two menu-choice widgets on same line Date: Wed, 28 Feb 2024 21:17:23 -0300 Message-ID: References: <5f95b89c-f8ee-4615-a856-aeb8deef0f8b@riseup.net> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="22994"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla Thunderbird To: martyhiatt@riseup.net, 69457@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Feb 29 01:27:53 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 1rfUHA-0005qc-Q6 for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 29 Feb 2024 01:27:52 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rfUGv-0006Yq-Q5; Wed, 28 Feb 2024 19:27:37 -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 1rfUGt-0006YA-Fm for bug-gnu-emacs@gnu.org; Wed, 28 Feb 2024 19:27:35 -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 1rfUGt-00077U-6U for bug-gnu-emacs@gnu.org; Wed, 28 Feb 2024 19:27:35 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rfUHJ-00052y-Up for bug-gnu-emacs@gnu.org; Wed, 28 Feb 2024 19:28:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Mauro Aranda Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 29 Feb 2024 00:28:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 69457 X-GNU-PR-Package: emacs Original-Received: via spool by 69457-submit@debbugs.gnu.org id=B69457.170916646119341 (code B ref 69457); Thu, 29 Feb 2024 00:28:01 +0000 Original-Received: (at 69457) by debbugs.gnu.org; 29 Feb 2024 00:27:41 +0000 Original-Received: from localhost ([127.0.0.1]:58866 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rfUGz-00051q-CH for submit@debbugs.gnu.org; Wed, 28 Feb 2024 19:27:41 -0500 Original-Received: from mail-ot1-f45.google.com ([209.85.210.45]:58820) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rfUGx-00051S-Kp for 69457@debbugs.gnu.org; Wed, 28 Feb 2024 19:27:40 -0500 Original-Received: by mail-ot1-f45.google.com with SMTP id 46e09a7af769-6e4a0e80d14so235064a34.1 for <69457@debbugs.gnu.org>; Wed, 28 Feb 2024 16:27:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1709166367; x=1709771167; darn=debbugs.gnu.org; h=content-transfer-encoding:in-reply-to:from:references:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=jHT+HJhzYFvTKQEN1/oO5L1BVDy1gqMb9IZz0BQU+4Q=; b=h8IRoFXymYTCG6uw69x59L1P8fzjQ5vgZfQo+JRme7UwnltxP8yPa6N88WzBdcp4jc GR9y3TNp0LB0JE/t3T67DJEnIBBR5WzBl+V2K9Y8bZqOXppr/DM+ldVYvvzOMGR0Ja3c SV1k1D/J8pAQOjjtAOBV/nGleho36Fcae58a83nGsJrzZpVNHVs5VmGuNnOT/TdNLO96 tc8ffWQXwED9FkGB8p2ALL2TMDRTk5278hx4hd1NgOI09AydCH7xdAeVUGyffyLzrvCs ehQe5b5wmYeUsMNYchxu/cJDy2nhsBvrURiuY7Px2y12CW1Pndkg1qm0hultvni1uami Eyww== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709166367; x=1709771167; h=content-transfer-encoding:in-reply-to:from:references:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=jHT+HJhzYFvTKQEN1/oO5L1BVDy1gqMb9IZz0BQU+4Q=; b=s1Eo3Y+sYAmfNCUlt7Q/G0SlUafWeSt3aUikQfKODOnXVjJM6+BOSJZTOfi7plnAEn NDVUZdMTpHnkcT6Sgn42Vvaczg/8bDo2irwkxw6vKTm7uJvnidPI7+CZvgVMXZbwIeEq XQshrVAoEoetOyUml2CLNbYOoKLcnmWiry/Fvi0kvFbT5EKnt2+kfqBwzh8rlTCcD6TQ w3fqT8fCRkS8rce3SQyz9vabWOR2K5elA1mMRetb5KaS3ZijWGE+RAZwmds+H+BWCRJQ 5Hna9P+XKujJxeosJz3Bx3DZUnJtXz7P0KiicE9tO0WwAzDn93eAK3P6BAJF1mrGXar6 5fKA== X-Forwarded-Encrypted: i=1; AJvYcCVx2gd6smeKW375ve82BQxo+n/NTwbbW7wzNXR4nsN15zIQG3eO/g+PXcyTUIF8oaj+RkK7DY2RE+KVW0+pF4uxHbfY4Ks= X-Gm-Message-State: AOJu0YxEcJ4SHIWJRJIvoFb54gCK2RS3LllDb1RzJxcuYW1ZgAyrvll4 1qZfYzyMFrTNpHewxlGbYFgJ7BN7NUxL3/n7COs1fRpmJgfs0dgv4EaVIILb X-Google-Smtp-Source: AGHT+IH+udxFM66uSJxfcaEmXi+3UnCrHCaMO8VvGlUNqydHI1dvXI4+8iwu0pi2uy89ixPLk47WhQ== X-Received: by 2002:a05:6a20:748c:b0:1a0:c3e6:3135 with SMTP id p12-20020a056a20748c00b001a0c3e63135mr908882pzd.28.1709165845929; Wed, 28 Feb 2024 16:17:25 -0800 (PST) Original-Received: from [192.168.0.100] ([181.228.33.6]) by smtp.gmail.com with ESMTPSA id c1-20020a170903234100b001db594c9d17sm43165plh.254.2024.02.28.16.17.24 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 28 Feb 2024 16:17:25 -0800 (PST) Content-Language: en-US In-Reply-To: <5f95b89c-f8ee-4615-a856-aeb8deef0f8b@riseup.net> 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:280778 Archived-At: On 28/2/24 10:26, martyhiatt@riseup.net wrote: > hi emacs, > > not sure if this is a bug or not, i'm a widget novice, but i'd like to > place two or more menu-choice widgets on the same line and am unable to. > some other widgets do not enforce a newline after them, as can be seen > from the example code in the emacs widgets manual. > is it possible to have multiple menu-choice widgets on the one line? if > the current library doesn't allow it, would someone know how/where i > might patch it? I think it should be possible. > i also noticed that i cant place any annotation string following the > menu widgets displayed value (see the commented argument to the :format > function below, if included the binding appears after a newline). i did > some poking around and realized it is the one issue. > > i'm not sure, but i suspect the issue is with the rendering of the item > widget (the children), not the menu-choice widget. Yes, you need to control the :format for the choices to accomplish this, at least. > some example code i have: > > (defun lem-ui-return-item-widgets (list) >   "Return a list of item widgets for each item, a string, in LIST." >   (cl-loop for x in list >            collect `(choice-item :value ,x))) So, how about adding something like: :format "%[%t%] " here? Did you try that? > (defun lem-ui-widget-format (str &optional binding) >   "Return a widget format string for STR, its name. > BINDING is a string of a keybinding to cycle the widget's value." >   (concat "%[" (propertize str >                            'face 'lem-ui-widget-face >                            'lem-tab-stop t) >           "%]: %v" >           binding)) > > ;; then within a buffer display function: >  (widget-create 'menu-choice >                      :tag "Listing" >                      :value type >                      :args (lem-ui-return-item-widgets lem-listing-types) >                      :help-echo "Select a listing type" >                      :format (lem-ui-widget-format "Listing") ; "C-c C-c") What's the intention with the "C-c C-c"? Could it go at the end of the :format suggestion I gave above?