Subject: bug#66285: suggestion: change definition of hycontrol--blank-buffer to something more meaningful

From: Dan Drake <[email-masked]>
Date: Sun, 1 Oct 2023 06:55:05 -0500

Here's an alternative suggestion: juse use the scratch buffer.

Many users, I think, always have a scratch buffer open. If
hycontrol-window-display-buffer runs out of buffers to display, instead of
creating new, empty, useless buffers, it seems reasonable to default to
displaying the scratch buffer. And if there's no such buffer, then fall
back to the blank one.

So, in addition to a more useful name, I propose the following snippet for
hycontrol-window-display-buffer:

    (set-window-buffer window
      (or buf
  ;; Out of buffers to display, display scratch buffer if it exists...
                           (get-buffer "*scratch*")
                           ;; ...otherwise, a blank buffer:
  hycontrol--blank-buffer))))

It just adds the single condition to the "or" to get the scratch buffer,
and gracefully falls back to existing behavior if there's no scratch buffer.

On Sat, Sep 30, 2023 at 5:35 PM Dan Drake <[email-masked]> wrote:

> Hello,
>
> A while back I posted this emacs.stackexchange question, about a
> mysterious buffer named BLANK which always appeared when I started emacs:
> https://emacs.stackexchange.com/q/78601/19526
>
> Today I figured out the source: see my answer to that question.
>
> It's still not clear how this BLANK buffer was getting created on startup,
> since I have no idea how hycontrol-window-display-buffer was getting
> called, but I'd like to suggest that the name of that blank buffer be
> changed to something that makes its source and purpose more obvious. Perhaps
>
> (defvar hycontrol--blank-buffer (get-buffer-create "
> *hycontrol--blank-buffer*")
>
> ? Any user who does hycontrol-windows-grid and triggers that will see the
> extra buffers with that name, and if such buffers just show up in the
> buffer list, it'll be obvious that they can safely be killed.
>
> I don't have any strong feelings about the name, just something more
> helpful and meaningful -- and searchable! -- than "BLANK".
>
> Regards,
>
> Dan
>
> --
> Ceci n'est pas une .signature.
> _______________________________________________
> Bug-hyperbole mailing list
> [email-masked]
> https://lists.gnu.org/mailman/listinfo/bug-hyperbole
>

-- 
Ceci n'est pas une .signature.