From: Sam Steingold Date: Mon, 23 Feb 2015 14:13:31 +0000 (-0500) Subject: `auto-save-list-file-prefix' can be a directory name X-Git-Tag: emacs-25.0.90~2564^2~311 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=a0edb0160b482bdb9ea48b82e440a3ec5763dd11;p=emacs.git `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). --- 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))