all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Drew Adams <drew.adams@oracle.com>
To: martin rudalics <rudalics@gmx.at>, Eli Zaretskii <eliz@gnu.org>
Cc: 31020@debbugs.gnu.org
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)	[thread overview]
Message-ID: <5ab23eb3-9744-4175-b15c-b3feee653876@default> (raw)
In-Reply-To: <5AC323F2.9060903@gmx.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.
> 
> 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.





  reply	other threads:[~2018-04-03 14:28 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <<37c99926-a5e5-4fa8-b734-6f9c146740e9@default>
     [not found] ` <<837epq6sxx.fsf@gnu.org>
2018-04-02 13:25   ` bug#31020: 27.0; Please provide a way to know about menu-bar wrapping Drew Adams
2018-04-03  6:49     ` martin rudalics
2018-04-03 14:28       ` Drew Adams [this message]
2018-04-04  7:49         ` martin rudalics
2018-04-02  3:03 Drew Adams
2018-04-02  6:08 ` Eli Zaretskii
2018-04-02  8:54   ` martin rudalics
2018-04-02 13:32     ` Drew Adams
2019-09-28 18:42 ` Stefan Kangas

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5ab23eb3-9744-4175-b15c-b3feee653876@default \
    --to=drew.adams@oracle.com \
    --cc=31020@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    --cc=rudalics@gmx.at \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.