Subject: bug#76789: 31.0.50; [PATCH] speedbar: New speedbar-window-mode

From: Eli Zaretskii <[email-masked]>
Date: Fri, 07 Mar 2025 08:50:23 +0200

> From: Vincenzo Pupillo <[email-masked]>
> Date: Thu, 06 Mar 2025 21:42:12 +0100
> 
> Ciao,
> this patch adds speedbar-window-mode as an alternative to the default 
> speedbar-frame-mode. Calling speedbar-window-mode will close speedbar-frame-
> mode if it is open, and vice versa.
> speedbar-window-mode, thanks to display-buffer-in-side-window, can be placed 
> on the left side, right side but also on the top or bottom. 

Thanks, a few comments below.

> +(defcustom speedbar-window-default-width 20
> +  "Initial width of `speedbar-window' under window system.
> +The default value is the same width of `speedbar-frame-mode'."
> +  :type 'integer
> +  :group 'speedbar
> +  :version "31.1")
> +
> +(defcustom speedbar-window-max-width 40
> +  "The maximum allowed `speedbar-window' width limit."
> +  :type 'integer
> +  :group 'speedbar
> +  :version "31.1")

These two options should document in their doc strings the units in
which the dimensions are measured.

> +(defun speedbar (&optional arg)
> +  "Open or close the `speedbar'.  Positive ARG means turn on, negative turn off.

The first line of a doc string should be a single complete sentence.

> +A nil ARG means toggle.  When `speedbar-prefer-window' open the
> +speedbar in a window istead of in a frame."

This should say what happens if speedbar-prefer-window is nil.  Also,
please don't use "when" to indicate a condition (as opposed to
something related to time), as it could be misinterpreted.

> +(defalias 'speedbar-frame 'speedbar-frame-mode)

This alias should be in NEWS.

Speedbar has its own manual.  Did you consider updating that manual
with this new feature?