org-sidebar-tree 'wrong type argument: stringp, nil'
Hello,
I’m new to this package, so please be gentle! I’ve been trying to use the org-sidebar-tree functionality to help navigate large Org files, but I keep getting the error:
wrong type argument: stringp, nil
when running M-x org-sidebar-tree from an Org buffer.
To troubleshoot, I started fresh with a clean Spacemacs install, only adding the org and org-sidebar packages, but the error persists. All dependencies appear to be installed correctly.
I’m wondering if this is a known issue or if there’s something obvious I might be missing. Any guidance or pointers would be greatly appreciated!
Thank you!
Hi,
I'll need to see the backtrace to know what's causing the error. Please do M-x toggle-debug-on-error RET, then cause the error again, then paste the *Backtrace* buffer's contents here.
Thanks heaps for the quick response :)
Backtrace is as follows:
Debugger entered--Lisp error: (wrong-type-argument stringp nil)
org-sidebar-tree-view-buffer()
org-sidebar-tree()
funcall-interactively(org-sidebar-tree)
command-execute(org-sidebar-tree record)
helm-M-x-execute-command(org-sidebar-tree)
helm-execute-selection-action-1()
helm-execute-selection-action()
helm-internal((((name . "Emacs Commands history") (init #f(compiled-function () #<bytecode -0x16998ad7c4c2d706>)) (candidates . helm-candidates-in-buffer) (cleanup . helm-M-x--unwind-forms) (keymap keymap ... keymap ... ... keymap ... ... keymap ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ...) (action . helm-type-command-actions) (persistent-action . helm-M-x-persistent-action) (persistent-help . "Describe this command") (help-message . helm-M-x-help-message) (requires-pattern . 0) (filtered-candidate-transformer helm-M-x-transformer #<subr F616e6f6e796d6f75732d6c616d626461_anonymous_lambda_22> helm-fuzzy-highlight-matches) (volatile . t) (match identity) (fuzzy-match . t) (redisplay . identity) (nomark . t) (coerce . helm-symbolify) (header-line . ...) (resume . helm-M-x-resume-fn) (multimatch . t) (must-match . t) (group . helm-command) (data . #f(compiled-function () #<bytecode -0x19b5f754cdaa075d>)) (get-line . buffer-substring-no-properties) (search helm-mm-exact-search helm-mm-search helm-candidates-in-buffer-search-default-fn helm-fuzzy-search)) ((name . "Emacs Commands") (init #f(compiled-function () #<bytecode 0x422f2023ae4050c>)) (candidates . helm-candidates-in-buffer) (cleanup . helm-M-x--unwind-forms) (keymap keymap ... keymap ... ... keymap ... ... keymap ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ...) (action . helm-type-command-actions) (persistent-action . helm-M-x-persistent-action) (persistent-help . "Describe this command") (help-message . helm-M-x-help-message) (requires-pattern . 0) (filtered-candidate-transformer helm-M-x-transformer #<subr F616e6f6e796d6f75732d6c616d626461_anonymous_lambda_22> helm-fuzzy-highlight-matches) (volatile . t) (match identity) (fuzzy-match . t) (redisplay . identity) (nomark . t) (coerce . helm-symbolify) (header-line . ...) (resume . helm-M-x-resume-fn) (multimatch . t) (must-match . t) (group . helm-command) (data . #f(compiled-function () #<bytecode -0x194dbf74fd4a0e1f>)) (get-line . buffer-substring-no-properties) (search helm-mm-exact-search helm-mm-search helm-candidates-in-buffer-search-default-fn helm-fuzzy-search))) nil "M-x " nil nil "helm M-x" nil nil helm-M-x-input-history)
helm((((name . "Emacs Commands history") (init #f(compiled-function () #<bytecode -0x16998ad7c4c2d706>)) (candidates . helm-candidates-in-buffer) (cleanup . helm-M-x--unwind-forms) (keymap keymap (keymap ...) keymap (29 . helm-M-x-toggle-short-doc) (21 . helm-M-x-universal-argument) keymap (27 keymap ...) (C-return . helm-cr-empty-string) keymap (C-iso-lefttab . helm-follow-action-backward) (tab . helm-execute-persistent-action) (33554440 . describe-key) (33554443 . helm-follow-action-backward) (33554442 . helm-follow-action-forward) (17 . ace-jump-helm-line) (normal-state keymap "Auxiliary keymap for Normal state" ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ...) (insert-state keymap "Auxiliary keymap for Insert state" ... ... ... ... ... ... ... ...) ((insert\ normal)-state keymap "Auxiliary keymap for (insert normal) state") (f12 . #f(compiled-function () ... #<bytecode 0x186625e8b21280>)) (f11 . #f(compiled-function () ... #<bytecode 0x186625e8b35280>)) (f10 . #f(compiled-function () ... #<bytecode 0x186625e8b59280>)) (f9 . #f(compiled-function () ... #<bytecode 0x186625e8b4d280>)) (f8 . #f(compiled-function () ... #<bytecode 0x186625e8b71280>)) (f7 . #f(compiled-function () ... #<bytecode 0x186625e8b65280>)) (f6 . #f(compiled-function () ... #<bytecode 0x186625e8ba9280>)) (f5 . #f(compiled-function () ... #<bytecode 0x186625e8bbd280>)) (f4 . #f(compiled-function () ... #<bytecode 0x186625e8b81280>)) (f3 . #f(compiled-function () ... #<bytecode 0x186625e8b95280>)) (f2 . #f(compiled-function () ... #<bytecode 0x186625e8bf9280>)) (menu-bar keymap ...) (help keymap ...) ...) (action . helm-type-command-actions) (persistent-action . helm-M-x-persistent-action) (persistent-help . "Describe this command") (help-message . helm-M-x-help-message) (requires-pattern . 0) (filtered-candidate-transformer helm-M-x-transformer #<subr F616e6f6e796d6f75732d6c616d626461_anonymous_lambda_22> helm-fuzzy-highlight-matches) (volatile . t) (match identity) (fuzzy-match . t) (redisplay . identity) (nomark . t) (coerce . helm-symbolify) (header-line . #("TAB: Describe this command (keeping session)" 0 3 ...)) (resume . helm-M-x-resume-fn) (multimatch . t) (must-match . t) (group . helm-command) (data . #f(compiled-function () #<bytecode -0x19b5f754cdaa075d>)) (get-line . buffer-substring-no-properties) (search helm-mm-exact-search helm-mm-search helm-candidates-in-buffer-search-default-fn helm-fuzzy-search)) ((name . "Emacs Commands") (init #f(compiled-function () #<bytecode 0x422f2023ae4050c>)) (candidates . helm-candidates-in-buffer) (cleanup . helm-M-x--unwind-forms) (keymap keymap (keymap ...) keymap (29 . helm-M-x-toggle-short-doc) (21 . helm-M-x-universal-argument) keymap (27 keymap ...) (C-return . helm-cr-empty-string) keymap (C-iso-lefttab . helm-follow-action-backward) (tab . helm-execute-persistent-action) (33554440 . describe-key) (33554443 . helm-follow-action-backward) (33554442 . helm-follow-action-forward) (17 . ace-jump-helm-line) (normal-state keymap "Auxiliary keymap for Normal state" ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ...) (insert-state keymap "Auxiliary keymap for Insert state" ... ... ... ... ... ... ... ...) ((insert\ normal)-state keymap "Auxiliary keymap for (insert normal) state") (f12 . #f(compiled-function () ... #<bytecode 0x186625e8b21280>)) (f11 . #f(compiled-function () ... #<bytecode 0x186625e8b35280>)) (f10 . #f(compiled-function () ... #<bytecode 0x186625e8b59280>)) (f9 . #f(compiled-function () ... #<bytecode 0x186625e8b4d280>)) (f8 . #f(compiled-function () ... #<bytecode 0x186625e8b71280>)) (f7 . #f(compiled-function () ... #<bytecode 0x186625e8b65280>)) (f6 . #f(compiled-function () ... #<bytecode 0x186625e8ba9280>)) (f5 . #f(compiled-function () ... #<bytecode 0x186625e8bbd280>)) (f4 . #f(compiled-function () ... #<bytecode 0x186625e8b81280>)) (f3 . #f(compiled-function () ... #<bytecode 0x186625e8b95280>)) (f2 . #f(compiled-function () ... #<bytecode 0x186625e8bf9280>)) (menu-bar keymap ...) (help keymap ...) ...) (action . helm-type-command-actions) (persistent-action . helm-M-x-persistent-action) (persistent-help . "Describe this command") (help-message . helm-M-x-help-message) (requires-pattern . 0) (filtered-candidate-transformer helm-M-x-transformer #<subr F616e6f6e796d6f75732d6c616d626461_anonymous_lambda_22> helm-fuzzy-highlight-matches) (volatile . t) (match identity) (fuzzy-match . t) (redisplay . identity) (nomark . t) (coerce . helm-symbolify) (header-line . #("TAB: Describe this command (keeping session)" 0 3 ...)) (resume . helm-M-x-resume-fn) (multimatch . t) (must-match . t) (group . helm-command) (data . #f(compiled-function () #<bytecode -0x194dbf74fd4a0e1f>)) (get-line . buffer-substring-no-properties) (search helm-mm-exact-search helm-mm-search helm-candidates-in-buffer-search-default-fn helm-fuzzy-search))) nil "M-x " nil nil "helm M-x" nil nil helm-M-x-input-history)
helm(:sources (((name . "Emacs Commands history") (init #f(compiled-function () #<bytecode -0x16998ad7c4c2d706>)) (candidates . helm-candidates-in-buffer) (cleanup . helm-M-x--unwind-forms) (keymap keymap ... keymap ... ... keymap ... ... keymap ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ...) (action . helm-type-command-actions) (persistent-action . helm-M-x-persistent-action) (persistent-help . "Describe this command") (help-message . helm-M-x-help-message) (requires-pattern . 0) (filtered-candidate-transformer helm-M-x-transformer #<subr F616e6f6e796d6f75732d6c616d626461_anonymous_lambda_22> helm-fuzzy-highlight-matches) (volatile . t) (match identity) (fuzzy-match . t) (redisplay . identity) (nomark . t) (coerce . helm-symbolify) (header-line . ...) (resume . helm-M-x-resume-fn) (multimatch . t) (must-match . t) (group . helm-command) (data . #f(compiled-function () #<bytecode -0x19b5f754cdaa075d>)) (get-line . buffer-substring-no-properties) (search helm-mm-exact-search helm-mm-search helm-candidates-in-buffer-search-default-fn helm-fuzzy-search)) ((name . "Emacs Commands") (init #f(compiled-function () #<bytecode 0x422f2023ae4050c>)) (candidates . helm-candidates-in-buffer) (cleanup . helm-M-x--unwind-forms) (keymap keymap ... keymap ... ... keymap ... ... keymap ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ...) (action . helm-type-command-actions) (persistent-action . helm-M-x-persistent-action) (persistent-help . "Describe this command") (help-message . helm-M-x-help-message) (requires-pattern . 0) (filtered-candidate-transformer helm-M-x-transformer #<subr F616e6f6e796d6f75732d6c616d626461_anonymous_lambda_22> helm-fuzzy-highlight-matches) (volatile . t) (match identity) (fuzzy-match . t) (redisplay . identity) (nomark . t) (coerce . helm-symbolify) (header-line . ...) (resume . helm-M-x-resume-fn) (multimatch . t) (must-match . t) (group . helm-command) (data . #f(compiled-function () #<bytecode -0x194dbf74fd4a0e1f>)) (get-line . buffer-substring-no-properties) (search helm-mm-exact-search helm-mm-search helm-candidates-in-buffer-search-default-fn helm-fuzzy-search))) :prompt "M-x " :buffer "helm M-x" :history helm-M-x-input-history :truncate-lines t)
helm-M-x-read-extended-command(#
Debugger entered--Lisp error: (wrong-type-argument stringp nil)
org-sidebar-tree-view-buffer()
That shows that the error occurs in the function org-sidebar-tree-view-buffer, but since that function is byte-compiled, we can't see where in the function the error happens. So the next step is to C-h f org-sidebar-tree-view-buffer RET, view the function's source code, and C-M-x on it to re-evaluate its definition, so it will be interpreted rather than byte-compiled. Then if you trigger the error again, the backtrace should show exactly where the error occurs.
Thanks for this! And much appreciated on the steps to get through the debugging. This is what I'm getting in response:
`
Debugger entered--Lisp error: (void-variable &key)
(org-sidebar-tree-view-buffer &key (BUFFER (current-buffer)) &allow-other-keys)
(let ((print-level nil) (print-length nil)) (org-sidebar-tree-view-buffer &key (BUFFER (current-buffer)) &allow-other-keys))
(setq elisp--eval-defun-result (let ((print-level nil) (print-length nil)) (org-sidebar-tree-view-buffer &key (BUFFER (current-buffer)) &allow-other-keys)))
elisp--eval-defun()
#<subr F616e6f6e796d6f75732d6c616d626461_anonymous_lambda_38>()
#
`
I will just add that I am able to get the package to work as expected with vanilla emacs. It seems to be the spacemacs layer that once applied, is causing the issue? But I think I've seen other people able to use org-sidebar with spacemacs as well?