all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#16052: 24.3.50; `set-frame-parameter` broken for `tool-bar-lines`
@ 2013-12-04 15:01 Drew Adams
  2014-01-04 13:44 ` martin rudalics
  0 siblings, 1 reply; 5+ messages in thread
From: Drew Adams @ 2013-12-04 15:01 UTC (permalink / raw)
  To: 16052


emacs -Q

M-x set-variable RET pop-up-frames RET t
M-x tool-bar-mode ; turn it off, to start from zero
M-x pp-eval-expression RET (frame-parameters)

In frame *Pp Eval Output* search for `tool-bar-lines' => 0 (good).

In original frame (do all of the commands here, except isearch):

M-x tool-bar-mode ; turn it on
M-x pp-eval-expression RET (frame-parameters)

In frame *Pp Eval Output* search for `tool-bar-lines' => 2 (wrong).

In original frame (do all of the commands here, except isearch):

M-x pp-eval-expression RET (set-frame-parameter nil 'tool-bar-lines 1)
M-x pp-eval-expression RET (frame-parameters)

In frame *Pp Eval Output* search for `tool-bar-lines' => 2 (wrong).

In original frame (do all of the commands here, except isearch):

M-x pp-eval-expression RET (set-frame-parameter nil 'tool-bar-lines 3)
M-x pp-eval-expression RET (frame-parameters)

In frame *Pp Eval Output* search for `tool-bar-lines' => 2 (wrong).

etc.  It seems that the `tool-bar-lines' is always either 0 or 2.


In GNU Emacs 24.3.50.2 (i686-pc-mingw32)
 of 2013-11-28 on LEG570
Bzr revision: 115271 rgm@gnu.org-20131128203155-qjc1xsp19z2k64b2
Windowing system distributor `Microsoft Corp.', version 6.1.7601
Configured using:
 `configure --enable-checking 'CFLAGS=-O0 -g3' CPPFLAGS=-DGLYPH_DEBUG=1'





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

* bug#16052: 24.3.50; `set-frame-parameter` broken for `tool-bar-lines`
  2013-12-04 15:01 bug#16052: 24.3.50; `set-frame-parameter` broken for `tool-bar-lines` Drew Adams
@ 2014-01-04 13:44 ` martin rudalics
  2014-01-04 16:08   ` Drew Adams
  0 siblings, 1 reply; 5+ messages in thread
From: martin rudalics @ 2014-01-04 13:44 UTC (permalink / raw)
  To: Drew Adams; +Cc: 16052

> emacs -Q
>
> M-x set-variable RET pop-up-frames RET t
> M-x tool-bar-mode ; turn it off, to start from zero
> M-x pp-eval-expression RET (frame-parameters)
>
> In frame *Pp Eval Output* search for `tool-bar-lines' => 0 (good).
>
> In original frame (do all of the commands here, except isearch):
>
> M-x tool-bar-mode ; turn it on
> M-x pp-eval-expression RET (frame-parameters)
>
> In frame *Pp Eval Output* search for `tool-bar-lines' => 2 (wrong).
>
> In original frame (do all of the commands here, except isearch):
>
> M-x pp-eval-expression RET (set-frame-parameter nil 'tool-bar-lines 1)
> M-x pp-eval-expression RET (frame-parameters)
>
> In frame *Pp Eval Output* search for `tool-bar-lines' => 2 (wrong).
>
> In original frame (do all of the commands here, except isearch):
>
> M-x pp-eval-expression RET (set-frame-parameter nil 'tool-bar-lines 3)
> M-x pp-eval-expression RET (frame-parameters)
>
> In frame *Pp Eval Output* search for `tool-bar-lines' => 2 (wrong).
>
> etc.  It seems that the `tool-bar-lines' is always either 0 or 2.

Before using terms like "wrong" in bug reports please consult the Elisp
manual:

    On each frame, the frame parameter `tool-bar-lines' controls how
many lines' worth of height to reserve for the tool bar.

What you see is either 0 when `tool-bar-mode' is turned off or 2 which
probably comes from the actual toolbar pixel height divided by the
frame's default line height.  Explicitly setting the `tool-bar-lines'
parameter has no effect when `auto-resize-tool-bars' is non-nil (which
it is with emacs -Q).

martin






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

* bug#16052: 24.3.50; `set-frame-parameter` broken for `tool-bar-lines`
  2014-01-04 13:44 ` martin rudalics
@ 2014-01-04 16:08   ` Drew Adams
  2014-01-04 16:39     ` martin rudalics
  0 siblings, 1 reply; 5+ messages in thread
From: Drew Adams @ 2014-01-04 16:08 UTC (permalink / raw)
  To: martin rudalics; +Cc: 16052

> > M-x tool-bar-mode ; turn it on
> > M-x pp-eval-expression RET (frame-parameters)
> >
> > In frame *Pp Eval Output* search for `tool-bar-lines' => 2
> > (wrong).

> > M-x pp-eval-expression RET
> >     (set-frame-parameter nil 'tool-bar-lines 1)
> > M-x pp-eval-expression RET (frame-parameters)
> >
> > In frame *Pp Eval Output* search for `tool-bar-lines' => 2
> > (wrong).

> Before using terms like "wrong" in bug reports please consult the
> Elisp manual:
> 
>     On each frame, the frame parameter `tool-bar-lines' controls
>     how many lines' worth of height to reserve for the tool bar.

That does not contradict my expectation.  Is there some nuanced
interpretation of "reserved" that I need to guess here, such that
perhaps "reserving" that much height does not actually give the
tool bar area that much height?

And actually, node (elisp) `Layout Parameters' says that it is "the
number of lines to USE for the tool bar."  Not just reserved but
used.

Furthermore, it says explicitly that "The default is 1 if Tool Bar
mode is enabled, and 0 otherwise."  That pretty much describes the
intended default behavior, and it coincides with my uninformed
expectation.

> What you see is either 0 when `tool-bar-mode' is turned off or 2
> which probably comes from the actual toolbar pixel height divided
> by the frame's default line height.

What it really comes from should be *specified* in the manual.

IOW, what is the default number?  Otherwise, it is pretty reasonable
to assume (as I did) that the default is one.  Whether reasonable or
not, users should not need to guess the default behavior for the
on state.

And see above.  The manual in fact DOES say what the default is,
and it is not 2.  Is the manual wrong here or is the implementation
bugged in this regard?

> Explicitly setting the `tool-bar-lines' parameter has no effect
> when `auto-resize-tool-bars' is non-nil (which it is with emacs -Q).

Thanks for that explanation of what the implementation does.
However, that too is unlikely to be guessed by users.  And the doc
does not say that at all, AFAICT.  It says only that the tool bar
gets resized automatically.

All of the info regarding `tool-bar-lines' should be either
documented in the same place or clearly interconnected using cross
references.

Layout parameter `tool-bar-lines' is documented primarily in node
`Layout Parameters' - that it the reference doc for it.  At the
very least there needs to be a cross reference from there to node
`Tool Bar' (and vice versa).

And preferably it would be explicitly mentioned at `Layout
Parameters' what the effect is of `auto-resize-tool-bars' on
`tool-bar-lines' (the latter is ignored if the former is non-nil,
i.e., it is IGNORED by DEFAULT).

So if the behavior is as it is intended to be, then the doc is
inadequate.  It does not describe the behavior.  And what it does
suggest (i.e., by default, setting `tool-bar-lines' would do just
what the `tool-bar-lines' doc says: change the number of tool bar
lines) is something quite different from the actual behavior.





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

* bug#16052: 24.3.50; `set-frame-parameter` broken for `tool-bar-lines`
  2014-01-04 16:08   ` Drew Adams
@ 2014-01-04 16:39     ` martin rudalics
  2021-08-20 15:16       ` Lars Ingebrigtsen
  0 siblings, 1 reply; 5+ messages in thread
From: martin rudalics @ 2014-01-04 16:39 UTC (permalink / raw)
  To: Drew Adams; +Cc: 16052

 >> Before using terms like "wrong" in bug reports please consult the
 >> Elisp manual:
 >>
 >>     On each frame, the frame parameter `tool-bar-lines' controls
 >>     how many lines' worth of height to reserve for the tool bar.
 >
 > That does not contradict my expectation.  Is there some nuanced
 > interpretation of "reserved" that I need to guess here, such that
 > perhaps "reserving" that much height does not actually give the
 > tool bar area that much height?

No.  It's the term "lines' worth of height" you should have interpreted
correctly.

 >> What you see is either 0 when `tool-bar-mode' is turned off or 2
 >> which probably comes from the actual toolbar pixel height divided
 >> by the frame's default line height.
 >
 > What it really comes from should be *specified* in the manual.

Patches welcome.  Likely from someone who (1) uses toolbars and (2) on
most relevant platforms.

 > IOW, what is the default number?

One as stated.

 > Otherwise, it is pretty reasonable
 > to assume (as I did) that the default is one.  Whether reasonable or
 > not, users should not need to guess the default behavior for the
 > on state.
 >
 > And see above.  The manual in fact DOES say what the default is,
 > and it is not 2.

2 is not the default.  It's calculated from the font height you or your
system uses.

 > Is the manual wrong here or is the implementation
 > bugged in this regard?

Your bug report is bugged.

 > So if the behavior is as it is intended to be, then the doc is
 > inadequate.  It does not describe the behavior.  And what it does
 > suggest (i.e., by default, setting `tool-bar-lines' would do just
 > what the `tool-bar-lines' doc says: change the number of tool bar
 > lines) is something quite different from the actual behavior.

If you want to submit a patch, please do.  I only asked you to not use
the term "wrong" without consulting the manual first.  I read your
report and the manual and found the manual right and your report wrong.

martin





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

* bug#16052: 24.3.50; `set-frame-parameter` broken for `tool-bar-lines`
  2014-01-04 16:39     ` martin rudalics
@ 2021-08-20 15:16       ` Lars Ingebrigtsen
  0 siblings, 0 replies; 5+ messages in thread
From: Lars Ingebrigtsen @ 2021-08-20 15:16 UTC (permalink / raw)
  To: martin rudalics; +Cc: 16052

martin rudalics <rudalics@gmx.at> writes:

> If you want to submit a patch, please do.  I only asked you to not use
> the term "wrong" without consulting the manual first.  I read your
> report and the manual and found the manual right and your report wrong.

It seems like this is working as designed, so I'm closing this bug report.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





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

end of thread, other threads:[~2021-08-20 15:16 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-12-04 15:01 bug#16052: 24.3.50; `set-frame-parameter` broken for `tool-bar-lines` Drew Adams
2014-01-04 13:44 ` martin rudalics
2014-01-04 16:08   ` Drew Adams
2014-01-04 16:39     ` martin rudalics
2021-08-20 15:16       ` Lars Ingebrigtsen

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.