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

Switching projects does not include the current project #1016

Closed
mfiano opened this issue Jun 7, 2016 · 4 comments
Closed

Switching projects does not include the current project #1016

mfiano opened this issue Jun 7, 2016 · 4 comments

Comments

@mfiano
Copy link

mfiano commented Jun 7, 2016

Expected behavior

The list of projects to switch to should include the current project. My workflow includes C-c p p to open other files of the current project, but this seemed to have stopped working with an update.

Actual behavior

When switching projects from a buffer of a file whose project is tracked, the list of projects to switch to does not include the project of the file in the buffer.

Steps to reproduce the problem

C-c p p to switch to a project, and open a file. C-c p p again, and the same project is not listed.

Environment & Version information

Projectile version information

Projectile version: MELPA projectile-20160526.832

Emacs version

24.5.1

Operating system

Linux

@bbatsov
Copy link
Owner

bbatsov commented Jun 7, 2016

That's intentional. The assumption is that you'd never want to select the project you're already in - you can simply cancel the command to stay in it.

@bbatsov
Copy link
Owner

bbatsov commented Jun 7, 2016

My workflow includes C-c p p to open other files of the current project

Just use C-c p f instead.

@pierrelegall
Copy link

pierrelegall commented Jan 8, 2017

For my part, I don't like the idea to remove the current project from the project selection buffer. I often call projectile-switch-project when I am already in the project I am searching for, then I tell to myself "What?… oh ok".

To make it behaves as I prefer, I do this:

(defun projectile-relevant-known-projects () projectile-known-projects)
(defun projectile-relevant-open-projects () (projectile-open-projects))

It seems risky but it works for me.

@drrlvn
Copy link

drrlvn commented Aug 9, 2017

I often call projectile-switch-project when I am already in the project I am searching for, then I tell to myself "What?… oh ok".

I do the same. I fixed this by advising projectile-switch-project and replacing projectile--remove-current-project with identity, but that is a horrible hack.

Maybe place the current project last in the list? Then it's there if you search for it but it won't be the first suggestion.

s-surineni added a commit to s-surineni/projectile that referenced this issue Oct 2, 2018
s-surineni added a commit to s-surineni/projectile that referenced this issue Oct 2, 2018
s-surineni added a commit to s-surineni/projectile that referenced this issue Oct 2, 2018
s-surineni added a commit to s-surineni/projectile that referenced this issue Oct 3, 2018
…oject

added new defcustom variable projectile-current-project-on-switch

added defcustom and implemented conditions based on it
@bbatsov bbatsov closed this as completed in bc24537 Oct 4, 2018
kira-bruneau added a commit to kira-bruneau/nixos-config that referenced this issue Apr 26, 2021
kira-bruneau added a commit to kira-bruneau/nixos-config that referenced this issue Apr 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants