From b92f9a892b52ab00a804aa3b4b26251863c968b3 Mon Sep 17 00:00:00 2001 From: Juri Linkov Date: Wed, 23 Apr 2025 09:51:34 +0300 Subject: [PATCH] * lisp/desktop.el: Fix the recent cleanup. (desktop-read): Use 'file-name-directory' on the file name returned by 'locate-file'. (cherry picked from commit 89b7e726f12f34c94c5f05f8972fa8a6a3ea56b5) --- lisp/desktop.el | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lisp/desktop.el b/lisp/desktop.el index b14df76106f..4fd01660c5d 100644 --- a/lisp/desktop.el +++ b/lisp/desktop.el @@ -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. -- 2.39.5