emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] 36/117: Add eshell here and powershell key


From: Matthew Fidler
Subject: [elpa] 36/117: Add eshell here and powershell key
Date: Fri, 25 Jul 2014 13:24:04 +0000

mlf176f2 pushed a commit to branch externals/ergoemacs-mode
in repository elpa.

commit 54247f797e7590fec00bd761509a62e092aeeb58
Author: Matthew L. Fidler <address@hidden>
Date:   Wed Jul 16 12:30:20 2014 -0500

    Add eshell here and powershell key
---
 ergoemacs-functions.el |   17 ++++++++++++++++-
 ergoemacs-menus.el     |    1 +
 ergoemacs-themes.el    |    3 +++
 3 files changed, 20 insertions(+), 1 deletions(-)

diff --git a/ergoemacs-functions.el b/ergoemacs-functions.el
index d59f2ee..c59ca16 100644
--- a/ergoemacs-functions.el
+++ b/ergoemacs-functions.el
@@ -2168,7 +2168,7 @@ Sends shell prompt string to process, then turns on
 (add-hook 'shell-mode-hook 'ergoemacs-shell-here-hook)
 
 (defun ergoemacs-shell-here (&optional shell-program buffer-prefix)
-  "Runs a shell process in the current directory, or switches to a shell in 
the current directory."
+  "Runs/switches to a shell process in the current directory."
   (interactive)
   (let* ((shell (or shell-program 'shell))
          (buf-prefix (or buffer-prefix (symbol-name shell)))
@@ -2178,6 +2178,21 @@ Sends shell prompt string to process, then turns on
     (set-buffer (get-buffer-create name))
     (funcall shell name)))
 
+(add-hook 'eshell-post-command-hook 
'ergoemacs-shell-here-directory-change-hook)
+
+(defvar eshell-buffer-name)
+(defun ergoemacs-eshell-here ()
+  "Run/switch to an `eshell' process in the current directory"
+  (interactive)
+  (let* ((eshell-buffer-name
+          (concat "*eshell@" (if (eq system-type 'windows-nt)
+                                 (w32-long-file-name (abbreviate-file-name 
default-directory)) ;; Fix case issues
+                               (abbreviate-file-name default-directory)) "*"))
+         (eshell-exists-p (get-buffer eshell-buffer-name)))
+    (call-interactively 'eshell)
+    (unless eshell-exists-p
+      (ergoemacs-shell-here-directory-change-hook))))
+
 (defun ergoemacs-powershell-here ()
   "Runs PowerShell Here"
   (interactive)
diff --git a/ergoemacs-menus.el b/ergoemacs-menus.el
index 1f77b19..117cec6 100644
--- a/ergoemacs-menus.el
+++ b/ergoemacs-menus.el
@@ -263,6 +263,7 @@ All other modes are assumed to be minor modes or 
unimportant.
                                            (t "In File Manager"))
                               ergoemacs-open-in-desktop)
                              (sep1 menu-item "--")
+                             (open-eshell-here menu-item "In Emacs Shell" 
ergoemacs-eshell-here)
                              (open-shell-here menu-item ,(if (eq system-type 
'windows-nt) "In Command Prompt" "In Shell") ergoemacs-shell-here)
                              ,(if (eq system-type 'windows-nt) 
'(powershell-here menu-item "In PowerShell" ergoemacs-powershell-here :enable 
(fboundp 'powershell)))
                              ))
diff --git a/ergoemacs-themes.el b/ergoemacs-themes.el
index a8b5ba5..7104d4d 100644
--- a/ergoemacs-themes.el
+++ b/ergoemacs-themes.el
@@ -864,6 +864,7 @@
   (global-set-key (kbd "<apps> n c") 'calc)
   (global-set-key (kbd "<apps> n d") 'dired-jump)
   (global-set-key (kbd "<apps> n e") 'eshell)
+  (global-set-key (kbd "<apps> n p") 'powershell)
   (global-set-key (kbd "<apps> n f") 'ergoemacs-open-in-desktop)
   (global-set-key (kbd "<apps> n g") 'grep)
   (global-set-key (kbd "<apps> n m") 'magit-status)
@@ -1028,6 +1029,8 @@
   (when undo-tree-mode
     (global-set-key [remap ergoemacs-redo] 'undo-tree-redo))
   (when ergoemacs-mode
+    (global-set-key [remap eshell] 'ergoemacs-eshell-here)
+    (global-set-key [remap powershell] 'ergoemacs-powershell-here)
     (global-set-key [remap shell] 'ergoemacs-shell-here)
     (global-set-key [remap universal-argument]
                     'ergoemacs-universal-argument)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]