GNU bug report logs - #31020
27.0; Please provide a way to know about menu-bar wrapping

Previous Next

Package: emacs;

Reported by: Drew Adams <drew.adams <at> oracle.com>

Date: Mon, 2 Apr 2018 03:04:01 UTC

Severity: wishlist

Tags: wontfix

Found in version 27.0

Done: Stefan Kangas <stefan <at> marxist.se>

Bug is archived. No further changes may be made.

Full log


Message #23 received at 31020 <at> debbugs.gnu.org (full text, mbox):

From: Drew Adams <drew.adams <at> oracle.com>
To: martin rudalics <rudalics <at> gmx.at>, Eli Zaretskii <eliz <at> gnu.org>
Cc: 31020 <at> debbugs.gnu.org
Subject: RE: bug#31020: 27.0; Please provide a way to know about menu-bar
 wrapping
Date: Tue, 3 Apr 2018 07:28:32 -0700 (PDT)
>  > 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?

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.




This bug report was last modified 5 years and 278 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.