How to get the current number of buffers, excluding internal buffers, in Emacs?
I have it, but it looks confusing
;; number of buffers excluding internal buffers
(apply '+ (mapcar
(lambda (b)
(if (or (buffer-file-name b)
(not (string-equal (substring (buffer-name b) 0 1) " ")))
1 0))
(buffer-list)))
What he does is count the buffers that either visit the file, or the name does not start with a space.
I just want to add the number of buffers to the frame header.
source
share