summaryrefslogtreecommitdiffstats
path: root/emacs
diff options
context:
space:
mode:
authorGravatar Tom Willemse2015-12-18 01:09:53 +0100
committerGravatar Tom Willemse2015-12-18 01:09:53 +0100
commita5ee08bef3a587256bf5301788070dc1f8b4d8af (patch)
treeb46c87a4485fb1334b8bc1344597f580893419df /emacs
parent61d65e27c874e214e5ec99a543ab3f9835c0dfdb (diff)
downloaddotfiles-a5ee08bef3a587256bf5301788070dc1f8b4d8af.tar.gz
dotfiles-a5ee08bef3a587256bf5301788070dc1f8b4d8af.zip
Move raise-eshell to eshell library
Diffstat (limited to 'emacs')
-rw-r--r--emacs/.emacs.d/init.el18
-rw-r--r--emacs/.emacs.d/site-lisp/oni-eshell.el17
2 files changed, 18 insertions, 17 deletions
diff --git a/emacs/.emacs.d/init.el b/emacs/.emacs.d/init.el
index e41bc39..402fdb7 100644
--- a/emacs/.emacs.d/init.el
+++ b/emacs/.emacs.d/init.el
@@ -141,22 +141,6 @@ MODE1 is enabled and vice-versa."
"Set the `disabled' property for each item in FUNCTIONS to nil."
(mapc #'(lambda (f) (put f 'disabled nil)) functions))
-(defun oni:raise-eshell ()
- "Start or switch back to `eshell'.
-
-Also change directories to current working directory."
- (interactive)
- (let ((dir (file-name-directory
- (or (buffer-file-name) "~/")))
- (hasfile (not (eq (buffer-file-name) nil)))
- (started (and (boundp 'eshell-buffer-name) eshell-buffer-name
- (buffer-live-p (get-buffer eshell-buffer-name)))))
- (eshell)
- (when (and hasfile (eq eshell-process-list nil))
- (eshell/cd dir)
- (when started
- (eshell-reset)))))
-
(defun oni:raise-scratch (&optional mode)
"Show the *scratch* buffer.
If called with a universal argument, ask the user which mode to
@@ -950,7 +934,7 @@ If no direction is given, don't split."
(global-set-key (kbd "<f10>") 'git-project-show-files)
(global-set-key (kbd "<f5>") #'oni:reload-buffer)
(global-set-key (kbd "<f7>") 'magit-status)
-(global-set-key (kbd "<f8>") #'oni:raise-eshell)
+(global-set-key (kbd "<f8>") 'oni:raise-eshell)
(global-set-key (kbd "<hiragana>") 'oni:show-org-index)
(global-set-key (kbd "<next>") 'oni:scroll-up-or-next-page)
(global-set-key (kbd "<prior>") 'oni:scroll-down-or-prev-page)
diff --git a/emacs/.emacs.d/site-lisp/oni-eshell.el b/emacs/.emacs.d/site-lisp/oni-eshell.el
index 988afd2..e40d893 100644
--- a/emacs/.emacs.d/site-lisp/oni-eshell.el
+++ b/emacs/.emacs.d/site-lisp/oni-eshell.el
@@ -62,6 +62,23 @@ directory in it."
(signal (car err) (cdr err))))))
;;;###autoload
+(defun oni:raise-eshell ()
+ "Start or switch back to `eshell'.
+
+Also change directories to current working directory."
+ (interactive)
+ (let ((dir (file-name-directory
+ (or (buffer-file-name) "~/")))
+ (hasfile (not (eq (buffer-file-name) nil)))
+ (started (and (boundp 'eshell-buffer-name) eshell-buffer-name
+ (buffer-live-p (get-buffer eshell-buffer-name)))))
+ (eshell)
+ (when (and hasfile (eq eshell-process-list nil))
+ (eshell/cd dir)
+ (when started
+ (eshell-reset)))))
+
+;;;###autoload
(defun oni:set-keys-for-eshell ()
"Set some keybindings for `eshell'."
(define-key eshell-mode-map (kbd "C-d") #'oni:eshell-C-d))