]> git.eshelyaron.com Git - emacs.git/commitdiff
`auto-save-list-file-prefix' can be a directory name
authorSam Steingold <sds@gnu.org>
Mon, 23 Feb 2015 14:13:31 +0000 (09:13 -0500)
committerSam Steingold <sds@gnu.org>
Mon, 23 Feb 2015 14:13:31 +0000 (09:13 -0500)
* lisp/files.el (recover-session): Handle `auto-save-list-file-prefix'
being a directory (empty non-directory part).

lisp/ChangeLog
lisp/files.el

index af8845bfb45579b0dafa62cac66721a3038af5ae..2c22ed24bb691b82dbc6b5a56aa99b8b41dc72a8 100644 (file)
@@ -1,3 +1,8 @@
+2015-02-23  Sam Steingold  <sds@gnu.org>
+
+       * files.el (recover-session): Handle `auto-save-list-file-prefix'
+       being a directory (empty non-directory part).
+
 2015-02-23  Magnus Henoch  <magnus.henoch@gmail.com>
 
        * net/sasl.el (sasl-mechanism-alist): Refer to sasl-scram-rfc
index 1914ad8814ce999642ae1beff0a170336e0bd4f8..42b00accbd8403c3d13c42cab4a6549b9abcd55f 100644 (file)
@@ -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))