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

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

bug#16954: 24.3.50; desktop.el: messages for autosaved files unnoticeabl


From: lee
Subject: bug#16954: 24.3.50; desktop.el: messages for autosaved files unnoticeable when desktop is restored
Date: Sat, 08 Mar 2014 01:33:32 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux)

lee <address@hidden> writes:

> It might also be nice to have a function that creates a buffer with a
> listing of all loaded files that have an autosave version.  One could
> then refer to the listing to clean things up.

FWIW:


(defcustom desktop-buffer-auto-save-file-list-name
  "*auto-save-files*"
  "Name of buffer to create a list of files for which auto-save
files exist.  The contents of this buffer are deleted every time
the list is created."
  :type '(string)
  :group 'desktop)


(defun desktop-make-auto-save-list ()
  "Replace, and thereby delete, all contents of buffer specified
through desktop-buffer-auto-save-file-list-name with a list of
files for which auto-save files exist and display the buffer.
When the buffer does not exist, it is created.

desktop-after-read-hook can be set to
'desktop-make-auto-save-list to call this function after
restoring the desktop has successfully completed."
  (interactive)
  (pop-to-buffer desktop-buffer-auto-save-file-list-name)
  (delete-region (point-min) (point-max))
  (dolist (buffer (buffer-list))
    (with-current-buffer buffer
      (let ((filename buffer-auto-save-file-name))
        (if filename
            (when (file-exists-p filename)
              (pop-to-buffer desktop-buffer-auto-save-file-list-name)
              (insert (concat filename "\n"))))))))


(setq desktop-after-read-hook 'desktop-make-auto-save-list)


Feel free to add this, or a modified version, to desktop.el, or to
otherwise use it.


-- 
Knowledge is volatile and fluid.  Software is power.





reply via email to

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