From debbugs-submit-bounces@debbugs.gnu.org Sun Apr 01 23:03:19 2018 Received: (at submit) by debbugs.gnu.org; 2 Apr 2018 03:03:19 +0000 Received: from localhost ([127.0.0.1]:34583 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1f2pkc-0006Uj-R6 for submit@debbugs.gnu.org; Sun, 01 Apr 2018 23:03:19 -0400 Received: from eggs.gnu.org ([208.118.235.92]:48747) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1f2pka-0006UV-6a for submit@debbugs.gnu.org; Sun, 01 Apr 2018 23:03:17 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1f2pkU-0000nF-8q for submit@debbugs.gnu.org; Sun, 01 Apr 2018 23:03:11 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,T_DKIM_INVALID autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:38615) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1f2pkU-0000n9-6A for submit@debbugs.gnu.org; Sun, 01 Apr 2018 23:03:10 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39711) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f2pkT-0005LB-02 for bug-gnu-emacs@gnu.org; Sun, 01 Apr 2018 23:03:09 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1f2pkP-0000ju-TJ for bug-gnu-emacs@gnu.org; Sun, 01 Apr 2018 23:03:09 -0400 Received: from userp2130.oracle.com ([156.151.31.86]:59944) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1f2pkP-0000j3-Ju for bug-gnu-emacs@gnu.org; Sun, 01 Apr 2018 23:03:05 -0400 Received: from pps.filterd (userp2130.oracle.com [127.0.0.1]) by userp2130.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w322qv5o112375 for ; Mon, 2 Apr 2018 03:03:03 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=mime-version : message-id : date : from : sender : to : subject : content-type : content-transfer-encoding; s=corp-2017-10-26; bh=KEZT97ddslzfiCkg+gMdwH45q789lT7l83D2g3mVdxY=; b=lcEj/SWdFN6ckVyJ0CD3E271YKZ+G9sHjfUx9VYoqK6/UxXTmdsWrGVI562PYTd3ei+P zMba4v76xvGKdrb8ecg/MLk/r5+YZ8h4XRkqrqlVIbx9YhguSmpIAMJk6WNobSxwkivH xlkDi8fN8Osn5OCibNq/sBVFb19qPL/gTw/6/dzJUIWo1lEFuUf0ZPADNS4Sh/THFbNL RdbZmrcoi5/a4SxYKOAwYnKOz1O3NftVQK+QAK4dhzfEbRN9ZJKq2U6ZmFnW9fXIeo6n KbSsETod76mHKUcPhX40eqD1W1YHn6888K0tFI88u04yuKC4usBW+CIhd/EwJX6LDEhe xg== Received: from aserv0021.oracle.com (aserv0021.oracle.com [141.146.126.233]) by userp2130.oracle.com with ESMTP id 2h3c4300ha-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Mon, 02 Apr 2018 03:03:03 +0000 Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by aserv0021.oracle.com (8.14.4/8.14.4) with ESMTP id w32331Xu005856 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Mon, 2 Apr 2018 03:03:02 GMT Received: from abhmp0016.oracle.com (abhmp0016.oracle.com [141.146.116.22]) by userv0121.oracle.com (8.14.4/8.13.8) with ESMTP id w32331jN006034 for ; Mon, 2 Apr 2018 03:03:01 GMT MIME-Version: 1.0 Message-ID: <37c99926-a5e5-4fa8-b734-6f9c146740e9@default> Date: Sun, 1 Apr 2018 20:03:00 -0700 (PDT) From: Drew Adams To: bug-gnu-emacs@gnu.org Subject: 27.0; Please provide a way to know about menu-bar wrapping X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.9.1 (1003210) [OL 16.0.4666.0 (x86)] Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=8850 signatures=668697 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=1 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=827 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1711220000 definitions=main-1804020022 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] [fuzzy] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -4.0 (----) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -4.0 (----) Enhancement request. When a frame is narrower than the text in the menu-bar, that text is wrapped. And yet the value of frame parameter `menu-bar-lines' is not increased (which is good). It would be good to be able to know (from Elisp) how many "visual" (effective) menu-bar lines there are currently, that is, how many times the menu-bar text is wrapped. (It is typically wrapped zero or one time, producing text that appears visually to be two lines.) In GNU Emacs 27.0.50 (build 3, x86_64-w64-mingw32) of 2018-03-21 Repository revision: e70d0c9e66d7a8609450b2889869d16aeb0363b5 Windowing system distributor `Microsoft Corp.', version 6.1.7601 Configured using: `configure --without-dbus --host=3Dx86_64-w64-mingw32 --without-compress-install -C 'CFLAGS=3D-O2 -static -g3'' From debbugs-submit-bounces@debbugs.gnu.org Mon Apr 02 02:09:05 2018 Received: (at 31020) by debbugs.gnu.org; 2 Apr 2018 06:09:05 +0000 Received: from localhost ([127.0.0.1]:34636 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1f2seP-0002P2-IE for submit@debbugs.gnu.org; Mon, 02 Apr 2018 02:09:05 -0400 Received: from eggs.gnu.org ([208.118.235.92]:48686) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1f2seO-0002OY-Cm for 31020@debbugs.gnu.org; Mon, 02 Apr 2018 02:09:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1f2seF-0006i7-SR for 31020@debbugs.gnu.org; Mon, 02 Apr 2018 02:08:59 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-0.0 required=5.0 tests=BAYES_40,T_RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:34682) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f2seF-0006hz-Oi; Mon, 02 Apr 2018 02:08:55 -0400 Received: from [176.228.60.248] (port=3129 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1f2seE-0001Iz-1i; Mon, 02 Apr 2018 02:08:54 -0400 Date: Mon, 02 Apr 2018 09:08:58 +0300 Message-Id: <837epq6sxx.fsf@gnu.org> From: Eli Zaretskii To: Drew Adams In-reply-to: <37c99926-a5e5-4fa8-b734-6f9c146740e9@default> (message from Drew Adams on Sun, 1 Apr 2018 20:03:00 -0700 (PDT)) Subject: Re: bug#31020: 27.0; Please provide a way to know about menu-bar wrapping References: <37c99926-a5e5-4fa8-b734-6f9c146740e9@default> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: 31020 Cc: 31020@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Eli Zaretskii Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) > Date: Sun, 1 Apr 2018 20:03:00 -0700 (PDT) > From: Drew Adams > > When a frame is narrower than the text in the > menu-bar, that text is wrapped. And yet the value of frame parameter > `menu-bar-lines' is not increased (which is good). > > It would be good to be able to know (from Elisp) how many "visual" > (effective) menu-bar lines there are currently, that is, how many times > the menu-bar text is wrapped. (It is typically wrapped zero or one > time, producing text that appears visually to be two lines.) I don't understand why you think that the menu-bar-lines parameter should not be it. AFAIU, the problem with setting it (or any other frame parameter) to the actual value is that with many toolkits Emacs simply doesn't know the correct value. But maybe Martin will have some trick up his sleeves. From debbugs-submit-bounces@debbugs.gnu.org Mon Apr 02 04:54:42 2018 Received: (at 31020) by debbugs.gnu.org; 2 Apr 2018 08:54:42 +0000 Received: from localhost ([127.0.0.1]:34696 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1f2vEg-00065U-G2 for submit@debbugs.gnu.org; Mon, 02 Apr 2018 04:54:42 -0400 Received: from mout.gmx.net ([212.227.15.18]:57849) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1f2vEe-00065H-7R for 31020@debbugs.gnu.org; Mon, 02 Apr 2018 04:54:40 -0400 Received: from [192.168.1.100] ([213.162.73.134]) by mail.gmx.com (mrgmx001 [212.227.17.190]) with ESMTPSA (Nemesis) id 0M6ilI-1eHQmo2XUS-00wRjs; Mon, 02 Apr 2018 10:54:30 +0200 Message-ID: <5AC1EFC0.6020801@gmx.at> Date: Mon, 02 Apr 2018 10:54:24 +0200 From: martin rudalics MIME-Version: 1.0 To: Eli Zaretskii , Drew Adams Subject: Re: bug#31020: 27.0; Please provide a way to know about menu-bar wrapping References: <37c99926-a5e5-4fa8-b734-6f9c146740e9@default> <837epq6sxx.fsf@gnu.org> In-Reply-To: <837epq6sxx.fsf@gnu.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K0:5b4VbrkUUMV1AFI3++h5JcYug/cQjpl6MWhYRkFVhgK9tHaVJIa tXRqGUwpRIjS1l3Qhc8T4ciLWnk5pKXHH5GhsRyIEf3HtdmAojB9qiRSi54wos0r3fKNPUL TbWYkSxjPZlaUOH9wk5q5C6hH2DpPP1LlHJpIpMO/Y1nJYopEysA5gxG9iWEu8rcG8AqwdU ZvdtYKgUXj5IuRZCMXThA== X-UI-Out-Filterresults: notjunk:1;V01:K0:6rLgpu3pBlY=:HKmSj1VVkGMcwgznSlv3tg p/aK3sBrZ2Zv+xbJRH7biO4IKVty1TQBmlOyXSNmys1kNvUvNTKbojwlqgLy3ufg1eEmx1Rb0 m2k7xQNCGssgousafe/M7E9MaKaDwgWlftWz5RkXB7XsPLYlVi4S3xQP5vJ943aePG9E/HeXM SlCQYpR0GnpSW8B5HIklYEOlqcvE6cW02DuSr148o2PijV1DJCP0wt1UQvUrkA2eGIVeKXcwe QM+aLc9/H8TL74m9a+VHowxh+G3GTZQaCPR+HrefQS8hAIDsVkzhhlOfXChGN6yneVwIOg3+y 9cXvdcnbFCWw4Q5oXsqkeUeu2yeeVY3cFmJ2VwOdyBxW/01fSLr7/dbqwDb3d9khJb/1t3CFI rpo1BThdDTwf3BMDwhzMTcdNIGoysmgg5nyH17x2QUDotRc/gWfAn1hfKLwEGR3yJAbhpI8d7 iI4lhGxBA7t8Pu0bfcFyzbulH0HNpU6HdrUTjkq5/XnnB2iGORSSfm3geCf4+VrhAzNiUiFgH 3qP8vRU+LIa7wU7fGL0V5WqE1CECL/E49qOSPMqeovDWCAoFoCnc1PlGxxOQR3a37rSQH5ImM vHGT2osHttTAszYanOhrZMW7JZ5bv4lm3WBcpVLLk0A+09oxWDci4EkeJTc/3fF0Wcgd8u3oR 5zJHnAUlmPLxYWZF19OCDzHdIas1rk/H3PFMcbwXq6wpXBGQMfr+Nq6MkiTUlbn386DyaFMnm 9Mf0DBiFQJvXLdUcUn56W+G5lJhaO8bhrlRuyOcmgoT0px5XssfXomFNzjfyf9Bazks3UBznk PCG71jZTMC1fyv7123etnYjBW0lgxMfgZBAmxhRK0cazTacwFU= X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 31020 Cc: 31020@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) > I don't understand why you think that the menu-bar-lines parameter > should not be it. AFAIU, the problem with setting it (or any other > frame parameter) to the actual value is that with many toolkits Emacs > simply doesn't know the correct value. But maybe Martin will have > some trick up his sleeves. I am not aware of any toolkit telling us that number or whether the current menu bar was wrapped at all. It's nowhere in the various API descriptions and I suppose the information usually gets lost somewhere in between calculations of which font the user's theme wants for the menu bar and how that affects wrapping. I'm not even sure whether some toolkit would deliberately truncate our menu bar when it doesn't fit into one line. And lets not talk about GTK auto-resizing our frame when the menu bar gets too long. So what you can do is the following: Make a frame with a _visibly unwrapped_ menu bar, get the menu bar height via (cddr (assq 'menu-bar-size (frame-geometry))) Do the same for a frame with a _visibly wrapped_ two-lines menu bar. You can now derive the height of the single-line and any additional menu bar line and use these values together with 'frame-geometry' for getting the actual number of lines. Obviously, this will work only as long as you do not change themes, the menu bar height of the current theme or the resolution of your screen or whatever else could affect this. And since you have to visuallly check the "wrappedness" of the menu bar, this work cannot be reasonably done from within Emacs. martin From debbugs-submit-bounces@debbugs.gnu.org Mon Apr 02 09:25:40 2018 Received: (at 31020) by debbugs.gnu.org; 2 Apr 2018 13:25:40 +0000 Received: from localhost ([127.0.0.1]:34768 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1f2zSu-0007ju-4f for submit@debbugs.gnu.org; Mon, 02 Apr 2018 09:25:40 -0400 Received: from userp2120.oracle.com ([156.151.31.85]:58258) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1f2zSt-0007jh-3z for 31020@debbugs.gnu.org; Mon, 02 Apr 2018 09:25:39 -0400 Received: from pps.filterd (userp2120.oracle.com [127.0.0.1]) by userp2120.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w32DHv0k067447; Mon, 2 Apr 2018 13:25:33 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=mime-version : message-id : date : from : sender : to : cc : subject : references : in-reply-to : content-type : content-transfer-encoding; s=corp-2017-10-26; bh=5pWjCRzN2OM+Lmo+Czezf0QzIB9a/dBed9354VdGtgs=; b=Bzy2E82R2NlVrkch9dnDU6K8udb3eCIYTvIJeq5cB00hUOy2dxdzxfRmKFvTGt0ZIfS+ r4OjU4b8UXM+2FlQKsip5/7E5ZtLATM1UxvRIdxhWXv+J7qR08OXsZEM09QAst1XCIPu 7oXREbSLXmLHi0TMp/PqMk64dz3vXKoKQxWMt3j6ZosgKIYdrXk6+WbXxIS2TGzg0eFw 7ED0YDK1R3Q+6hhVq9F7cio/Yicw/HZCYuOwxJ1bYyqbRzx7G/SxDqAy0G5XXArg9i9N 8Tu2Wg0WZbgk8js/8R8CW2oWl5e5BrVtWCBSluv9waSetbjw2of9M94eLGe56LxfW+TQ DQ== Received: from aserv0022.oracle.com (aserv0022.oracle.com [141.146.126.234]) by userp2120.oracle.com with ESMTP id 2h3n9g00tg-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 02 Apr 2018 13:25:33 +0000 Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by aserv0022.oracle.com (8.14.4/8.14.4) with ESMTP id w32DPWIQ025105 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 2 Apr 2018 13:25:32 GMT Received: from abhmp0016.oracle.com (abhmp0016.oracle.com [141.146.116.22]) by userv0121.oracle.com (8.14.4/8.13.8) with ESMTP id w32DPVD2031016; Mon, 2 Apr 2018 13:25:31 GMT MIME-Version: 1.0 Message-ID: Date: Mon, 2 Apr 2018 06:25:30 -0700 (PDT) From: Drew Adams To: Eli Zaretskii Subject: RE: bug#31020: 27.0; Please provide a way to know about menu-bar wrapping References: <<37c99926-a5e5-4fa8-b734-6f9c146740e9@default>> <<837epq6sxx.fsf@gnu.org>> In-Reply-To: <<837epq6sxx.fsf@gnu.org>> X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.9.1 (1003210) [OL 16.0.4666.0 (x86)] Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=8850 signatures=668697 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=525 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1711220000 definitions=main-1804020149 X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 31020 Cc: 31020@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) > > When a frame is narrower than the text in the > > menu-bar, that text is wrapped. And yet the value of frame parameter > > `menu-bar-lines' is not increased (which is good). > > > > It would be good to be able to know (from Elisp) how many "visual" > > (effective) menu-bar lines there are currently, that is, how many times > > the menu-bar text is wrapped. (It is typically wrapped zero or one > > time, producing text that appears visually to be two lines.) >=20 > I don't understand why you think that the menu-bar-lines parameter > should not be it. AFAIU, the problem with setting it (or any other > frame parameter) to the actual value is that with many toolkits Emacs > simply doesn't know the correct value. But maybe Martin will have > some trick up his sleeves. I think it's helpful to distinguish (1) the actual, current number of lines used, reflecting any possible wrapping, from (2) the user's setting of how many lines should be used for the menu-bar. How those are distinguished doesn't matter to me so much. And if you decide that there is no sense in such a distinction, and that the parameter value should be automatically changed, dynamically, as a frame's width is changed (e.g. to force or remove wrapping), then that would probably be OK too. The problem, at least on MS Windows, is that the menu-bar wraps, and there is no way (AFAIK) to know from Lisp who many actual lines are currently used to show the menu-bar. This is an old problem, as you know. It would be really good to finally put it to bed, if possible. From debbugs-submit-bounces@debbugs.gnu.org Mon Apr 02 09:32:59 2018 Received: (at 31020) by debbugs.gnu.org; 2 Apr 2018 13:32:59 +0000 Received: from localhost ([127.0.0.1]:34777 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1f2zZz-0007ur-DE for submit@debbugs.gnu.org; Mon, 02 Apr 2018 09:32:59 -0400 Received: from aserp2130.oracle.com ([141.146.126.79]:45654) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1f2zZy-0007uc-77 for 31020@debbugs.gnu.org; Mon, 02 Apr 2018 09:32:58 -0400 Received: from pps.filterd (aserp2130.oracle.com [127.0.0.1]) by aserp2130.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w32DStXc142076; Mon, 2 Apr 2018 13:32:52 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=mime-version : message-id : date : from : sender : to : cc : subject : references : in-reply-to : content-type : content-transfer-encoding; s=corp-2017-10-26; bh=bPu67b9kB4E2pRPsk3O1coiGtJ4A6/rnUEtmGTamZG4=; b=likh2wewNL/1EqnLLkVxaviHka3LprqqTpo04KyxYl72324EmSLGjLZPJxUluWlL9aMs 8pzArPTuGS99dnPzU6jj90ZvDr5v4rCa1PY4DluBA9iUx9yQYUPoY0iFcThfO5Tyadhm 8Dzt1ikWIFn1Sr5X+oPqq3lTSOAIt/NCnOlaMCJaHCkeHwORZaCugi5EwOQZzUar2LZ4 p5KPMgmQzIfHmkBH7tZY6RQd1wsdBbHtRfR5aLikZ4gBUiudfcGLMxGBJSzHWeOw88Nc W3GksmdD1K8kRnMH39aiVaMdkewjFTL1/QYbNxM+fA9Leb1xtnpCrq9k+bGRkcRgWaNt ew== Received: from aserv0021.oracle.com (aserv0021.oracle.com [141.146.126.233]) by aserp2130.oracle.com with ESMTP id 2h3neng0k8-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 02 Apr 2018 13:32:52 +0000 Received: from userv0122.oracle.com (userv0122.oracle.com [156.151.31.75]) by aserv0021.oracle.com (8.14.4/8.14.4) with ESMTP id w32DWpCX002432 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 2 Apr 2018 13:32:51 GMT Received: from abhmp0016.oracle.com (abhmp0016.oracle.com [141.146.116.22]) by userv0122.oracle.com (8.14.4/8.14.4) with ESMTP id w32DWoD3023307; Mon, 2 Apr 2018 13:32:51 GMT MIME-Version: 1.0 Message-ID: <266400ad-5ec5-4bfb-9192-6e15aa0e25a2@default> Date: Mon, 2 Apr 2018 06:32:49 -0700 (PDT) From: Drew Adams To: martin rudalics , Eli Zaretskii Subject: RE: bug#31020: 27.0; Please provide a way to know about menu-bar wrapping References: <37c99926-a5e5-4fa8-b734-6f9c146740e9@default> <837epq6sxx.fsf@gnu.org> <5AC1EFC0.6020801@gmx.at> In-Reply-To: <5AC1EFC0.6020801@gmx.at> X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.9.1 (1003210) [OL 16.0.4666.0 (x86)] Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=8850 signatures=668697 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=710 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1711220000 definitions=main-1804020149 X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 31020 Cc: 31020@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) > So what you can do is the following: Make a frame with a _visibly > unwrapped_ menu bar, get the menu bar height via > (cddr (assq 'menu-bar-size (frame-geometry))) >=20 > Do the same for a frame with a _visibly wrapped_ two-lines menu bar. > You can now derive the height of the single-line and any additional > menu bar line and use these values together with 'frame-geometry' for > getting the actual number of lines. That's good to know; thanks. But I don't think it will help code that has only a given frame to examine, e.g., code that doesn't want to bother some user by creating or resizing frames to determine this. And anyway, the _code_ cannot, by itself, tell the _visibly wrapped_ condition. IOW, that suggestion might help a user to determine, by looking, what the situation is. But I don't see how I could use in from Lisp to know what the situation is. Let me know, if I'm missing something simple. > Obviously, this will work only as long as you do not change themes, > the menu bar height of the current theme or the resolution of your > screen or whatever else could affect this. And since you have to > visuallly check the "wrappedness" of the menu bar, this work cannot be > reasonably done from within Emacs. Ah, that's just what I meant above. Thanks for confirming. From debbugs-submit-bounces@debbugs.gnu.org Tue Apr 03 02:49:40 2018 Received: (at 31020) by debbugs.gnu.org; 3 Apr 2018 06:49:40 +0000 Received: from localhost ([127.0.0.1]:35711 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1f3FlE-0005k0-F1 for submit@debbugs.gnu.org; Tue, 03 Apr 2018 02:49:40 -0400 Received: from mout.gmx.net ([212.227.15.19]:60895) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1f3FlD-0005jp-L7 for 31020@debbugs.gnu.org; Tue, 03 Apr 2018 02:49:39 -0400 Received: from [192.168.1.100] ([212.95.5.238]) by mail.gmx.com (mrgmx002 [212.227.17.190]) with ESMTPSA (Nemesis) id 0MJBEo-1f4uRv1XdS-002o1J; Tue, 03 Apr 2018 08:49:29 +0200 Message-ID: <5AC323F2.9060903@gmx.at> Date: Tue, 03 Apr 2018 08:49:22 +0200 From: martin rudalics MIME-Version: 1.0 To: Drew Adams , Eli Zaretskii Subject: Re: bug#31020: 27.0; Please provide a way to know about menu-bar wrapping References: <<37c99926-a5e5-4fa8-b734-6f9c146740e9@default>> <<837epq6sxx.fsf@gnu.org>> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K0:Erejnoq/w346dUrqxdRchKHs45HtK0XKlYy969woOtykrSDx0/j 2GzHCVJ7P2uXuUh8jFnbrPDaIV6IAKI/MqyvEZ/pGIoCpYBPvcVOFB4sNsVK6pFLkBS9U2g GPThhRyNYSjT47RfZwKoxnxA85hBImBaZYsFe4nBDw/Pe3MPdSU6hHjj9ny0UVUDRqAWsLo w8Vnd+nCut5UVjlGoYI3Q== X-UI-Out-Filterresults: notjunk:1;V01:K0:M0ChiseQlWs=:u8ARINZEjTOZBJjjKRSZhJ ewoFMQpnDNFTVKdEtxT0MV31DlHuOF5aPweJ/v7+xuOKlNutz+4Eo5ZaNmHr7i88evGufdD44 pgi1MaQfbTTIFM/M6/dsyy974NWUAyF62rNcWIz5hJIE4aGacKrUZ+6duKF89cjoUbQl0h6da 8h3rsKarJSpgmkv2D4OvG2GzQd9nZw7NTFZSdO+yt8ZJdTvudPwQhxeFj00grdmTjiulY+0jz jpRXfOzNQ5qFZSzFycOftviwm6ezvUOXBrIJM/hx3++6m1iUOAJk47Wz9dDkTr58wjCBn9rcx 2KBDJRtgzcpR+K2oDAdpk6BTo7JFKIDnfM5x6eTn2RZjJ+dyHhVEjLVDxijEpwM7ap9tFiolE 0y/d9pania41CQhgQAYEBbcemlbUhwjBQJwhqLDv8zjUgEcfm3KloMUthmcPE/8spd2sPmsll b0/FkUhN0IbK14aBKGrWnVLaLNyQRdxUpR+gWDt0dD1LcgPDPmAtTtN/iHt7EGwJC3HjQHXTj abEgkPt4Ar1OvCD26EHE0mdPBt1xCoMAWEd311TftNaWNoJMqH6TGE4VNg0PpClK8xDQUt9rO rq9TO+ZdWNHRg/S1GWzUfvV2rldVc96cf1zA0tEhF21bTemOviazI7NtAxJb5sbEo1TMD6mWj ZAgOE/HYgiIf4o0FVaPBoYqiIHR0AJbIIjeXnzW/jBBc/ysTSNkPLH/c01HVXPFC/tPtI6SH/ +j7CwqmGIVjSXvA5H2TfQvFBCv5PWlFqHL7ERZTpu07zcnwIdNUq7K70HZ1T1AKX5WpIxaBAK XCLNzs4QwieLNZyndo78TupiOn/3BGAmFNqnFs0H93TZE1uamw= X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 31020 Cc: 31020@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) > The problem, at least on MS Windows, is that the > menu-bar wraps, and there is no way (AFAIK) to know > from Lisp who many actual lines are currently used > to show the menu-bar. > > This is an old problem, as you know. It would be > really good to finally put it to bed, if possible. Can you tell me one practical case where you want to know how many lines are used to show the menu bar? martin From debbugs-submit-bounces@debbugs.gnu.org Tue Apr 03 10:33:47 2018 Received: (at 31020) by debbugs.gnu.org; 3 Apr 2018 14:33:47 +0000 Received: from localhost ([127.0.0.1]:37185 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1f3N0N-0005vl-0Y for submit@debbugs.gnu.org; Tue, 03 Apr 2018 10:33:47 -0400 Received: from aserp2130.oracle.com ([141.146.126.79]:56534) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1f3N0L-0005va-RS for 31020@debbugs.gnu.org; Tue, 03 Apr 2018 10:33:46 -0400 Received: from pps.filterd (aserp2130.oracle.com [127.0.0.1]) by aserp2130.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w33EHrjC171939; Tue, 3 Apr 2018 14:33:39 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=mime-version : message-id : date : from : sender : to : cc : subject : references : in-reply-to : content-type : content-transfer-encoding; s=corp-2017-10-26; bh=hvyNL7nVRuGNkyynW9AlQSI6xYgQ0WHd1Dh+ZQ98rew=; b=vsnvRijO/Coyo7jOOOdZio0iZULxRjt9scKdiCz1IgFEy4kvMEX2bSA/uaMpXB/Kti+o C7EpkE3isDakBqiK5kK1P7Uk57ErKJ8txqXxPjl3UEWqHf9kb66pWP2vW6Pl5pSH17y/ +tNB8ki4F01WDO6gxd9Qfh8tN9xQcpnLsyvvMKdUCjWzGdz1nKLQXNdvm6MB61jAktvK OKK9aJLslo2o6wPxOn+DZpyC0gz8urRRHVrwERpnQB6l1HXCC2oC/OVvef4Vj1wJoffn SekTBWlk5KuGnuNRCGBtTCqtBlxaWvnTglJKOKclKfhSl6AXUyshQnf6qf3IsDNnDfp2 IQ== Received: from userv0021.oracle.com (userv0021.oracle.com [156.151.31.71]) by aserp2130.oracle.com with ESMTP id 2h4b8jr5cm-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 03 Apr 2018 14:33:39 +0000 Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by userv0021.oracle.com (8.14.4/8.14.4) with ESMTP id w33ESaFK003849 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 3 Apr 2018 14:28:37 GMT Received: from abhmp0015.oracle.com (abhmp0015.oracle.com [141.146.116.21]) by aserv0122.oracle.com (8.14.4/8.14.4) with ESMTP id w33ESYsY026606; Tue, 3 Apr 2018 14:28:34 GMT MIME-Version: 1.0 Message-ID: <5ab23eb3-9744-4175-b15c-b3feee653876@default> Date: Tue, 3 Apr 2018 07:28:32 -0700 (PDT) From: Drew Adams To: martin rudalics , Eli Zaretskii Subject: RE: bug#31020: 27.0; Please provide a way to know about menu-bar wrapping References: <<37c99926-a5e5-4fa8-b734-6f9c146740e9@default>> <<837epq6sxx.fsf@gnu.org>> <5AC323F2.9060903@gmx.at> In-Reply-To: <5AC323F2.9060903@gmx.at> X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.9.1 (1003210) [OL 16.0.4666.0 (x86)] Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=8851 signatures=668697 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=832 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1711220000 definitions=main-1804030148 X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 31020 Cc: 31020@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) > > The problem, at least on MS Windows, is that the > > menu-bar wraps, and there is no way (AFAIK) to know > > from Lisp who many actual lines are currently used > > to show the menu-bar. > > > > This is an old problem, as you know. It would be > > really good to finally put it to bed, if possible. >=20 > Can you tell me one practical case where you want to > know how many lines are used to show the menu bar? Yes. But you'll perhaps tell me to do things another way (e.g., pixelwise). ;-) My fit-frame.el code changes a frame's width and height to fit the buffer text. It also takes into account things like `menu-bar-lines' and `tool-bar-lines'. It does its work using chars, i.e., lines and columns, not pixels. If the frame before fitting is narrow enough that the menu-bar is wrapped, and if the frame is narrower than its fit width (the width it will be fit to, based on max line length), then the resulting height is slightly greater than when the menu-bar is not wrapped. (The latter height is what I want.) This has the effect that two different resulting frame heights are possible, depending on whether the menu is wrapped. So the action is not idempotent if the bar is wrapped (and the max line length is wider than the unwrapped menu-bar width): The first `fit-frame' makes the frame a bit taller; the second and subsequent calls to `fit-frame' make it the right height. (All calls give it the right width.) If my code could know how many _effective_ (i.e., visual) `menu-bar-lines' were currently present then it would just DTRT. HTH. From debbugs-submit-bounces@debbugs.gnu.org Wed Apr 04 03:50:11 2018 Received: (at 31020) by debbugs.gnu.org; 4 Apr 2018 07:50:11 +0000 Received: from localhost ([127.0.0.1]:37569 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1f3dBK-0007z7-V3 for submit@debbugs.gnu.org; Wed, 04 Apr 2018 03:50:11 -0400 Received: from mout.gmx.net ([212.227.17.22]:47853) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1f3dBI-0007yu-HC for 31020@debbugs.gnu.org; Wed, 04 Apr 2018 03:50:08 -0400 Received: from [192.168.1.100] ([212.95.5.201]) by mail.gmx.com (mrgmx103 [212.227.17.168]) with ESMTPSA (Nemesis) id 0MRocn-1exPvL0gmX-00Sy0M; Wed, 04 Apr 2018 09:49:58 +0200 Message-ID: <5AC4839C.3030501@gmx.at> Date: Wed, 04 Apr 2018 09:49:48 +0200 From: martin rudalics MIME-Version: 1.0 To: Drew Adams , Eli Zaretskii Subject: Re: bug#31020: 27.0; Please provide a way to know about menu-bar wrapping References: <<37c99926-a5e5-4fa8-b734-6f9c146740e9@default>> <<837epq6sxx.fsf@gnu.org>> <5AC323F2.9060903@gmx.at> <5ab23eb3-9744-4175-b15c-b3feee653876@default> In-Reply-To: <5ab23eb3-9744-4175-b15c-b3feee653876@default> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K0:Y/mHHew4oKLHk5itoYPgrSHHEeci1HSg9Otg9SjBR3iZpmV4S49 YdKhYnrDwYg+dMvz097RaKNtd4l45gN0CHo8WPTLSJ18BHQAqYvBafSMlqisSB8qm8CUm60 2ruwFuJrQYr88lCdJr1RoCFeyr57+kkaOGJAjqhjmwsdZBCDUIyEDkfmZH26cNrayexQG8H 3bTQJYNeFtNwXESj8SmIA== X-UI-Out-Filterresults: notjunk:1;V01:K0:66fRutLIalA=:wBJV9iwycQVk4F2wc5c2q/ NHsPi4TALrorFz7cW9b9TMbH95N5FbRXlIhfhjv4AhkqFpv/5tMdOFkHVZbaLrFXYu+eTaBX3 16hOrcPUllnH/GMqqDl8HdxDVN+iwdZgvKRdpg18o/SVMXGykazJEWsL90l+vzLu8H5z17TlO Ek2N06wxcAjZNY+T5zATgqxIkr569S8iYUgXi5FpE2pEDrhaRLM1VoYGwhQ5MJkRgOU7xfwLL tXQuC6BtcOvdLbMlsKMjtMLof+aOxG2ZbqkjhNRxcf/AuTWrhhwUsEmUse2V8wBOVcWugh8jh s5T9DEbIG3LZ0IHPkEHhtd7N1fNDR1Eg9xNl4RU1ZGq1Yz2Fa6Q1c2XM1KPPd9Olc4N8jGjfE W8ZBUcvnKIayVBWsQrANX/Lz2zVvOlxQkdP/cggaVbaWGxS+SdOglDS9Ou7AQgGCWzvh9tdvq N2ER3JROsvCI+D5wWE0+gJ9q+JaX0xk8ZmOz5pbxziDBnml0FmVpCSiOhGXPnJ1I3zKWUxcVB dwQFVJ0QQN6j6eDM/N+VR+Ye14wWKMURPnqZjRz0hz636wOBC9zCx4HLJugwvX7ycSMTmAKuh LvmobrqEW3lrLaIgnj4vrylCL3dhCmV0rUvdz3L70b7mt+tnGPRT8FjcwQs8OkBipLwfrmF0g M0nMjCP42A7aOvLWAQZyUwvz8uyMK0IUdV2WoqRuMoIDRhj5qrhYtkjErsuRpHKba1BMe6edI Uj1NgxsigFXXH1oAlleDpCQBpRpy5m6yszXbgJFTBjFOCe2/LlipvDbOSeN7Z/kdg9nfpbw4Y k1+cjv8SrbZxWwW0IzyJiknStwiWmpvq3CMQF8HkrHAfmdL1rjtChyiRnXQhD9sQWPI5Q5/ X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 31020 Cc: 31020@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) > Yes. But you'll perhaps tell me to do things another > way (e.g., pixelwise). ;-) I'm afraid that both approaches might face similar problems. > If my code could know how many _effective_ (i.e., > visual) `menu-bar-lines' were currently present then > it would just DTRT. Why don't you try to divide the value of (cddr (assq 'menu-bar-size (frame-geometry))) by 'frame-char-height'? IIUC the character height used by a toolkit for drawing the menu bar is of no use to you anyway. But to fit a frame you (and the pixelwise fitter as well) would have to be able to tell _in advance_ whether the menu bar will wrap. And this is impossible since at least on a proprietary system like Windows you would have to know which algorithm it uses for aligning menu bar elements. Or am I missing something? martin From debbugs-submit-bounces@debbugs.gnu.org Sat Sep 28 14:42:54 2019 Received: (at 31020) by debbugs.gnu.org; 28 Sep 2019 18:42:54 +0000 Received: from localhost ([127.0.0.1]:51255 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iEHgE-0002Vt-86 for submit@debbugs.gnu.org; Sat, 28 Sep 2019 14:42:54 -0400 Received: from mail-pl1-f177.google.com ([209.85.214.177]:45140) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iEHgC-0002VX-EV for 31020@debbugs.gnu.org; Sat, 28 Sep 2019 14:42:52 -0400 Received: by mail-pl1-f177.google.com with SMTP id u12so2309365pls.12 for <31020@debbugs.gnu.org>; Sat, 28 Sep 2019 11:42:52 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to:cc; bh=OIAIIaj2hHDkckrUbUZSI5KtYPdg7TWzUMwOv4ZugPs=; b=XqNvEvdPqsKyzVnYwZ7+dT5iDy3vSRsWI+VqMCbxvIhWlp57YPSqaWkfRTRIQ/PGU7 qx+IugFlbfoVuTsK/1yrtD6v9uc++ST4Gi+d9jP5LuG6hQuIszc7++/WNgV76JwMey3a fGWmk66FZ93SwUjR2RSQfzERRkG4lR1O7oyhED2cMRJW3e2G0V7FATmtzqNGWsrWZ/Lv z9VZmTd/zpJMEM8KKWLyGk5kuEUEW+PpVUtmvSWBHZKjC1UZC3+oThde8cc6vO3bFvvE 7NSCObloSMnLEt9+Yy0eqoUKO22sZFgF/OzNtwkUy9vTEZWrehr8q+cpQCzn+Ao5cH3H eVUQ== X-Gm-Message-State: APjAAAXtK1uS3ARY18piZBpZXkVT9tG2viyjFcR33mY9akwB5qLcETwN VV9JdL0P7UNjh/D7mqvxjuI1weYElifbFRWwyuE= X-Google-Smtp-Source: APXvYqz7zk3Ly7z5J4lp6c4B72Esp7p62+7a0x5Q/tJfrLl4F6NpuDgwzrTuReETutpUrM3u6C0kB/BcHhegygf70T8= X-Received: by 2002:a17:902:a515:: with SMTP id s21mr12155165plq.259.1569696166718; Sat, 28 Sep 2019 11:42:46 -0700 (PDT) MIME-Version: 1.0 From: Stefan Kangas Date: Sat, 28 Sep 2019 20:42:35 +0200 Message-ID: Subject: Re: bug#31020: 27.0; Please provide a way to know about menu-bar wrapping To: martin rudalics Content-Type: text/plain; charset="UTF-8" X-Spam-Score: 0.4 (/) X-Debbugs-Envelope-To: 31020 Cc: 31020@debbugs.gnu.org, Eli Zaretskii , Drew Adams X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.6 (/) tags 31020 + wontfix close 31020 quit martin rudalics writes: >> I don't understand why you think that the menu-bar-lines parameter >> should not be it. AFAIU, the problem with setting it (or any other >> frame parameter) to the actual value is that with many toolkits Emacs >> simply doesn't know the correct value. But maybe Martin will have >> some trick up his sleeves. > > I am not aware of any toolkit telling us that number or whether the > current menu bar was wrapped at all. It's nowhere in the various API > descriptions and I suppose the information usually gets lost somewhere > in between calculations of which font the user's theme wants for the > menu bar and how that affects wrapping. I'm not even sure whether > some toolkit would deliberately truncate our menu bar when it doesn't > fit into one line. And lets not talk about GTK auto-resizing our > frame when the menu bar gets too long. > > So what you can do is the following: Make a frame with a _visibly > unwrapped_ menu bar, get the menu bar height via > > (cddr (assq 'menu-bar-size (frame-geometry))) > > Do the same for a frame with a _visibly wrapped_ two-lines menu bar. > You can now derive the height of the single-line and any additional > menu bar line and use these values together with 'frame-geometry' for > getting the actual number of lines. > > Obviously, this will work only as long as you do not change themes, > the menu bar height of the current theme or the resolution of your > screen or whatever else could affect this. And since you have to > visuallly check the "wrappedness" of the menu bar, this work cannot be > reasonably done from within Emacs. It seems like the conclusion here is that the feature suggestion is not practical, so I'm closing it as wontfix. If this is incorrect, please reopen the bug. Best regards, Stefan Kangas From unknown Wed Jul 30 13:14:32 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Sun, 27 Oct 2019 11:24:05 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator