From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Drew Adams Newsgroups: gmane.emacs.bugs Subject: bug#31020: 27.0; Please provide a way to know about menu-bar wrapping Date: Tue, 3 Apr 2018 07:28:32 -0700 (PDT) Message-ID: <5ab23eb3-9744-4175-b15c-b3feee653876@default> References: <<37c99926-a5e5-4fa8-b734-6f9c146740e9@default>> <<837epq6sxx.fsf@gnu.org>> <5AC323F2.9060903@gmx.at> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1522765987 32000 195.159.176.226 (3 Apr 2018 14:33:07 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 3 Apr 2018 14:33:07 +0000 (UTC) Cc: 31020@debbugs.gnu.org To: martin rudalics , Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Apr 03 16:33:03 2018 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1f3Mze-0008Bn-DS for geb-bug-gnu-emacs@m.gmane.org; Tue, 03 Apr 2018 16:33:02 +0200 Original-Received: from localhost ([::1]:39156 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f3N1i-0005ZQ-7p for geb-bug-gnu-emacs@m.gmane.org; Tue, 03 Apr 2018 10:35:10 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:44603) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f3N0j-00050s-Ts for bug-gnu-emacs@gnu.org; Tue, 03 Apr 2018 10:34:11 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1f3N0c-0005pJ-8E for bug-gnu-emacs@gnu.org; Tue, 03 Apr 2018 10:34:09 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:57521) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1f3N0c-0005p7-49 for bug-gnu-emacs@gnu.org; Tue, 03 Apr 2018 10:34:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1f3N0b-0005wF-Oz for bug-gnu-emacs@gnu.org; Tue, 03 Apr 2018 10:34:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Drew Adams Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 03 Apr 2018 14:34:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 31020 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 31020-submit@debbugs.gnu.org id=B31020.152276602722806 (code B ref 31020); Tue, 03 Apr 2018 14:34:01 +0000 Original-Received: (at 31020) by debbugs.gnu.org; 3 Apr 2018 14:33:47 +0000 Original-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 Original-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 Original-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== Original-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 Original-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 Original-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 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)] 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-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 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.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:144852 Archived-At: > > 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.