Make sure Jupyter syntax highlighting works on first run
This commit is contained in:
parent
9c413aaa38
commit
91a54013b9
23
init.el
23
init.el
@ -2023,17 +2023,7 @@ line in the block and manually deal with indentation."
|
|||||||
;; jupyter
|
;; jupyter
|
||||||
(use-package jupyter
|
(use-package jupyter
|
||||||
:hook (jupyter-repl-mode . my/-setup-jupyter-mode)
|
:hook (jupyter-repl-mode . my/-setup-jupyter-mode)
|
||||||
:config
|
:init
|
||||||
(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-dont-use-ts-modes (retval)
|
(defun my/-jupyter-dont-use-ts-modes (retval)
|
||||||
"Prevent `jupyter-kernel-language-mode-properties' from selecting TS modes."
|
"Prevent `jupyter-kernel-language-mode-properties' from selecting TS modes."
|
||||||
(cl-destructuring-bind (mode syntax-table) retval
|
(cl-destructuring-bind (mode syntax-table) retval
|
||||||
@ -2048,6 +2038,17 @@ line in the block and manually deal with indentation."
|
|||||||
retval)))
|
retval)))
|
||||||
(advice-add 'jupyter-kernel-language-mode-properties
|
(advice-add 'jupyter-kernel-language-mode-properties
|
||||||
:filter-return #'my/-jupyter-dont-use-ts-modes)
|
: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 ()
|
(defun my/-jupyter-kick-use-back-to-cell ()
|
||||||
"Kick the point out of the invisible read only area at the start of cells."
|
"Kick the point out of the invisible read only area at the start of cells."
|
||||||
(let ((props (text-properties-at (point))))
|
(let ((props (text-properties-at (point))))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user