AbstProcDo · 2022-10-15 10:53
In vanilla emacs' eshell to run "buffer-list" which shows 8 buffers:
~ $ (enumerate (buffer-list))
((1 . #<buffer *eshell*>)
(2 . #<buffer *scratch*>)
(3 . #<buffer *Minibuf-1*>)
(4 . #<buffer *Minibuf-0*>)
(5 . #<buffer *code-conversion-work*>)
(6 . #<buffer *Echo Area 0*>)
(7 . #<buffer *Echo Area 1*>)
(8 . #<buffer *Messages*>))
I try to write into "\*Minibuf-0\*" and "\*Echo Area 0\*, it report no such buffers:
​
https://preview.redd.it/6asezh7sayt91.png?width=723&format=png&auto=webp&s=480c933646e15609b34d74f3cdf5af9522c884a3
why?
7890yuiop · 2022-10-15 12:51
> I try to write into "\*Minibuf-0\*" and "\*Echo Area 0\*, it report no such buffers
That's because you missed the space at the start of those names.
There can be any number of minibuffers. The zeroth is the permanently-empty-by-default buffer which is displayed when no other minibuffer is displayed.
Echo areas are displayed in the same window as the minibuffer (you see either a minibuffer or an echo area). I guess the numbering is similar, but I've never played with them directly.
AbstProcDo · 2022-10-15 12:54
but there's no leading spaces.
7890yuiop · 2022-10-15 12:59
There are, and we can *see* them in your own question. Emacs isn't indenting them for larks; there's a space. That's also what causes those buffers to be hidden from most UIs.
JDRiverRun · 2022-10-15 19:56
Buffers with a name which starts with a space are called "hidden buffers". They don't show up in normal buffer selection, so often you are not aware of their presence. Consult-buffer lets you type an initial space to narrow to *only* hidden buffers. Sometimes it's fun to see all the hidden buffers lurking in the background (41 for me at the moment). For example, org creates a hidden buffer in each of the modes found in source blocks to send text to for fontification. All sorts of temp buffers are in use for XML conversion. Tool tips like "mouse-1: Do Something" get fontified in their own hidden " \*tip\*" buffer. Etc.
AbstProcDo · 2022-10-16 00:29
>hidden buffers
thank you, I see them.
AbstProcDo · 2022-10-16 01:08
ty, it's amazing to notice emacs' invisible efforts.
7890yuiop · 2022-10-16 02:12
Note that whereas most languages only have "strings" for storing text, in emacs/elisp buffers provide an alternative textual data type, and they get used for all kinds of internal purposes. Some hidden buffers are there permanently, but buffers are being created and killed behind the scenes on a frequent basis.