From a0edb0160b482bdb9ea48b82e440a3ec5763dd11 Mon Sep 17 00:00:00 2001 From: Sam Steingold Date: Mon, 23 Feb 2015 09:13:31 -0500 Subject: [PATCH] `auto-save-list-file-prefix' can be a directory name * lisp/files.el (recover-session): Handle `auto-save-list-file-prefix' being a directory (empty non-directory part). --- lisp/ChangeLog | 5 +++++ lisp/files.el | 9 +++++---- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index af8845bfb45..2c22ed24bb6 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2015-02-23 Sam Steingold + + * files.el (recover-session): Handle `auto-save-list-file-prefix' + being a directory (empty non-directory part). + 2015-02-23 Magnus Henoch * net/sasl.el (sasl-mechanism-alist): Refer to sasl-scram-rfc diff --git a/lisp/files.el b/lisp/files.el index 1914ad8814c..42b00accbd8 100644 --- a/lisp/files.el +++ b/lisp/files.el @@ -5664,13 +5664,14 @@ Then you'll be asked about a number of files to recover." (interactive) (if (null auto-save-list-file-prefix) (error "You set `auto-save-list-file-prefix' to disable making session files")) - (let ((dir (file-name-directory auto-save-list-file-prefix))) + (let ((dir (file-name-directory auto-save-list-file-prefix)) + (nd (file-name-nondirectory auto-save-list-file-prefix))) (unless (file-directory-p dir) (make-directory dir t)) (unless (directory-files dir nil - (concat "\\`" (regexp-quote - (file-name-nondirectory - auto-save-list-file-prefix))) + (if (string= "" nd) + directory-files-no-dot-files-regexp + (concat "\\`" (regexp-quote nd))) t) (error "No previous sessions to recover"))) (let ((ls-lisp-support-shell-wildcards t)) -- 2.39.2