From c01bf73e7913ab292a51913476558ca89554b737 Mon Sep 17 00:00:00 2001 From: Chong Yidong Date: Sat, 1 Dec 2012 09:49:29 +0800 Subject: [PATCH] * startup.el (fancy-startup-tail): Improve the message about auto-save files. Fixes: debbugs:2176 --- lisp/ChangeLog | 5 +++++ lisp/startup.el | 38 +++++++++++++++++--------------------- 2 files changed, 22 insertions(+), 21 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 1bcb633b06..b71cc72baf 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2012-12-01 Chong Yidong + + * startup.el (fancy-startup-tail): Improve the message about + auto-save files (Bug#2176). + 2012-12-01 Glenn Morris * ido.el (ido-file-internal): diff --git a/lisp/startup.el b/lisp/startup.el index 2e8b6b7f8c..03181a79b1 100644 --- a/lisp/startup.el +++ b/lisp/startup.el @@ -1569,27 +1569,23 @@ a face or button specification." :face '(variable-pitch (:height 0.8)) emacs-copyright "\n") - (and auto-save-list-file-prefix - ;; Don't signal an error if the - ;; directory for auto-save-list files - ;; does not yet exist. - (file-directory-p (file-name-directory - auto-save-list-file-prefix)) - (directory-files - (file-name-directory auto-save-list-file-prefix) - nil - (concat "\\`" - (regexp-quote (file-name-nondirectory - auto-save-list-file-prefix))) - t) - (fancy-splash-insert :face '(variable-pitch font-lock-comment-face) - "\nIf an Emacs session crashed recently, " - "type " - :face '(fixed-pitch font-lock-comment-face) - "Meta-x recover-session RET" - :face '(variable-pitch font-lock-comment-face) - "\nto recover" - " the files you were editing.")) + (when auto-save-list-file-prefix + (let ((dir (file-name-directory auto-save-list-file-prefix)) + (name (file-name-nondirectory auto-save-list-file-prefix)) + files) + ;; Don't warn if the directory for auto-save-list files does not + ;; yet exist. + (and (file-directory-p dir) + (setq files (directory-files dir nil (concat "\\`" name) t)) + (fancy-splash-insert :face '(variable-pitch font-lock-comment-face) + (if (= (length files) 1) + "\nAn auto-save file list was found. " + "\nAuto-save file lists were found. ") + "If an Emacs session crashed recently,\ntype " + :face '(fixed-pitch font-lock-comment-face) + "M-x recover-session RET" + :face '(variable-pitch font-lock-comment-face) + " to recover the files you were editing.")))) (when concise (fancy-splash-insert -- 2.20.1