Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to add a new action to a helm recoll source? #15

Open
student-sx opened this issue Aug 16, 2018 · 0 comments
Open

How to add a new action to a helm recoll source? #15

student-sx opened this issue Aug 16, 2018 · 0 comments

Comments

@student-sx
Copy link

How can I add a custom action to an a helm-recoll source? Here is what I tried and as comment, what doesn't work:

;; Define custom action:

(defun test-action (candidate)
(message (format "Filename: %s" (helm-get-selection)))
)

(helm-recoll-create-source "main" "~/.recoll")

;; 1. approach:

(helm-add-action-to-source "Test 1" 'test-action helm-source-recoll-main 0)

;; Action doesn't show up with first approach

;; 2. approach


;; (defmethod helm-setup-user-source ((source helm-source-recoll-main))
;;   (let ((actions (slot-value source 'action)))
;;     (set-slot-value source 'action
;; 		    ("Test 2" . 'test-action))))

;; Error Unknown specializer helm-source-recoll-main with second method


;; Test:
(helm :sources 'helm-source-recoll-main)


;; Test action with custom source works:

;; (defvar helm-source-test
;;   (helm-build-async-source "helm-source-test"
;;     :candidates-process
;;     (lambda ()
;;       (start-process "echo" nil "recoll" "-q" "-t" helm-pattern))
;;     :action '( 
;; 	      ("test" . test-action)
;; 	      )
;;     )
;;   )

;; (helm :sources 'helm-source-test)

My versions: helm-core: 20180712.837, helm-recoll: 20160731.921

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant