tools/prodigy: conform to new conventions
This commit is contained in:
parent
763262b2a3
commit
0ab14efce2
2 changed files with 13 additions and 15 deletions
|
@ -32,17 +32,3 @@
|
|||
(file-directory-p (plist-get service :project)))
|
||||
collect service into services
|
||||
finally do (setq prodigy-service services)))
|
||||
|
||||
;;;###autoload
|
||||
(defun +prodigy*services (orig-fn &rest args)
|
||||
"Adds a new :project property to prodigy services, which hides the service
|
||||
unless invoked from the relevant project."
|
||||
(let ((project-root (downcase (or (doom-project-root) default-directory)))
|
||||
(services (apply orig-fn args)))
|
||||
(if current-prefix-arg
|
||||
services
|
||||
(cl-remove-if-not (lambda (service)
|
||||
(let ((project (plist-get service :project)))
|
||||
(or (not project)
|
||||
(file-in-directory-p project-root project))))
|
||||
services))))
|
||||
|
|
|
@ -3,7 +3,19 @@
|
|||
(after! prodigy
|
||||
(set-evil-initial-state! 'prodigy-mode 'emacs)
|
||||
|
||||
(advice-add #'prodigy-services :around #'+prodigy*services)
|
||||
(def-advice! +prodigy-services-a (orig-fn &rest args)
|
||||
"Adds a new :project property to prodigy services, which hides the service
|
||||
unless invoked from the relevant project."
|
||||
:around #'prodigy-services
|
||||
(let ((project-root (downcase (or (doom-project-root) default-directory)))
|
||||
(services (apply orig-fn args)))
|
||||
(if current-prefix-arg
|
||||
services
|
||||
(cl-remove-if-not (lambda (service)
|
||||
(let ((project (plist-get service :project)))
|
||||
(or (not project)
|
||||
(file-in-directory-p project-root project))))
|
||||
services))))
|
||||
|
||||
(define-key prodigy-mode-map "d" #'+prodigy/delete))
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue