Helm: Add "Add to EMMS playlist" find-file action
parent
260f1421a3
commit
3a734df3cc
|
@ -310,6 +310,19 @@ With prefix argument, UPDATE the databases with custom uptions thanks to the
|
|||
(and (not (string-match-p ffap-url-regexp candidate))
|
||||
helm-ff-default-directory
|
||||
(locate-dominating-file helm-ff-default-directory ".git")))
|
||||
1)
|
||||
(helm-source-add-action-to-source-if
|
||||
"Add to EMMS playlist"
|
||||
(lambda (_candidate)
|
||||
(when (require 'emms nil 'noerror)
|
||||
(dolist (c (helm-marked-candidates))
|
||||
(emms-add-directory-tree c))))
|
||||
source
|
||||
(lambda (candidate)
|
||||
(or (file-directory-p candidate)
|
||||
(and (file-name-extension candidate)
|
||||
(string-match-p (concat (regexp-opt '("mp3" "mp4" "m4a" "ogg" "flac" "spx" "wma" "wv")) "$")
|
||||
(file-name-extension candidate)))))
|
||||
1))
|
||||
|
||||
(provide 'init-helm)
|
||||
|
|
Loading…
Reference in New Issue