]> git.eshelyaron.com Git - emacs.git/commitdiff
* lisp/desktop.el: Fix the recent cleanup.
authorJuri Linkov <juri@linkov.net>
Wed, 23 Apr 2025 06:51:34 +0000 (09:51 +0300)
committerEshel Yaron <me@eshelyaron.com>
Wed, 23 Apr 2025 07:48:23 +0000 (09:48 +0200)
(desktop-read): Use 'file-name-directory' on the file name
returned by 'locate-file'.

(cherry picked from commit 89b7e726f12f34c94c5f05f8972fa8a6a3ea56b5)

lisp/desktop.el

index b14df76106f2305a9742ea0425d5db2816d3bdb9..4fd01660c5dbb79481f472a49ca0d90000909625 100644 (file)
@@ -1313,7 +1313,8 @@ It returns t if a desktop file was loaded, nil otherwise.
              ;; Else, with a prefix arg, ask for a directory name.
              (and ask (read-directory-name "Directory for desktop file: " nil nil t))
              ;; Otherwise search desktop file in desktop-path.
-             (locate-file desktop-base-file-name desktop-path)
+             (when-let* ((file (locate-file desktop-base-file-name desktop-path)))
+               (file-name-directory file))
              ;; If not found and `desktop-path' is non-nil, use its first element.
              (car desktop-path)
              ;; Default: .emacs.d.