[Top][All Lists]

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

Re: backup dired marks

From: Juanma Barranquero
Subject: Re: backup dired marks
Date: Fri, 22 Feb 2002 15:19:13 +0100

On Thu, 21 Feb 2002 18:49:49 +0100, Juanma Barranquero <address@hidden> wrote:

> Other than having in your .emacs something like that?

Sorry, that didn't work. This does, and is still easy.


(require 'cl)

(defvar dired-buffer-list nil)

(add-hook 'dired-mode-hook
          #'(lambda ()
              (add-to-list 'dired-buffer-list (current-buffer))
              (setq dired-buffer-list (delete-if-not #'buffer-live-p

(add-hook 'kill-emacs-query-functions
          #'(lambda ()
              (let (result)
                (dolist (buffer dired-buffer-list)
                  (when (and (buffer-live-p buffer)
                             (buffer-modified-p buffer))
                    (setq result (cons (buffer-name buffer) result))))
                (if result
                        (y-or-n-p (format "Modified dired buffers (%s), do you 
want to exit "
                                          (reduce #'(lambda (a b) (concat a ", 
" b)) result)))
                      (message nil))

reply via email to

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