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

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

Re: Kill all visited buffers


From: Pascal J. Bourguignon
Subject: Re: Kill all visited buffers
Date: Sat, 21 Nov 2015 21:44:06 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux)

Tim Johnson <tim@akwebsoft.com> writes:

> Google has failed me. I'm looking for a way to programmatically kill
> all _visited_ buffers. 
>
> Any recommendations?

(require 'cl)
(mapc (function kill-buffer)
      (remove-if-not (lambda (buffer)
                       (and (buffer-file-name buffer)
                            (file-exists-p (buffer-file-name buffer))))
                     (buffer-list)))

-- 
__Pascal Bourguignon__                 http://www.informatimago.com/
“The factory of the future will have only two employees, a man and a
dog. The man will be there to feed the dog. The dog will be there to
keep the man from touching the equipment.” -- Carl Bass CEO Autodesk


reply via email to

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