Subject: Re: bug#28412: 26.0.50; Let save-some-buffers accept write-contents-functions

From: Eric Abrahamsen <[email-masked]>
Date: Mon, 18 Sep 2017 13:53:24 -0700

Kaushal Modi <[email-masked]> writes:

> On Mon, Sep 18, 2017 at 3:12 PM Eric Abrahamsen <[email-masked]> wrote:
>
>  Also, there don't appear to be any built-in functions or regexps for
>  dealing with "hidden" buffers, I'm assuming:
>
>  (not (string-prefix-p " " (buffer-name buffer)))
>
>  is okay?
>
> That crossed my mind too. So I had started looking for its existing implementation, and found this in buff-menu.el inside list-buffers--refresh function:
>
>     (string= (substring name 0 1) " ")
>
> I was wondering if that should be wrapped into a function like buffer-internal-p (based on the many docstrings like below in buff-menu.el: "By default, the Buffer Menu lists all buffers except those whose names start with a space
> (which are for internal use)."). Having a function like this would be better than having that logic implemented in different ways in the emacs core.
>
> I just don't know the best place to put this function definition. Eli?

It might be nice to have something like:

(defsubst buffer-internal-p (buf)
  (eq (aref (buffer-name buf) 0) ?\s))