]> git.eshelyaron.com Git - emacs.git/commitdiff
(project-prompt-project-name): Simplify a bit
authorDmitry Gutov <dmitry@gutov.dev>
Sat, 25 Nov 2023 15:04:32 +0000 (17:04 +0200)
committerDmitry Gutov <dmitry@gutov.dev>
Sat, 25 Nov 2023 15:04:32 +0000 (17:04 +0200)
* lisp/progmodes/project.el (project-prompt-project-name):
Fold the inner 'let' into 'when-let'.

lisp/progmodes/project.el

index 27cca2e0f35cfe32c63bb9f469a70787dfd89d2f..f7f057396e13784dabc7c7b33d627ad3fa2b00d2 100644 (file)
@@ -1802,12 +1802,12 @@ It's also possible to enter an arbitrary directory not in the list."
             ;; Iterate in reverse order so project--name-history is in
             ;; the same order as project--list.
             (dolist (dir (reverse (project-known-project-roots)))
-              ;; we filter out directories that no longer map to a project,
+              ;; We filter out directories that no longer map to a project,
               ;; since they don't have a clean project-name.
-              (when-let (proj (project--find-in-directory dir))
-                (let ((name (project-name proj)))
-                  (push name project--name-history)
-                  (push (cons name proj) ret))))
+              (when-let ((proj (project--find-in-directory dir))
+                         (name (project-name proj)))
+                (push name project--name-history)
+                (push (cons name proj) ret)))
             ret))
          ;; XXX: Just using this for the category (for the substring
          ;; completion style).