From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Jesper Harder Newsgroups: gmane.emacs.help Subject: Re: buffer-list and desktop Date: Wed, 10 Nov 2004 23:35:49 +0100 Organization: http://purl.org/harder/ Message-ID: References: <2vf8jiF2krb46U1@uni-berlin.de> <2vfhn9F2kl6jmU1@uni-berlin.de> NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1100176402 8464 80.91.229.6 (11 Nov 2004 12:33:22 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 11 Nov 2004 12:33:22 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Nov 10 23:41:36 2004 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1CS19j-0008LW-00 for ; Wed, 10 Nov 2004 23:41:36 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1CS1IC-0006Ju-P5 for geh-help-gnu-emacs@m.gmane.org; Wed, 10 Nov 2004 17:50:20 -0500 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!newsmi-us.news.garr.it!newsmi-eu.news.garr.it!NewsITBone-GARR!newscore.univie.ac.at!newsfeed1.uni2.dk!news.get2net.dk.POSTED!53ab2750!not-for-mail Original-Newsgroups: gnu.emacs.help X-Face: ^RrvqCr7c,P$zTR:QED"@h9+BTm-"fjZJJ-3=OU7.)i/K]<.J88}s>'Z_$r; List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.help:21889 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:21889 Kevin Rodgers writes: > Gotta get used to using with-current-buffer: > > (defun desktop-list-buffers () > "Return the list of buffers that `desktop-save' would save." > (nreverse > (apply 'nconc > (mapcar (lambda (buffer) > (with-current-buffer buffer > (if (desktop-save-buffer-p (buffer-file-name) > (buffer-name) > major-mode) > (list buffer)))) > (buffer-list))))) Or if you don't mind requiring cl: (delete-if-not (lambda (buf) (desktop-save-buffer-p (buffer-file-name buf) (buffer-name buf) (buffer-local-value 'major-mode buf))) (buffer-list)) -- Jesper Harder