org-rifle icon indicating copy to clipboard operation
org-rifle copied to clipboard

Refile fails within org-rifle

Open epichub opened this issue 5 years ago • 2 comments

I use helm-rifle to search and then mark heading then press "C-c C-w" to refile then I get this error message:

funcall-interactively: Wrong number of arguments: #[(candidate) "\211\211\211A\242
rq\210b\210\305 -\207" [candidate input0 --dash-source-292-- buffer pos org-refile] 3 ("/home/epic/.emacs.d/elpa/develop/helm-org-rifle-20190809.1831/helm-org-rifle.elc" . 34399) nil], 0

I am running spacemacs develop. I also tested this on my coworkers emacs (also running spacemacs but with different config) with the same result.

This also happens if I mark one, mark several, mark none but have the cursor over one entry, all resulting in the same error message.

I would love to debug this myself, but I am not well versed in elisp debugging (or coding) - I have programmed lots of Java. python etc.. How do i set the debugger so that I can see what fails?

epichub avatar Jan 15 '20 11:01 epichub

Hi,

Thanks for reporting. I don't use this feature often, so I'm not as likely to notice if something breaks. It's possible that a change in Helm or in Org has caused this.

I would be glad if you could help debug it! Here's what I'd suggest:

  1. The error you showed involves a byte-compiled function. You should get a more useful error if the function isn't byte-compiled. So open helm-org-rifle.el and eval-buffer it, then do the action again.
  2. Use toggle-debug-on-error to enable a full backtrace.

Together, that will probably be enough to locate the problem. If not, you can try using Edebug. Edebug is powerful but complicated. It's thoroughly described in the manual, but the simplest way to use it is:

  1. In the source code buffer, put point on or in a function you want to debug.
  2. C-u C-M-x for edebug-defun.
  3. Perform the action that runs the code. Execution will stop when reaching the debugged function. You can then step through it with n, SPC, o, g, etc, and q to exit.

However, note that debugging within Helm sessions can be tricky because of changing buffers, windows, etc. Sometimes it's necessary to C-g here or there, change the active window, etc. to exit the debugging session and restore control flow. I got the hang of it after a while, but it's hard to explain, more like a learned intuition. So in some cases, it may be easier to use old-fashioned message calls for debugging than Edebug.

BTW, I'd recommend doing the debugging first in a clean config. You can easily use https://github.com/alphapapa/makem.sh to set one up (I haven't added that script to this package yet). For example:

$ cp ../makem.sh/makem.sh .
$ mkdir sandbox
$ ./makem.sh --sandbox-dir sandbox --auto-install interactive

That will install the latest version of all dependencies (except Org, which you will need to update manually if you want a newer version) into a new, permanent sandbox directory and launch an interactive Emacs session with helm-org-rifle already loaded from the local repo. Then you can proceed with debugging it without local configuration getting in the way.

alphapapa avatar Jan 15 '20 18:01 alphapapa

Hi there,

This is still an issue. I'll help debug if I find time -- my error is:

funcall-interactively: Wrong number of arguments: #[(candidate) "‰‰‰A¢
rqˆbˆÅ -‡" [candidate input0 --dash-source-3-- buffer pos org-refile] 3 ("/home/mkennedy/.emacs.d/elpa/helm-org-rifle-20200512.1943/helm-org-rifle.elc" . 34384) nil], 0

Hurricos avatar Sep 11 '20 18:09 Hurricos