unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#46178: 28.0.50; auto-resize-tool-bars / auto-resize-tab-bars grow-only
@ 2021-01-29 18:12 martin rudalics
  2021-01-29 20:09 ` Eli Zaretskii
  0 siblings, 1 reply; 6+ messages in thread
From: martin rudalics @ 2021-01-29 18:12 UTC (permalink / raw)
  To: 46178

With emacs -Q run a graphical build with a tab bar or an internal tool
bar (motif, lucid, no toolkit have the latter).  Do

(setq auto-resize-tab-bars 'grow-only)

and/or

(setq auto-resize-tool-bars 'grow-only)

Now make the frame very narrow so the tool and/or tab bar wrap(s)
around.  Expand the frame again, so the items on the bar(s) occupy one
line only.  You will see empty lines below the lines showing the items.

According to the doc-strings of the above options and the Elisp manual
you should now be able to use 'recenter' to get rid of these empty
lines:

   If value is ‘grow-only’, the tab-bar’s height is only increased
   automatically; to decrease the tab-bar height, use M-x recenter.

However, this doesn't work by default since in the following part of
'recenter'

       if (!NILP (redisplay)
	  && !NILP (Vrecenter_redisplay)
	  && (!EQ (Vrecenter_redisplay, Qtty)
	      || !NILP (Ftty_type (selected_frame))))
	{
	  ptrdiff_t i;

	  /* Invalidate pixel data calculated for all compositions.  */
	  for (i = 0; i < n_compositions; i++)
	    composition_table[i]->font = NULL;
#if defined (HAVE_WINDOW_SYSTEM)
	  WINDOW_XFRAME (w)->minimize_tab_bar_window_p = 1;
#endif
#if defined (HAVE_WINDOW_SYSTEM) && ! defined (HAVE_EXT_TOOL_BAR)
	  WINDOW_XFRAME (w)->minimize_tool_bar_window_p = 1;
#endif
	  Fredraw_frame (WINDOW_FRAME (w));
	  SET_FRAME_GARBAGED (WINDOW_XFRAME (w));

Vrecenter_redisplay is by default 'tty' and Ftty_type (selected_frame)
is nil, so the conjunct never becomes true and minimize_tab_bar_window_p
is never set to 1.

So we'd have to mention in the docs of this option that one can regain
these lines only by setting 'recenter-redisplay' to anything but the
default.  Better IMHO would be to abolish the never used and completely
useless 'grow-only' value for these options.

martin






^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2021-01-30 19:48 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-01-29 18:12 bug#46178: 28.0.50; auto-resize-tool-bars / auto-resize-tab-bars grow-only martin rudalics
2021-01-29 20:09 ` Eli Zaretskii
2021-01-30 10:18   ` martin rudalics
2021-01-30 14:17     ` Eli Zaretskii
2021-01-30 15:27       ` martin rudalics
2021-01-30 19:48         ` Eli Zaretskii

Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).