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: Kevin Rodgers
Subject: Re: buffer-list and desktop
Date: Wed, 10 Nov 2004 12:30:53 -0700
User-agent: Mozilla Thunderbird 0.9 (X11/20041105)

Matthias wrote:
> Is there a ready-made command, or package to list buffers that will be
> saved by desktop.el?

Here's a start:

(defun desktop-list-buffers ()
  "Return the list of buffers that `desktop-save' would save."
  (nreverse
   (apply 'nconc
          (mapcar (lambda (buffer)
                    (save-excursion
                      (set-buffer buffer)
                      (if (desktop-save-buffer-p (buffer-file-name)
                                                 (buffer-name)
                                                 major-mode)
                          (list buffer))))
                  (buffer-list)))))

--
Kevin Rodgers


reply via email to

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