[Top][All Lists]

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

erase current file from disk

From: Emanuel Berg
Subject: erase current file from disk
Date: Thu, 02 Jun 2016 15:21:20 -0000
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4 (gnu/linux)

Let's see if I can reach (or
actually the mailing list) by way of

Here is something I have thought about doing, and
now I've done it:

    (defun delete-current-file ()
      (let*((file   (buffer-file-name))
            (prompt (format "delete %s on disk? " file)) )
        (when (yes-or-no-p prompt)
          (delete-file file) )))
    (defalias 'delete-this-file 'delete-current-file)

Useful for example when you open a file - Emacs says
it "has auto save data; consider M-x
recover-this-file", you get the file up and see it
isn't anything to loose, you fire off the defun and
all that gone.

underground experts united ....
Emacs Gnus Blogomatic .........
                   - so far: 30 Blogomatic articles -                   

reply via email to

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