[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Number of open buffers?

From: Johan Bockgård
Subject: Re: Number of open buffers?
Date: Thu, 20 Nov 2003 23:42:06 +0100
User-agent: Gnus/5.1003 (Gnus v5.10.3) Emacs/21.2 (usg-unix-v)

David Kastrup <> writes:

> Somewhat shorter:
> (defun get-number-of-file-buffers ()
>   (interactive)
>   (let ((num 0))
>     (dolist (buf (buffer-list) num)
>       (when (buffer-file-name buf)
>           (setq num (1+ num))))))

If you are allowed to use `cl':

    (count-if 'buffer-file-name (buffer-list))

Johan Bockgård

reply via email to

[Prev in Thread] Current Thread [Next in Thread]