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

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

Re: Is there a way to close all buffers whose files have gone a way


From: Robert Pluim
Subject: Re: Is there a way to close all buffers whose files have gone a way
Date: Wed, 17 Aug 2022 10:14:35 +0200

>>>>> On Fri, 12 Aug 2022 20:37:16 +0200, Steinar Bang <sb@dod.no> said:

    Steinar> Is it possible to make emacs delete all buffers that no longer 
have an
    Steinar> underlying file?

Untested, but something like this:

(dolist (buf (buffer-list))
  (let ((name (buffer-file-name buf)))
    (and name (not (file-exists-p name))
         (kill-buffer buf))))

Robert
-- 



reply via email to

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