-
-
Notifications
You must be signed in to change notification settings - Fork 66
Target :type is 'file when switching to a project with projectile #798
Description
Embark version: 1.1
Consult version: 3.4
Marginalia version: 2.1
I have defined a simple action that I'd like to have for projects when selecting one via projectile-switch-project. Based on the section "Defining actions for new categories of targets" in the manual I have this in my init code:
(defvar-keymap my/embark-projectile-actions
:doc "Keymap for actions for project(ile) names"
:parent embark-general-map
"k" #'projectile-remove-known-project)
(add-to-list 'embark-keymap-alist '(project-file . my/embark-projectile-actions))This used to work, but doesn't any more. When I act on a project target with embark-act I don't see the binding to k in the map. The behavior is the same if I add this:
(add-to-list 'marginalia-prompt-categories '("Switch to project" . project-file))(My comments say that I noticed it was no longer working on 2025-07-16.)
I spent some time with the code and noticed that when I'm in the minibuffer on a project name, this is the value returned by embark--targets:
((:orig-type project-file :orig-target "~/org/" :bounds nil :type file :target "/Users/rory/org/"))Notice that :orig-type is correct, but :type is just plain old 'file. This value for :type is determined in embark--targets by a call to embark--project-fill-file-path.
It looks like :orig-type is not used to determine the keymap to pick. embark-act does this (though it is deep in some let/let* code so I may be misunderstanding the call):
(embark--action-keymap (plist-get target :type) (cdr targets))What am I doing wrong?