mirror of
https://github.com/vale981/emacs-ipython-notebook
synced 2025-03-05 17:11:41 -05:00
Get rid of repeated set-keymap-parent
ein:notebook-minor-mode is added to do that.
This commit is contained in:
parent
05f7b4666c
commit
08ea5e7abb
3 changed files with 10 additions and 7 deletions
|
@ -179,8 +179,6 @@ This is the same workaround as `ein:ac-setup-maybe'."
|
|||
ein:mumamo-chunk-headingcell
|
||||
)))
|
||||
|
||||
(set-keymap-parent ein:notebook-mumamo-mode-map ein:notebook-mode-map)
|
||||
|
||||
(add-hook 'ein:notebook-mumamo-mode-hook
|
||||
'ein:mumamo-indent-line-function-workaround-turn-on)
|
||||
|
||||
|
|
|
@ -1169,10 +1169,20 @@ This hook is run regardless the actual major mode used."
|
|||
(funcall (ein:notebook-choose-mode))
|
||||
(ein:complete-on-dot-install
|
||||
ein:notebook-mode-map 'ein:notebook-complete-dot)
|
||||
(ein:notebook-minor-mode +1)
|
||||
(run-hooks 'ein:notebook-mode-hook))
|
||||
|
||||
(add-hook 'ein:notebook-mode-hook 'ein:worksheet-imenu-setup)
|
||||
|
||||
(define-minor-mode ein:notebook-minor-mode
|
||||
"Minor mode to install `ein:notebook-mode-map' for `ein:notebook-mode'."
|
||||
:keymap ein:notebook-mode-map
|
||||
:group 'ein)
|
||||
|
||||
;; To avoid MuMaMo to discard `ein:notebook-minor-mode', make it
|
||||
;; permanent local.
|
||||
(put 'ein:notebook-minor-mode 'permanent-local t)
|
||||
|
||||
(define-derived-mode ein:notebook-plain-mode fundamental-mode "ein:notebook"
|
||||
"IPython notebook mode without fancy coloring."
|
||||
(font-lock-mode))
|
||||
|
@ -1180,9 +1190,6 @@ This hook is run regardless the actual major mode used."
|
|||
(define-derived-mode ein:notebook-python-mode python-mode "ein:python"
|
||||
"Use `python-mode' for whole notebook buffer.")
|
||||
|
||||
(set-keymap-parent ein:notebook-plain-mode-map ein:notebook-mode-map)
|
||||
(set-keymap-parent ein:notebook-python-mode-map ein:notebook-mode-map)
|
||||
|
||||
(defun ein:notebook-open-in-browser (&optional print)
|
||||
"Open current notebook in web browser.
|
||||
When the prefix argument (``C-u``) is given, print page is opened.
|
||||
|
|
|
@ -86,8 +86,6 @@ This function may raise an error."
|
|||
"Notebook mode with org-mode powered fontification."
|
||||
(ein:org-src-set-font-lock-defaults))
|
||||
|
||||
(set-keymap-parent ein:notebook-org-src-mode-map ein:notebook-mode-map)
|
||||
|
||||
(provide 'ein-org-src)
|
||||
|
||||
;;; ein-org-src.el ends here
|
||||
|
|
Loading…
Add table
Reference in a new issue