mirror of
https://github.com/vale981/emacs-ipython-notebook
synced 2025-03-05 09:01:40 -05:00
narrow-to-region font-lock-syntactic-face-function
This commit is contained in:
parent
ea1c0a797d
commit
2b620f8e8f
1 changed files with 5 additions and 2 deletions
|
@ -30,7 +30,8 @@
|
||||||
(save-restriction
|
(save-restriction
|
||||||
(widen)
|
(widen)
|
||||||
(let ((range (pm-innermost-range
|
(let ((range (pm-innermost-range
|
||||||
(or (aif (car args) (max (funcall modifier it) (point-min)))
|
(or (if (numberp (car args))
|
||||||
|
(max (funcall modifier (car args)) (point-min)))
|
||||||
(point)))))
|
(point)))))
|
||||||
(narrow-to-region (car range) (cdr range))
|
(narrow-to-region (car range) (cdr range))
|
||||||
(apply f args)))))
|
(apply f args)))))
|
||||||
|
@ -244,7 +245,9 @@ TYPE can be 'body, nil."
|
||||||
(add-function :before-until (local 'syntax-propertize-function)
|
(add-function :before-until (local 'syntax-propertize-function)
|
||||||
#'poly-ein--unrelated-span)
|
#'poly-ein--unrelated-span)
|
||||||
(add-function :filter-args (local 'syntax-propertize-function)
|
(add-function :filter-args (local 'syntax-propertize-function)
|
||||||
#'poly-ein--span-start-end)))))
|
#'poly-ein--span-start-end)))
|
||||||
|
(add-function :around (local 'font-lock-syntactic-face-function)
|
||||||
|
(apply-partially #'poly-ein--narrow-to-inner #'identity))))
|
||||||
|
|
||||||
(defun poly-ein-init-input-cell (_type)
|
(defun poly-ein-init-input-cell (_type)
|
||||||
"Contrary to intuition, this inits the entire buffer of input cells
|
"Contrary to intuition, this inits the entire buffer of input cells
|
||||||
|
|
Loading…
Add table
Reference in a new issue