2012-05-14 16:17:32 +02:00
|
|
|
;;; ein-smartrep.el --- smartrep integration
|
|
|
|
|
|
|
|
;; Copyright (C) 2012- Takafumi Arakaki
|
|
|
|
|
2012-07-01 20:18:05 +02:00
|
|
|
;; Author: Takafumi Arakaki <aka.tkf at gmail.com>
|
2012-05-14 16:17:32 +02:00
|
|
|
|
|
|
|
;; This file is NOT part of GNU Emacs.
|
|
|
|
|
|
|
|
;; ein-smartrep.el is free software: you can redistribute it and/or modify
|
|
|
|
;; it under the terms of the GNU General Public License as published by
|
|
|
|
;; the Free Software Foundation, either version 3 of the License, or
|
|
|
|
;; (at your option) any later version.
|
|
|
|
|
|
|
|
;; ein-smartrep.el is distributed in the hope that it will be useful,
|
|
|
|
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
;; GNU General Public License for more details.
|
|
|
|
|
|
|
|
;; You should have received a copy of the GNU General Public License
|
|
|
|
;; along with ein-smartrep.el. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
|
|
|
|
;;; Commentary:
|
|
|
|
|
|
|
|
;;
|
|
|
|
|
|
|
|
;;; Code:
|
|
|
|
|
2012-06-17 16:10:55 +02:00
|
|
|
(require 'smartrep nil t)
|
2012-05-14 16:17:32 +02:00
|
|
|
(require 'ein-notebook)
|
|
|
|
|
2018-10-15 11:21:05 -04:00
|
|
|
(autoload 'smartrep-define-key "smartrep")
|
|
|
|
|
2012-08-20 11:08:25 +02:00
|
|
|
(defcustom ein:smartrep-notebook-mode-alist
|
|
|
|
'(("C-t" . ein:worksheet-toggle-cell-type)
|
|
|
|
("C-l" . ein:worksheet-clear-output)
|
2012-08-20 11:21:18 +02:00
|
|
|
("C-k" . ein:worksheet-kill-cell)
|
2012-08-20 11:08:25 +02:00
|
|
|
("C-y" . ein:worksheet-yank-cell)
|
|
|
|
("C-a" . ein:worksheet-insert-cell-above)
|
|
|
|
("C-b" . ein:worksheet-insert-cell-below)
|
|
|
|
("C-n" . ein:worksheet-goto-next-input)
|
|
|
|
("C-p" . ein:worksheet-goto-prev-input)
|
|
|
|
("C-m" . ein:worksheet-merge-cell)
|
|
|
|
("<up>" . ein:worksheet-move-cell-up)
|
2018-05-29 17:20:31 -04:00
|
|
|
("<down>" . ein:worksheet-move-cell-down))
|
2012-08-20 11:08:25 +02:00
|
|
|
"alist passed to `smartrep-define-key'."
|
2018-05-29 17:20:31 -04:00
|
|
|
:type '(repeat (cons string function))
|
2012-08-20 11:08:25 +02:00
|
|
|
:group 'ein)
|
|
|
|
|
2012-05-17 16:20:53 +02:00
|
|
|
(defun ein:smartrep-config ()
|
|
|
|
(interactive)
|
|
|
|
(smartrep-define-key
|
|
|
|
ein:notebook-mode-map
|
|
|
|
"C-c"
|
2012-08-20 11:08:25 +02:00
|
|
|
ein:smartrep-notebook-mode-alist))
|
2012-05-14 16:17:32 +02:00
|
|
|
|
2012-05-19 15:47:09 +02:00
|
|
|
|
|
|
|
(defvar ein:smartrep-config-once-called nil)
|
|
|
|
|
|
|
|
(defun ein:smartrep-config-once ()
|
|
|
|
(unless ein:smartrep-config-once-called
|
|
|
|
(setq ein:smartrep-config-once-called t)
|
|
|
|
(ein:smartrep-config)))
|
|
|
|
|
2012-05-14 16:17:32 +02:00
|
|
|
(provide 'ein-smartrep)
|
|
|
|
|
|
|
|
;;; ein-smartrep.el ends here
|