bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#46299: 28.0.50; Value of tab-bar-show not respected in new frames.


From: Bastian Beranek
Subject: bug#46299: 28.0.50; Value of tab-bar-show not respected in new frames.
Date: Tue, 9 Feb 2021 09:15:50 +0100

Hey Martin,

On Tue, Feb 9, 2021 at 9:00 AM martin rudalics <rudalics@gmx.at> wrote:
>
>  > +  "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."
>
> This is confusing wrt our parameter/argument terminology.  Please just
> say "FRAME" wherever it stands for the function's argument and use
> "parameter of FRAME" when you talk about the frame parameter.

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.

I propose to change the docstring as follows:

diff --git a/lisp/tab-bar.el b/lisp/tab-bar.el
index 9666fb2460..2c3d976f28 100644
--- a/lisp/tab-bar.el
+++ b/lisp/tab-bar.el
@@ -135,7 +135,7 @@ 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."
+  "Compute the correct value of tab-bar-lines for FRAME."
  (if (not tab-bar-mode)
      0
    (cond
@@ -145,10 +145,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 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))

> Also
> please clarify: Does the value of the 'tab-bar-lines' parameter now
> stand for the number of (matrix) rows occupied by the tab bar (for
> example, 2 if the tab bar wraps once) or the number of frame lines
> calculated by dividing the pixel size of the tab bar by the frame's
> default line height?
>
> And finally: Why can't we wrap tab bars at tab boundaries so one tab
> never spans two lines unless it is too long for the frame (in which case
> it should be just truncated IMO).

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.

>
> martin

Bastian





reply via email to

[Prev in Thread] Current Thread [Next in Thread]