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

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

bug#15902: 24.3.50; Auto-save file not deleted when quitting Emacs (and


From: Nicolas Richard
Subject: bug#15902: 24.3.50; Auto-save file not deleted when quitting Emacs (and saying "don't save")
Date: Sat, 16 Nov 2013 21:15:42 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux)


"Sebastien Vauban" <sva-news-D0wtAvR13HarG/iDocfnWg@public.gmane.org>
writes:

>     Modified buffers exist; exit anyway?
>
> I answer "yes".

FWIW, I (almost) never answer yes in that situation, because I don't
know which buffers are modified (or worse : I probably think I know, and
I might be wrong). So I usually say "no", then navigate through each
"unmodified" buffer (using an #emacs provided command, see below) and
act there.

Here's the mentionned defun :

(defun select-next-modified-buffer ()
  "Select next modified (unsaved) buffer."
  ;; 2012-09-24 22:40 <jlf>  (#emacs on freenode)
  (interactive)
  (let ((modified-buffers
         (remove-if-not (lambda (buf) (and
                                       (buffer-file-name buf) 
(buffer-modified-p buf)))
                        (buffer-list))))
    (if modified-buffers
        (switch-to-buffer (first modified-buffers))
      (message "No modified file-visiting buffers!"))))

-- 
Nico.






reply via email to

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