[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)
- [elpa] 25/117: Add command prompt here and powershell here, (continued)
- [elpa] 25/117: Add command prompt here and powershell here, Matthew Fidler, 2014/07/25
- [elpa] 23/117: Fix (substitute-command-keys "\\[recover-session]"), Matthew Fidler, 2014/07/25
- [elpa] 27/117: Fix recursive loading in ergoemacs-mode source, Matthew Fidler, 2014/07/25
- [elpa] 30/117: Declare w32-long-file-name, Matthew Fidler, 2014/07/25
- [elpa] 29/117: Cleanup byte compile, Matthew Fidler, 2014/07/25
- [elpa] 31/117: More emcompassing shell prompt regexp, Matthew Fidler, 2014/07/25
- [elpa] 26/117: Fix load dependence, See Issue #232, Matthew Fidler, 2014/07/25
- [elpa] 33/117: Added space as separtor for PS1 prompt, Matthew Fidler, 2014/07/25
- [elpa] 35/117: Remap shell to ergoemacs-shell-here, Matthew Fidler, 2014/07/25
- [elpa] 28/117: Add unix shell support, Matthew Fidler, 2014/07/25
- [elpa] 36/117: Add eshell here and powershell key,
Matthew Fidler <=
- [elpa] 37/117: Make C-u show ergoemacs-keys when unspecified, Matthew Fidler, 2014/07/25
- [elpa] 38/117: Make ergoemacs-track use lexical scoping, Matthew Fidler, 2014/07/25
- [elpa] 39/117: Make ergoemacs-unbind lexically scoped, Matthew Fidler, 2014/07/25
- [elpa] 34/117: Use abbreviated file name for shell here, Matthew Fidler, 2014/07/25
- [elpa] 32/117: Took out space requirement for dirtrack-list, Matthew Fidler, 2014/07/25
- [elpa] 41/117: Remove remnants of original local-set-key advice., Matthew Fidler, 2014/07/25
- [elpa] 42/117: Possibly address Issue #276, Matthew Fidler, 2014/07/25
- [elpa] 40/117: Make ergoemacs-shortcuts lexically scoped, Matthew Fidler, 2014/07/25
- [elpa] 45/117: Merge pull request #277 from pdg137/patch-1, Matthew Fidler, 2014/07/25
- [elpa] 44/117: Use M-h instead of M-H for comint-bol., Matthew Fidler, 2014/07/25