Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow Projectile to spawn extra process buffers (shell/eshell/term/vterm/ielm) with the prefix ARG #1486

Merged
merged 2 commits into from
Jan 28, 2020
Merged

Allow Projectile to spawn extra process buffers (shell/eshell/term/vterm/ielm) with the prefix ARG #1486

merged 2 commits into from
Jan 28, 2020

Conversation

freesteph
Copy link
Contributor

@freesteph freesteph commented Jan 10, 2020

Hey! Thanks for projectile. As a disclaimer I don't write very much Lisp (yet).

Rationale

I need to fire multiple terminals in the projects I work on. One to run the server and follow the logs, maybe an interactive console and some other bits & bobs sometimes so add a mechanism to override the default behaviour and spawn new vterm buffers as needed.

Summary

Going to copy and paste my commit if that's OK:

If projectile-run-vterm is called with a prefix ARG it will generate
a new buffer in the style of generate-new-buffer-name (e.g 'vterm
my-proj<2>
') and switch to it.


Before submitting a PR make sure the following things have been done (and denote this
by checking the relevant checkboxes):

  • The commits are consistent with our contribution guidelines
  • You've added tests (if possible) to cover your change(s)
  • All tests are passing (make test)
  • The new code is not generating bytecode or M-x checkdoc warnings
  • You've updated the changelog (if adding/changing user-visible functionality)
  • You've updated the readme (if adding/changing user-visible functionality)

Thanks!

If `projectile-run-vterm` is called with a prefix ARG it will generate
a new buffer in the style of `generate-new-buffer-name` (e.g '*vterm
my-proj<2>*') and switch to it.
@bbatsov
Copy link
Owner

bbatsov commented Jan 19, 2020

I'm fine with the proposed changed. It needs a changelog entry, through.

One small problem is that this introduces a small inconsistency with other similar commands that don't support the prefix arg. Might be a good idea to unify the eshell, term and vterm commands.

@freesteph freesteph changed the title Allow multiple vterm buffers to be spawned Allow Projectile to spawn extra process buffers (shell/eshell/term/vterm/ielm) with the prefix ARG Jan 24, 2020
projectile.el Outdated
@@ -775,6 +775,12 @@ just return nil."
"Get the symbol at point and strip its properties."
(substring-no-properties (or (thing-at-point 'symbol) "")))

(defun projectile-generate-prompt-name (cmd make-new)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think cmd is a bit misleading here - it's actually just a basename. I'd also use process/comint-buffer instead of prompt.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I went with (defun projectile-generate-process-name (process make-new) because I tried a bunch of different wordings and couldn't decide. Feel free to push a commit atop or let me know what you think reads best and I can also do the change.

@bbatsov
Copy link
Owner

bbatsov commented Jan 25, 2020

Overall your changes look good to me. I've added a bit of small feedback here and there. Once you address it I'll merge the PR.

@bbatsov bbatsov merged commit 7227b2c into bbatsov:master Jan 28, 2020
@bbatsov
Copy link
Owner

bbatsov commented Jan 28, 2020

Thanks!

P.S. Naming is hard! 😆

@freesteph freesteph deleted the feature/allow-multiple-vterms branch January 28, 2020 12:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants