jupyter
jupyter copied to clipboard
`jupyter-org--set-src-block-cache` causing warning ‘org-element-at-point’ cannot be used in non-Org buffer
I've been getting the following ⛔ Warning (org-element): ‘org-element-at-point’ cannot be used in non-Org buffer #<buffer *temp*-422920> (fundamental-mode) whenever I call M-x with point inside an jupyter org code block. It seems like this is due to an interaction between marginalia and jupyter-org-interaction-mode where jupyter-org--define-key-filter is being called. Here's a stack trace I got by manually inserting a an error into jupyter-org--set-src-block-cache.
signal(error ("blah"))
error("blah")
jupyter-org--set-src-block-cache()
jupyter-org-src-block-params()
(and t (jupyter-org-src-block-params))
(let* ((params (and t (jupyter-org-src-block-params))) (buffer (and params (and (or jupyter-org-auto-connect (org-babel-jupyter-session-initiated-p params 'noerror)) (org-babel-jupyter-initiate-session (alist-get :session params) params)))) (client (and buffer (or (buffer-local-value 'jupyter-current-client buffer) (error "No client in session buffer!")))) (syntax (and client (jupyter-kernel-language-syntax-table client)))) (if syntax (let ((jupyter-current-client client)) (let ((table (syntax-table)) (buffer (current-buffer))) (unwind-protect (progn (set-syntax-table syntax) (funcall thunk)) (save-current-buffer (set-buffer buffer) (set-syntax-table table)))))))
jupyter-org--with-src-block-client(#f(lambda () [(key "\3\11")] (let ((lang (jupyter-kernel-language))) (or (jupyter-org--key-def key (vector lang)) (jupyter-org--key-def key [jupyter])))))
(if (org-invisible-p) nil (jupyter-org--with-src-block-client #'(lambda nil (let ((lang (jupyter-kernel-language))) (or (jupyter-org--key-def key (vector lang)) (jupyter-org--key-def key [jupyter]))))))
jupyter-org--define-key-filter("\3\11")
#f(compiled-function (&rest _) #<bytecode -0x1a1c3ac9427e7c5e>)(nil)
lookup-key((keymap (keymap (104 . jupyter-org-hydra/body) (9 menu-item "" nil :filter #f(compiled-function (&rest _) #<bytecode -0x1a1c3ac9427e7c5e>)) (18 menu-item "" nil :filter #f(compiled-function (&rest _) #<bytecode -0x1a1c3ac98e7e7c5e>)) (27 keymap (58 menu-item "" nil :filter #f(compiled-function (&rest _) #<bytecode -0x1a1f5aca480a7c5e>)))) (keymap (36 . flyspell-correct-word-before-point))) [9] t)
help--shadow-lookup((keymap (keymap (104 . jupyter-org-hydra/body) (9 menu-item "" nil :filter #f(compiled-function (&rest _) #<bytecode -0x1a1c3ac9427e7c5e>)) (18 menu-item "" nil :filter #f(compiled-function (&rest _) #<bytecode -0x1a1c3ac98e7e7c5e>)) (27 keymap (58 menu-item "" nil :filter #f(compiled-function (&rest _) #<bytecode -0x1a1f5aca480a7c5e>)))) (keymap (36 . flyspell-correct-word-before-point))) [9] t nil)
describe-map((keymap (22 keymap (27 keymap (8 . org-babel-mark-block)) (107 . org-babel-remove-result-one-or-many) (120 . org-babel-do-key-sequence-in-edit-buffer) (24 . org-babel-do-key-sequence-in-edit-buffer) (104 . org-babel-describe-bindings) (97 . org-babel-sha1-hash) (1 . org-babel-sha1-hash) (122 . org-babel-switch-to-session-with-code) (26 . org-babel-switch-to-session) (73 . org-babel-view-src-block-info) (105 . org-babel-lob-ingest) (9 . org-babel-view-src-block-info) (108 . org-babel-load-in-session) (12 . org-babel-load-in-session) (106 . org-babel-insert-header-arg) (10 . org-babel-insert-header-arg) (99 . org-babel-check-src-block) (3 . org-babel-check-src-block) (102 . org-babel-tangle-file) (6 . org-babel-tangle-file) (116 . org-babel-tangle) (20 . org-babel-tangle) (100 . org-babel-demarcate-block) (4 . org-babel-demarcate-block) (115 . org-babel-execute-subtree) (19 . org-babel-execute-subtree) (98 . org-babel-execute-buffer) (2 . org-babel-execute-buffer) (18 . org-babel-goto-named-result) (114 . org-babel-goto-named-result) (103 . org-babel-goto-named-src-block) (21 . org-babel-goto-src-block-head) (117 . org-babel-goto-src-block-head) (118 . org-babel-expand-src-block) (22 . org-babel-expand-src-block) (15 . org-babel-open-src-block-result) (111 . org-babel-open-src-block-result) (5 . org-babel-execute-maybe) (101 . org-babel-execute-maybe) (14 . org-babel-next-src-block) (110 . org-babel-next-src-block) (16 . org-babel-previous-src-block) (112 . org-babel-previous-src-block)) (67108908 . org-insert-structure-template) (67108906 . org-list-make-subtree) (64 . org-mark-subtree) (58 . org-toggle-fixed-width) (5 . org-export-dispatch) (123 . org-table-toggle-formula-debugger) (125 . org-table-toggle-coordinate-overlays) (1 . org-attach) (126 . org-table-create-with-table.el) (124 . org-table-create-or-convert-from-region) (34 keymap (103 . org-plot/gnuplot) (97 . orgtbl-ascii-plot)) (96 . org-table-edit-field) (39 . org-edit-special) (61 . org-table-eval-formula) (43 . org-table-sum) (63 . org-table-field-info) (35 . org-update-statistics-cookies) (11 . org-kill-note-or-show-branches) (3 . org-ctrl-c-ctrl-c) (94 . org-sort) (9 . org-ctrl-c-tab) (42 . org-ctrl-c-star) (45 . org-ctrl-c-minus) (93 . org-remove-file) (91 . org-agenda-file-to-front) (60 . org-date-from-calendar) (62 . org-goto-calendar) (25 . org-evaluate-time-range) (44 . org-priority) (33 . org-timestamp-inactive) (46 . org-timestamp) (26 . org-add-note) (38 . org-mark-ring-goto) (37 . org-mark-ring-push) (15 . org-open-at-point) (12 . org-insert-link) (13 . org-ctrl-c-ret) (92 . org-match-sparse-tree) (47 . org-sparse-tree) (23 . org-refile) (59 . org-toggle-comment) (4 . org-deadline) (19 . org-schedule) (17 . org-set-tags-command) (20 . org-todo) (10 . org-goto) (36 . org-archive-subtree) (27 keymap (12 . org-insert-all-links) (108 . org-insert-last-stored-link) (23 . org-refile-reverse) (119 . org-refile-copy) (98 . org-previous-block) (102 . org-next-block)) ...) [3] nil t (keymap (keymap (104 . jupyter-org-hydra/body) (9 menu-item "" nil :filter #f(compiled-function (&rest _) #<bytecode -0x1a1c3ac9427e7c5e>)) (18 menu-item "" nil :filter #f(compiled-function (&rest _) #<bytecode -0x1a1c3ac98e7e7c5e>)) (27 keymap (58 menu-item "" nil :filter #f(compiled-function (&rest _) #<bytecode -0x1a1f5aca480a7c5e>)))) (keymap (36 . flyspell-correct-word-before-point))) t t nil)
help--describe-map-tree((keymap ... ... ... ... ... ... ... ... ... ... ... ... ... ...) t (... ... ... ... ... ... ... ... ... ... ... ... ... ... ...) nil nil t nil nil t)
substitute-command-keys("Outline-based notes management and organizer, alias\n\"Carsten's outline-mode for keeping track of everything.\"\n\nOrg mode develops organizational tasks around a NOTES file which\ncontains information about projects as plain text. Org mode is\nimplemented on top of Outline mode, which is ideal to keep the content\nof large files well structured. It supports ToDo items, deadlines and\ntime stamps, which magically appear in the diary listing of the Emacs\ncalendar. Tables are easily created with a built-in table editor.\nPlain text URL-like links connect to websites, emails (VM), Usenet\nmessages (Gnus), BBDB entries, and any files related to the project.\nFor printing and sharing of notes, an Org file (or a part of it)\ncan be exported as a structured ASCII or HTML file.\n\nThe following commands are available:\n\n\\{org-mode-map}\n\nIn addition to any hooks its parent mode `outline-mode' might have\nrun, this mode runs the hook `org-mode-hook', as the final or\npenultimate step during initialization.")
documentation(org-mode)
marginalia--function-doc(org-mode)
marginalia-annotate-command("org-mode")
marginalia--cached((("elpaca-manager" "jupyter-org-restart-kernel-execute-block" "magit-blame" "replace-string" "magit-find-file" "eval-buffer") . #<hash-table equal 6/100 0x5757d0f9 ...>) marginalia-annotate-command "org-mode")
marginalia--affixate((metadata (affixation-function . read-extended-command--affixation) (category . command)) marginalia-annotate-command ("eval-buffer" "magit-find-file" "replace-string" "magit-blame" "jupyter-org-restart-kernel-execute-block" "elpaca-manager" "org-mode" "ediff-buffers" "elpaca-ui-search-orphaned" "completion-at-point" "list-processes" "elpaca-info" "elpaca-dependents" "elpaca-ui-search-installed" "emacs-version" "jupyter-org-interrupt-kernel"))
apply(marginalia--affixate ((metadata (affixation-function . read-extended-command--affixation) (category . command)) marginalia-annotate-command ("eval-buffer" "magit-find-file" "replace-string" "magit-blame" "jupyter-org-restart-kernel-execute-block" "elpaca-manager" "org-mode" "ediff-buffers" "elpaca-ui-search-orphaned" "completion-at-point" "list-processes" "elpaca-info" "elpaca-dependents" "elpaca-ui-search-installed" "emacs-version" "jupyter-org-interrupt-kernel")))
#f(compiled-function (&rest args2) #<bytecode 0x1e8617d179113223>)(("eval-buffer" "magit-find-file" "replace-string" "magit-blame" "jupyter-org-restart-kernel-execute-block" "elpaca-manager" "org-mode" "ediff-buffers" "elpaca-ui-search-orphaned" "completion-at-point" "list-processes" "elpaca-info" "elpaca-dependents" "elpaca-ui-search-installed" "emacs-version" "jupyter-org-interrupt-kernel"))
#f(compiled-function (cands) #<bytecode -0x1f8935ea525e5dbe>)(("eval-buffer" "magit-find-file" "replace-string" "magit-blame" "jupyter-org-restart-kernel-execute-block" "elpaca-manager" "org-mode" "ediff-buffers" "elpaca-ui-search-orphaned" "completion-at-point" "list-processes" "elpaca-info" "elpaca-dependents" "elpaca-ui-search-installed" "emacs-version" "jupyter-org-interrupt-kernel"))
vertico--affixate(("eval-buffer" "magit-find-file" "replace-string" "magit-blame" "jupyter-org-restart-kernel-execute-block" "elpaca-manager" "org-mode" "ediff-buffers" "elpaca-ui-search-orphaned" "completion-at-point" "list-processes" "elpaca-info" "elpaca-dependents" "elpaca-ui-search-installed" "emacs-version" "jupyter-org-interrupt-kernel"))
vertico--arrange-candidates()
vertico--exhibit()
read-from-minibuffer("M-x " nil (keymap (10 . minibuffer-complete-and-exit) (13 . minibuffer-complete-and-exit) keymap (menu-bar keymap (minibuf "Minibuf" keymap (tab menu-item "Complete" minibuffer-complete :help "Complete as far as possible") (space menu-item "Complete Word" minibuffer-complete-word :help "Complete at most one word") (63 menu-item "List Completions" minibuffer-completion-help :help "Display all possible completions") "Minibuf")) (M-down . minibuffer-next-completion) (M-up . minibuffer-previous-completion) (27 keymap (13 . minibuffer-choose-completion) (103 keymap (27 keymap (99 . switch-to-completions))) (118 . switch-to-completions)) (prior . switch-to-completions) (63 . minibuffer-completion-help) (32 . minibuffer-complete-word) (backtab . minibuffer-complete) (9 . minibuffer-complete) keymap (menu-bar keymap (minibuf "Minibuf" keymap (previous menu-item "Previous History Item" previous-history-element :help "Put previous minibuffer history element in the minibuffer") (next menu-item "Next History Item" next-history-element :help "Put next minibuffer history element in the minibuffer") (isearch-backward menu-item "Isearch History Backward" isearch-backward :help "Incrementally search minibuffer history backward") (isearch-forward menu-item "Isearch History Forward" isearch-forward :help "Incrementally search minibuffer history forward") (return menu-item "Enter" exit-minibuffer :key-sequence "\15" :help "Terminate input and exit minibuffer") (quit menu-item "Quit" abort-recursive-edit :help "Abort input and exit minibuffer") "Minibuf")) (24 keymap (down . minibuffer-complete-defaults) (up . minibuffer-complete-history)) (13 . exit-minibuffer) (10 . exit-minibuffer) (7 . abort-minibuffers) (C-tab . file-cache-minibuffer-complete) (9 . self-insert-command) (XF86Back . previous-history-element) (up . previous-line-or-history-element) (prior . previous-history-element) (XF86Forward . next-history-element) (down . next-line-or-history-element) (next . next-history-element) (27 keymap (60 . minibuffer-beginning-of-buffer) (114 . previous-matching-history-element) (115 . next-matching-history-element) (112 . previous-history-element) (110 . next-history-element))) nil extended-command-history nil nil)
#f(compiled-function (prompt collection &optional predicate require-match initial-input hist def inherit-input-method) "Default method for reading from the minibuffer with completion.\nSee `completing-read' for the meaning of the arguments." #<bytecode -0xc3d5b5a7df19fa1>)("M-x " #f(compiled-function (string pred action) #<bytecode 0x690fd1ea890055e>) #f(compiled-function (sym) #<bytecode 0xc1ee99c1daa389d>) t nil extended-command-history nil nil)
apply((#f(compiled-function (prompt collection &optional predicate require-match initial-input hist def inherit-input-method) "Default method for reading from the minibuffer with completion.\nSee `completing-read' for the meaning of the arguments." #<bytecode -0xc3d5b5a7df19fa1>) "M-x " #f(compiled-function (string pred action) #<bytecode 0x690fd1ea890055e>) #f(compiled-function (sym) #<bytecode 0xc1ee99c1daa389d>) t nil extended-command-history nil nil))
vertico--advice(#f(compiled-function (prompt collection &optional predicate require-match initial-input hist def inherit-input-method) "Default method for reading from the minibuffer with completion.\nSee `completing-read' for the meaning of the arguments." #<bytecode -0xc3d5b5a7df19fa1>) "M-x " #f(compiled-function (string pred action) #<bytecode 0x690fd1ea890055e>) #f(compiled-function (sym) #<bytecode 0xc1ee99c1daa389d>) t nil extended-command-history nil nil)
apply(vertico--advice #f(compiled-function (prompt collection &optional predicate require-match initial-input hist def inherit-input-method) "Default method for reading from the minibuffer with completion.\nSee `completing-read' for the meaning of the arguments." #<bytecode -0xc3d5b5a7df19fa1>) ("M-x " #f(compiled-function (string pred action) #<bytecode 0x690fd1ea890055e>) #f(compiled-function (sym) #<bytecode 0xc1ee99c1daa389d>) t nil extended-command-history nil nil))
completing-read-default("M-x " #f(compiled-function (string pred action) #<bytecode 0x690fd1ea890055e>) #f(compiled-function (sym) #<bytecode 0xc1ee99c1daa389d>) t nil extended-command-history nil nil)
completing-read("M-x " #f(compiled-function (string pred action) #<bytecode 0x690fd1ea890055e>) #f(compiled-function (sym) #<bytecode 0xc1ee99c1daa389d>) t nil extended-command-history)
read-extended-command-1("M-x " nil)
read-extended-command()
byte-code("\302\30\11\303 \10)E\207" [execute-extended-command--last-typed current-prefix-arg nil read-extended-command] 3)
call-interactively(execute-extended-command nil nil)
command-execute(execute-extended-command)