diff options
| author | Theodor Thornhill | 2020-06-20 11:54:22 +0200 |
|---|---|---|
| committer | Dmitry Gutov | 2020-06-21 04:07:44 +0300 |
| commit | c1056b0387fb6fda345da51e4e2ee9736c25a358 (patch) | |
| tree | ef1f614fd8743928c6dae37567bb5e38be7d2b9b | |
| parent | c59475ae1e34332501ea0f5758176a29b2797ba6 (diff) | |
| download | emacs-c1056b0387fb6fda345da51e4e2ee9736c25a358.tar.gz emacs-c1056b0387fb6fda345da51e4e2ee9736c25a358.zip | |
Pop to an existing Eshell buffer by default
* lisp/progmodes/project.el (project-shell): Improve docstring to
include information about an implementation detail.
* list/progmodes/project.el (project-eshell): Modelled after
'project-shell', change default behavior such that we don't create too
many eshell buffers by default. Use universal argument to create
subsequent buffers.
| -rw-r--r-- | lisp/progmodes/project.el | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/lisp/progmodes/project.el b/lisp/progmodes/project.el index d35bdf6ce0c..3a9e8bcee54 100644 --- a/lisp/progmodes/project.el +++ b/lisp/progmodes/project.el | |||
| @@ -716,8 +716,9 @@ PREDICATE, HIST, and DEFAULT have the same meaning as in | |||
| 716 | ;;;###autoload | 716 | ;;;###autoload |
| 717 | (defun project-shell () | 717 | (defun project-shell () |
| 718 | "Start an inferior shell in the current project's root directory. | 718 | "Start an inferior shell in the current project's root directory. |
| 719 | With \\[universal-argument] prefix, create subsequent shell buffers | 719 | With \\[universal-argument] prefix, create subsequent shell |
| 720 | with uniquified names." | 720 | buffers with uniquified names. If several Shell buffers exists, |
| 721 | this command jumps to the first created such buffer." | ||
| 721 | (interactive) | 722 | (interactive) |
| 722 | (let* ((default-directory (project-root (project-current t))) | 723 | (let* ((default-directory (project-root (project-current t))) |
| 723 | (default-project-shell-name | 724 | (default-project-shell-name |
| @@ -732,10 +733,21 @@ with uniquified names." | |||
| 732 | 733 | ||
| 733 | ;;;###autoload | 734 | ;;;###autoload |
| 734 | (defun project-eshell () | 735 | (defun project-eshell () |
| 735 | "Start Eshell in the current project's root directory." | 736 | "Start Eshell in the current project's root directory. |
| 737 | With \\[universal-argument] prefix, create subsequent shell | ||
| 738 | buffers with uniquified names. If several Eshell buffers exists, | ||
| 739 | this command jumps to the first created such buffer." | ||
| 736 | (interactive) | 740 | (interactive) |
| 737 | (let ((default-directory (project-root (project-current t)))) | 741 | (let* ((default-directory (project-root (project-current t))) |
| 738 | (eshell t))) | 742 | (eshell-buffer-name |
| 743 | (concat "*" (file-name-nondirectory | ||
| 744 | (directory-file-name | ||
| 745 | (file-name-directory default-directory))) | ||
| 746 | "-eshell*")) | ||
| 747 | (eshell-buffer (get-buffer eshell-buffer-name))) | ||
| 748 | (if (and eshell-buffer (not current-prefix-arg)) | ||
| 749 | (pop-to-buffer eshell-buffer) | ||
| 750 | (eshell t)))) | ||
| 739 | 751 | ||
| 740 | (declare-function fileloop-continue "fileloop" ()) | 752 | (declare-function fileloop-continue "fileloop" ()) |
| 741 | 753 | ||