diff --git a/init.el b/init.el index ddc3de1..bb284bd 100644 --- a/init.el +++ b/init.el @@ -2023,17 +2023,7 @@ line in the block and manually deal with indentation." ;; jupyter (use-package jupyter :hook (jupyter-repl-mode . my/-setup-jupyter-mode) - :config - (defun company-doc-buffer (&optional string) - "Emulate company's `company-doc-buffer'." - (with-current-buffer (get-buffer-create "*company-documentation*") - (erase-buffer) - (fundamental-mode) - (when string - (save-excursion - (insert string) - (visual-line-mode))) - (current-buffer))) + :init (defun my/-jupyter-dont-use-ts-modes (retval) "Prevent `jupyter-kernel-language-mode-properties' from selecting TS modes." (cl-destructuring-bind (mode syntax-table) retval @@ -2048,6 +2038,17 @@ line in the block and manually deal with indentation." retval))) (advice-add 'jupyter-kernel-language-mode-properties :filter-return #'my/-jupyter-dont-use-ts-modes) + :config + (defun company-doc-buffer (&optional string) + "Emulate company's `company-doc-buffer'." + (with-current-buffer (get-buffer-create "*company-documentation*") + (erase-buffer) + (fundamental-mode) + (when string + (save-excursion + (insert string) + (visual-line-mode))) + (current-buffer))) (defun my/-jupyter-kick-use-back-to-cell () "Kick the point out of the invisible read only area at the start of cells." (let ((props (text-properties-at (point))))