2012-09-27 23:54:28 +02:00
|
|
|
|
;;; zeroein.el --- Zero setup Emacs IPython Notebook client
|
|
|
|
|
|
|
|
|
|
;; Copyright (C) 2012- Takafumi Arakaki
|
|
|
|
|
|
|
|
|
|
;; Author: Takafumi Arakaki
|
|
|
|
|
|
|
|
|
|
;; This file is NOT part of GNU Emacs.
|
|
|
|
|
|
|
|
|
|
;; zeroein.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.
|
|
|
|
|
|
|
|
|
|
;; zeroein.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 zeroein.el. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
|
|
|
|
|
|
;;; Commentary:
|
|
|
|
|
|
|
|
|
|
;;
|
|
|
|
|
|
|
|
|
|
;;; Code:
|
|
|
|
|
|
2016-04-22 14:59:34 +00:00
|
|
|
|
(package-initialize)
|
2012-09-28 00:49:18 +02:00
|
|
|
|
(eval-when-compile (require 'cl))
|
|
|
|
|
|
2012-09-27 23:54:28 +02:00
|
|
|
|
|
2012-09-28 00:26:28 +02:00
|
|
|
|
;;; Utilities
|
|
|
|
|
|
2012-09-27 23:59:12 +02:00
|
|
|
|
(defvar zeroein:lisp-dir
|
2012-09-27 23:54:28 +02:00
|
|
|
|
(or (if load-file-name (file-name-directory load-file-name))
|
|
|
|
|
default-directory))
|
|
|
|
|
|
2012-09-27 23:59:12 +02:00
|
|
|
|
(defvar zeroein:root-dir
|
|
|
|
|
(file-name-as-directory
|
|
|
|
|
(expand-file-name ".." (file-name-as-directory zeroein:lisp-dir))))
|
|
|
|
|
|
2012-09-27 23:54:28 +02:00
|
|
|
|
(defun zeroein:path (p &rest ps)
|
|
|
|
|
(if ps
|
|
|
|
|
(apply #'zeroein:path
|
|
|
|
|
(concat (file-name-as-directory p) (car ps)) (cdr ps))
|
|
|
|
|
(concat zeroein:root-dir p)))
|
|
|
|
|
|
2012-09-28 00:26:28 +02:00
|
|
|
|
(defvar zeroein:dependencies
|
2017-09-03 10:29:54 -05:00
|
|
|
|
'("dash" "markdown-mode" "websocket" "request" "request-deferred" "deferred" "skewer-mode"
|
2012-09-28 00:26:28 +02:00
|
|
|
|
"auto-complete" "popup" "fuzzy" "pos-tip" "smartrep"))
|
|
|
|
|
|
2016-09-09 10:07:35 -05:00
|
|
|
|
(defvar zeroein:subtrees
|
|
|
|
|
'("lib/websocket https://github.com/ahyatt/emacs-websocket.git master --squash"
|
|
|
|
|
"lib/auto-complete https://github.com/auto-complete/auto-complete.git master --squash"
|
|
|
|
|
"lib/fuzzy https://github.com/auto-complete/fuzzy-el.git master --squash"
|
|
|
|
|
"lib/popup https://github.com/auto-complete/popup-el.git master --squash"
|
|
|
|
|
"lib/pos-tip https://github.com/emacsmirror/pos-tip.git master --sqaush"
|
|
|
|
|
"lib/smartrep https://github.com/myuhe/smartrep.el.git master --squash"
|
|
|
|
|
"lib/markdown-mode https://github.com/defunkt/markdown-mode.git master --squash"
|
|
|
|
|
"lib/ert https://github.com/ohler/ert.git master --squash"
|
|
|
|
|
"lib/request https://github.com/tkf/emacs-request master --squash"
|
|
|
|
|
"lib/ein-mumamo https://github.com/millejoh/ein-mumamo master --squash"))
|
|
|
|
|
|
2012-09-30 21:01:16 +02:00
|
|
|
|
;; Loading the new python.el fails in Emacs 23.
|
|
|
|
|
(when (>= emacs-major-version 24)
|
|
|
|
|
(add-to-list 'zeroein:dependencies "python"))
|
|
|
|
|
|
2012-09-28 00:49:18 +02:00
|
|
|
|
|
|
|
|
|
;;; Install dependencies
|
|
|
|
|
|
2016-09-09 10:07:35 -05:00
|
|
|
|
(loop for subtree in zeroein:subtrees
|
|
|
|
|
do (call-process "git" nil nil nil
|
|
|
|
|
"subtree" "pull" "--prefix" subtree))
|
2012-09-28 00:49:18 +02:00
|
|
|
|
|
2012-09-28 00:26:28 +02:00
|
|
|
|
|
|
|
|
|
;;; `load-path' configurations
|
|
|
|
|
|
2012-09-27 23:59:12 +02:00
|
|
|
|
(add-to-list 'load-path (zeroein:path "lisp"))
|
2017-09-03 10:29:54 -05:00
|
|
|
|
;;(add-to-list 'load-path (zeroein:path "lib" "nxhtml" "util"))
|
2012-09-27 23:59:12 +02:00
|
|
|
|
(mapc (lambda (path) (add-to-list 'load-path (zeroein:path "lib" path)))
|
2012-09-28 00:26:28 +02:00
|
|
|
|
zeroein:dependencies)
|
2012-09-27 23:54:28 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
;;; Configurations
|
|
|
|
|
(eval-when-compile (require 'ein-notebooklist))
|
2014-12-09 10:42:39 -06:00
|
|
|
|
(require 'ein)
|
2012-09-27 23:54:28 +02:00
|
|
|
|
|
|
|
|
|
;; auto-complete
|
|
|
|
|
(setq ein:use-auto-complete-superpack t)
|
|
|
|
|
;; (setq ein:use-smartrep t)
|
|
|
|
|
|
|
|
|
|
(require 'auto-complete-config nil t)
|
2012-09-28 00:14:28 +02:00
|
|
|
|
(declare-function global-auto-complete-mode "auto-complete.el")
|
2012-09-27 23:54:28 +02:00
|
|
|
|
(when (featurep 'auto-complete-config)
|
|
|
|
|
(ac-config-default)
|
|
|
|
|
(add-to-list 'ac-dictionary-directories
|
2012-09-28 01:08:28 +02:00
|
|
|
|
(zeroein:path "lib" "auto-complete" "dict"))
|
2012-09-27 23:54:28 +02:00
|
|
|
|
(global-auto-complete-mode t))
|
|
|
|
|
|
|
|
|
|
;; MuMaMo
|
|
|
|
|
(custom-set-faces
|
|
|
|
|
'(mumamo-background-chunk-major
|
|
|
|
|
((((class color) (min-colors 88) (background dark)) nil)))
|
|
|
|
|
;; '(mumamo-background-chunk-submode1
|
|
|
|
|
;; ((((class color) (min-colors 88) (background dark)) nil)))
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
;;; Workaround
|
|
|
|
|
|
|
|
|
|
;; Suppress this warning when using mumamo:
|
|
|
|
|
;; Warning: `font-lock-syntactic-keywords' is an obsolete variable (as of 24.1);
|
|
|
|
|
;; use `syntax-propertize-function' instead.
|
|
|
|
|
(when (and (equal emacs-major-version 24)
|
|
|
|
|
(equal emacs-minor-version 1))
|
|
|
|
|
(eval-after-load "bytecomp"
|
|
|
|
|
'(add-to-list 'byte-compile-not-obsolete-vars
|
|
|
|
|
'font-lock-syntactic-keywords)))
|
|
|
|
|
;; See: http://stackoverflow.com/a/5470584/727827
|
|
|
|
|
|
2012-09-28 00:52:01 +02:00
|
|
|
|
|
|
|
|
|
;;; Finally, open notebook list
|
2012-12-06 20:14:24 +01:00
|
|
|
|
(if noninteractive
|
|
|
|
|
(progn
|
|
|
|
|
;; When called in batch mode, print system info.
|
|
|
|
|
(require 'ein-dev)
|
|
|
|
|
(ein:dev-print-sys-info))
|
|
|
|
|
;; To make EIN configurable by --eval, use idle timer:
|
|
|
|
|
(run-with-idle-timer 0 nil 'call-interactively 'ein:notebooklist-open))
|
2012-09-28 00:52:01 +02:00
|
|
|
|
|
2012-09-27 23:54:28 +02:00
|
|
|
|
;;; zeroein.el ends here
|