From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: bojohan+news@dd.chalmers.se (=?iso-8859-1?q?Johan_Bockg=E5rd?=) Newsgroups: gmane.emacs.help Subject: Re: Number of open buffers? Date: Thu, 20 Nov 2003 23:42:06 +0100 Organization: Chalmers University of Technology, Sweden Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Message-ID: References: NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Trace: sea.gmane.org 1069369674 30944 80.91.224.253 (20 Nov 2003 23:07:54 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 20 Nov 2003 23:07:54 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Nov 21 00:07:52 2003 Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1AMxtw-0007xD-00 for ; Fri, 21 Nov 2003 00:07:52 +0100 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.24) id 1AMyoN-0001Nb-1y for geh-help-gnu-emacs@m.gmane.org; Thu, 20 Nov 2003 19:06:11 -0500 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!news.tele.dk!news.tele.dk!small.news.tele.dk!uninett.no!news.eunet.no!newsfeed2.fi.sn.net!fi.sn.net!newsfeed1.fi.sn.net!newsfeed1.funet.fi!newsfeeds.funet.fi!62.127.77.83.MISMATCH!'newsfeed1.telenordia.se'!algonet!newsfeed.sunet.se!news01.sunet.se!dd.chalmers.se!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 18 Original-NNTP-Posting-Host: frealaf.dd.chalmers.se Mail-Copies-To: never User-Agent: Gnus/5.1003 (Gnus v5.10.3) Emacs/21.2 (usg-unix-v) Cancel-Lock: sha1:w9cZtyygWfkt+2nih2klgLYlwR0= Original-Xref: shelby.stanford.edu gnu.emacs.help:118512 Original-To: help-gnu-emacs@gnu.org X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.2 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.help:14453 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:14453 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