From: Bastian Beranek <bastian.beischer@gmail.com>
To: martin rudalics <rudalics@gmx.at>
Cc: 46299@debbugs.gnu.org, Juri Linkov <juri@linkov.net>
Subject: bug#46299: 28.0.50; Value of tab-bar-show not respected in new frames.
Date: Tue, 9 Feb 2021 10:23:33 +0100 [thread overview]
Message-ID: <CAK9AuB8Cu+MU3twKs7iCez=vu2P1RrUz+f-X_aZMwB_8c8qsXg@mail.gmail.com> (raw)
In-Reply-To: <38b988fd-2ad6-a596-23a0-1d765249f718@gmx.at>
Hello Martin,
On Tue, Feb 9, 2021 at 9:58 AM martin rudalics <rudalics@gmx.at> wrote:
>
> > I'll do my best to update the docstring. Note that I do not contribute
> > to emacs often, nor do I regularly code in elisp, so I'm not familiar
> > with the conventions and you are encouraged to modify my changes as
> > you see fit.
>
> Don't worry. These "-lines" frame parameters are a minefield - we just
> should try to clarify things the best possible way while you're working
> on it.
I see.
>
> > (defun tab-bar--tab-bar-lines-for-frame (frame)
> > - "Compute the correct value of tab-bar-lines for the given frame."
> > + "Compute the correct value of tab-bar-lines for FRAME."
>
> But what "is" the correct value and why and how would we want to
> "compute" it?
How about this:
diff --git a/lisp/tab-bar.el b/lisp/tab-bar.el
index 9666fb2460..1fc8537ccf 100644
--- a/lisp/tab-bar.el
+++ b/lisp/tab-bar.el
@@ -135,7 +135,11 @@ Possible modifier keys are `control', `meta',
`shift', `hyper', `super' and
tab-bar-close-button)))
(defun tab-bar--tab-bar-lines-for-frame (frame)
- "Compute the correct value of tab-bar-lines for the given frame."
+ "Determine the value of tab-bar-lines for FRAME.
+The returned value will either be 1 or 0, meaning whether to show
+the tab-bar or not. If tab-bar-mode is off, the returned value is
+0. Otherwise the result depends on the value of the customizable
+variable `tab-bar-show'."
(if (not tab-bar-mode)
0
(cond
@@ -145,10 +149,10 @@ Possible modifier keys are `control', `meta',
`shift', `hyper', `super' and
(t 0))))
(defun tab-bar--update-tab-bar-lines (&optional frame)
- "Update frame parameter tab-bar-line.
-When the optional frame parameter is omitted all frames as well
-as the default for new frames are updated. Otherwise only the
-given frame is modified."
+ "Update the tab-bar-line parameter in frames.
+When the optional parameter FRAME is omitted all frames as well
+as the default for new frames are updated. Otherwise only FRAME
+is modified."
(if frame
;; Set frame parameters for the given frame
(set-frame-parameter frame 'tab-bar-lines
(tab-bar--tab-bar-lines-for-frame frame))
>
> > As far as I understand, tab-bar-lines is always just 1 or 0, meaning
> > whether to show the tab-bar at all or not. Maybe it would be better to
> > just rename the parameter? I guess if that is done then it does not
> > necessarily need further explanation in docstrings.
>
> That ship has sailed long ago. Neither the 'menu-bar-lines' nor the
> 'tool-bar-lines' parameters convey useful information in this regard and
> 'tab-bar-lines' just follows suit. Their only practical (and completely
> misguided IMHO) purpose is to show the corresponding bar by setting the
> parameter to a non-zero value and remove it by setting the parameter to
> zero.
>
> Sometimes, as with our native tool bars, their value gives the number of
> frame lines occupied by the bar. And very occasionally setting the
> parameter to a non-zero value can have strange effects: On a non-toolkit
> build setting menu-bar-lines to 7 will show six blank lines below a
> one-line menu bar which does not wrap anyway.
>
> In either case, we can hardly change the names of these frame parameters
> because they probably appear in too many applications and init files out
> there. We could state somewhere that these are, in fact, booleans and
> should be set and interpreted in that sense. Even that is not entirely
> trivial.
Makes sense!
>
> martin
Have a nice day
Bastian
next prev parent reply other threads:[~2021-02-09 9:23 UTC|newest]
Thread overview: 53+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-02-04 16:14 bug#46299: 28.0.50; Value of tab-bar-show not respected in new frames Bastian Beischer
2021-02-05 8:54 ` Juri Linkov
2021-02-05 10:10 ` Bastian Beranek
2021-02-05 14:11 ` Bastian Beranek
2021-02-06 12:16 ` Bastian Beranek
2021-02-07 19:05 ` Juri Linkov
2021-02-07 23:03 ` Bastian Beranek
2021-02-08 17:50 ` Bastian Beranek
2021-02-08 18:19 ` Juri Linkov
2021-02-08 19:04 ` Bastian Beranek
2021-02-09 8:00 ` martin rudalics
2021-02-09 8:15 ` Bastian Beranek
2021-02-09 8:58 ` martin rudalics
2021-02-09 9:23 ` Bastian Beranek [this message]
2021-02-09 9:45 ` martin rudalics
2021-02-09 11:44 ` Bastian Beranek
2021-02-09 17:32 ` martin rudalics
2021-02-09 18:06 ` Juri Linkov
2021-02-09 18:46 ` Bastian Beranek
2021-02-09 19:08 ` Eli Zaretskii
2021-02-09 19:01 ` Eli Zaretskii
2021-02-10 18:24 ` Juri Linkov
2021-02-11 12:14 ` Bastian Beranek
2021-02-11 17:34 ` Bastian Beranek
2021-02-12 9:31 ` Juri Linkov
2021-02-12 10:24 ` Bastian Beranek
2021-02-12 14:47 ` Bastian Beranek
2021-02-12 19:23 ` Bastian Beranek
2021-02-13 18:23 ` Juri Linkov
2021-02-13 19:02 ` Bastian Beranek
2021-02-13 19:46 ` Juri Linkov
2021-02-14 18:44 ` Juri Linkov
2021-02-15 10:05 ` Bastian Beranek
2021-02-15 15:26 ` Eli Zaretskii
2021-02-15 15:32 ` Bastian Beranek
2021-02-15 15:53 ` Eli Zaretskii
2021-02-16 10:40 ` Bastian Beranek
2021-02-14 13:08 ` Bastian Beranek
2021-02-14 18:50 ` Juri Linkov
2021-02-14 19:28 ` Juri Linkov
2021-02-15 8:16 ` martin rudalics
2021-02-15 9:07 ` Juri Linkov
2021-02-15 10:08 ` martin rudalics
2021-02-15 10:12 ` Bastian Beranek
2021-02-15 10:09 ` Bastian Beranek
2021-02-15 17:01 ` Juri Linkov
2021-02-15 22:10 ` Bastian Beranek
2021-02-16 2:08 ` bug#46299: [External] : " Drew Adams
2021-02-16 10:59 ` Bastian Beranek
2021-02-16 15:31 ` Bastian Beranek
2021-02-16 17:28 ` Juri Linkov
2021-02-24 18:46 ` Juri Linkov
2021-02-10 18:20 ` Juri Linkov
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
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CAK9AuB8Cu+MU3twKs7iCez=vu2P1RrUz+f-X_aZMwB_8c8qsXg@mail.gmail.com' \
--to=bastian.beischer@gmail.com \
--cc=46299@debbugs.gnu.org \
--cc=juri@linkov.net \
--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 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).