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

Melpa update breakes helm-org-rifle #2007

Closed
adam52 opened this issue Mar 28, 2018 · 5 comments
Closed

Melpa update breakes helm-org-rifle #2007

adam52 opened this issue Mar 28, 2018 · 5 comments

Comments

@adam52
Copy link

adam52 commented Mar 28, 2018

I did an Upgrade recently, of all my packages on Melpa. Now when I run helm-org-rifle I am prompted for a "PATTERN:" (which I key in) and I can then select a result in the indirect buffer.

However, when I hit [enter] to complete the selection, I receive an error message:

Wrong number of arguments: (1 . 1), 0

Any ideas?

Thanks,
-Adam

@thierryvolpiatto
Copy link
Member

thierryvolpiatto commented Mar 28, 2018 via email

@adam52
Copy link
Author

adam52 commented Mar 28, 2018

Here you go!

backtrace.txt

@thierryvolpiatto
Copy link
Member

@alphapapa It seems you are using helm-get-sources somewhere, (in cleanup-hook) but the signature of this function have changed, it takes one argument SOURCES which is a list of sources, I think you don't need it anymore by using directly local variable helm-sources.

@thierryvolpiatto
Copy link
Member

thierryvolpiatto commented Mar 28, 2018 via email

@adam52
Copy link
Author

adam52 commented Mar 28, 2018

Ah! You fixed it!!

Here is the original code for the cleanup-hook, found in helm-org-rifle.el.

  (helm-cleanup-hook (lambda ()
                       ;; Close new buffers if enabled
                       (when helm-org-rifle-close-unopened-file-buffers
                         (if (= 0 helm-exit-status)
                             ;; Candidate selected; close other new buffers
                             (let ((candidate-source (helm-attr 'name (helm-get-current-source))))
                               (dolist (source (helm-get-sources))
                                 (unless (or (equal (helm-attr 'name source)
                                                    candidate-source)
                                             (not (helm-attr 'new-buffer source)))
                                   (kill-buffer (helm-attr 'buffer source)))))
                           ;; No candidates; close all new buffers
                           (dolist (source (helm-get-sources))
                             (when (helm-attr 'new-buffer source)
                               (kill-buffer (helm-attr 'buffer source))))))))))

and here is the revised code, taking your suggestions:

  (helm-cleanup-hook (lambda ()
                       ;; Close new buffers if enabled
                       (when helm-org-rifle-close-unopened-file-buffers
                         (if (= 0 helm-exit-status)
                             ;; Candidate selected; close other new buffers
                             (let ((candidate-source (helm-attr 'name (helm-get-current-source))))
                               (dolist (source helm-sources)
                                 (unless (or (equal (helm-attr 'name source)
                                                    candidate-source)
                                             (not (helm-attr 'new-buffer source)))
                                   (kill-buffer (helm-attr 'buffer source)))))
                           ;; No candidates; close all new buffers
                           (dolist (source helm-sources)
                             (when (helm-attr 'new-buffer source)
                               (kill-buffer (helm-attr 'buffer source))))))))))

Thanks Thierry!!!

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

2 participants