help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: buffer-list and desktop


From: Jesper Harder
Subject: Re: buffer-list and desktop
Date: Wed, 10 Nov 2004 23:35:49 +0100
User-agent: Gnus/5.110003 (No Gnus v0.3) Emacs/21.3.50 (gnu/linux)

Kevin Rodgers <ihs_4664@yahoo.com> 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                                <http://purl.org/harder/>


reply via email to

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