Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 5ca14aa

Browse files
committed
Add ein-helm.el
1 parent 4862959 commit 5ca14aa

File tree

1 file changed

+65
-0
lines changed

1 file changed

+65
-0
lines changed

lisp/ein-helm.el

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
;;; ein-helm.el --- Helm/anything commands
2+
3+
;; Copyright (C) 2012 Takafumi Arakaki
4+
5+
;; Author: Takafumi Arakaki <aka.tkf at gmail.com>
6+
7+
;; This file is NOT part of GNU Emacs.
8+
9+
;; ein-helm.el is free software: you can redistribute it and/or modify
10+
;; it under the terms of the GNU General Public License as published by
11+
;; the Free Software Foundation, either version 3 of the License, or
12+
;; (at your option) any later version.
13+
14+
;; ein-helm.el is distributed in the hope that it will be useful,
15+
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
16+
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17+
;; GNU General Public License for more details.
18+
19+
;; You should have received a copy of the GNU General Public License
20+
;; along with ein-helm.el. If not, see <http://www.gnu.org/licenses/>.
21+
22+
;;; Commentary:
23+
24+
;;
25+
26+
;;; Code:
27+
28+
(eval-when-compile (require 'cl))
29+
30+
(declare-function anything-other-buffer "anything")
31+
(declare-function helm-other-buffer "helm")
32+
33+
;; Helm/anything sources
34+
35+
(defvar ein:helm-source-notebook-buffers
36+
'((name . "IPython notebook buffers")
37+
(candidates
38+
. (lambda () (mapcar #'buffer-name (ein:notebook-opened-buffers))))
39+
(type . buffer))
40+
"Helm/anything source for notebook buffers.")
41+
42+
43+
;;; "Export" sources to `helm/anything-c-source-*'
44+
45+
(defvaralias 'anything-c-source-ein-notebook-buffers
46+
'ein:helm-source-notebook-buffers
47+
"Alias to `anything-c-source-ein-notebook-buffers'")
48+
49+
(defvaralias 'helm-c-source-ein-notebook-buffers
50+
'ein:helm-source-notebook-buffers
51+
"Alias to `ein:helm-source-notebook-buffers'")
52+
53+
54+
;;; Helm/anything commands
55+
56+
(defun anything-ein-notebook-buffers ()
57+
(interactive)
58+
(anything-other-buffer ein:helm-source-notebook-buffers "*anything ein*"))
59+
60+
(defun helm-ein-notebook-buffers ()
61+
(interactive)
62+
(helm-other-buffer ein:helm-source-notebook-buffers "*helm ein*"))
63+
64+
(provide 'ein-helm)
65+
;;; ein-helm.el ends here

0 commit comments

Comments
 (0)