ein-smartrep.el 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. ;;; ein-smartrep.el --- smartrep integration
  2. ;; Copyright (C) 2012- Takafumi Arakaki
  3. ;; Author: Takafumi Arakaki <aka.tkf at gmail.com>
  4. ;; This file is NOT part of GNU Emacs.
  5. ;; ein-smartrep.el is free software: you can redistribute it and/or modify
  6. ;; it under the terms of the GNU General Public License as published by
  7. ;; the Free Software Foundation, either version 3 of the License, or
  8. ;; (at your option) any later version.
  9. ;; ein-smartrep.el is distributed in the hope that it will be useful,
  10. ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. ;; GNU General Public License for more details.
  13. ;; You should have received a copy of the GNU General Public License
  14. ;; along with ein-smartrep.el. If not, see <http://www.gnu.org/licenses/>.
  15. ;;; Commentary:
  16. ;;
  17. ;;; Code:
  18. (require 'smartrep nil t)
  19. (require 'ein-notebook)
  20. (defcustom ein:smartrep-notebook-mode-alist
  21. '(("C-t" . ein:worksheet-toggle-cell-type)
  22. ("C-l" . ein:worksheet-clear-output)
  23. ("C-k" . ein:worksheet-kill-cell)
  24. ("C-y" . ein:worksheet-yank-cell)
  25. ("C-a" . ein:worksheet-insert-cell-above)
  26. ("C-b" . ein:worksheet-insert-cell-below)
  27. ("C-n" . ein:worksheet-goto-next-input)
  28. ("C-p" . ein:worksheet-goto-prev-input)
  29. ("C-m" . ein:worksheet-merge-cell)
  30. ("<up>" . ein:worksheet-move-cell-up)
  31. ("<down>" . ein:worksheet-move-cell-down)
  32. )
  33. "alist passed to `smartrep-define-key'."
  34. :group 'ein)
  35. (defun ein:smartrep-config ()
  36. (interactive)
  37. (smartrep-define-key
  38. ein:notebook-mode-map
  39. "C-c"
  40. ein:smartrep-notebook-mode-alist))
  41. (defvar ein:smartrep-config-once-called nil)
  42. (defun ein:smartrep-config-once ()
  43. (unless ein:smartrep-config-once-called
  44. (setq ein:smartrep-config-once-called t)
  45. (ein:smartrep-config)))
  46. (provide 'ein-smartrep)
  47. ;;; ein-smartrep.el ends here