feat(emacs): Fill some search-related stubs

This commit is contained in:
Madeleine Sydney
2025-02-20 15:45:20 -07:00
parent 98a71dc13b
commit e2193dbd53
13 changed files with 227 additions and 26 deletions

View File

@@ -2,9 +2,28 @@
(require 'syd-constants)
(use-package project
:custom ((project-list-file (file-name-concat syd-cache-dir
"known-projects"))))
(with-eval-after-load 'project ; Built-in
;; Stay out of my config directory!
(setq project-list-file (file-name-concat syd-cache-dir "known-projects"))
;; For each command in `project-switch-commands' will assign it the key found
;; in `project-prefix-map'. We emulate that behaviour but for our own
;; `syd-leader-project-map'.
(let* ((project-key
(lambda (f)
(key-description
(where-is-internal
f
;; If the keymap is not wrapped in a list,
;; `where-is-internal' will also search the
;; global ;; keymaps
(list syd-leader-project-map)
;; First result only.
t))))
(switch-cmd (lambda (command name &optional key)
(append (list command name)
(list (or key (funcall project-key command)))))))
(add-to-list 'project-switch-commands
(funcall switch-cmd #'project-root-find-file "Browse"))))
;; Projection provides a Projectile-like project management library atop
;; Emacs built-in project.el. It's more lightweight, while still featureful.