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

Add a new defcustom to configure projectile-kill-buffers. #1333

Merged
merged 3 commits into from
Oct 23, 2018

Conversation

mookid
Copy link
Contributor

@mookid mookid commented Oct 20, 2018

3 2 options are implemented:

  • all-buffers (corresponds to the existing behavior)
    keep-processes
  • kill-only-files: kill only the buffer that have a buffer-file-name.

changelog:

  • projectile-kill-buffers-filter: new defcustom.

Note:

edit: eventually kept only kill-only-files, while allowing any predicate to be used.

cc @mfiano
fix #1233

3 options are implemented:
- all-buffers (corresponds to the existing behavior)
- keep-processes
- kill-only-files: kill only the buffer that have a buffer-file-name.

* projectile-kill-buffers-filter: new defcustom.
projectile.el Outdated
associated to a file."
:group 'projectile
:type '(radio
(const :tag "All project files" kill-all)
Copy link
Owner

Choose a reason for hiding this comment

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

files -> buffers

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done!

projectile.el Outdated
:group 'projectile
:type '(radio
(const :tag "All project files" kill-all)
(const :tag "Preserve process buffer" keep-processes)
Copy link
Owner

Choose a reason for hiding this comment

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

I don't get what's the difference between the final two options - keep-processes and and kill-only-files are more or less the same as something's either a file buffer or some special buffer (although those won't necessary have process attached to them).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You are probably right that the difference may not make much sense in terms of usage. I made the customization point extensible to allow for more fine-grained control, while removing the keep-processes choice.

projectile.el Outdated
;; we take care not to kill indirect buffers directly
;; as we might encounter them after their base buffers are killed
(not (buffer-base-buffer buffer))
(case projectile-kill-buffers-filter
Copy link
Owner

Choose a reason for hiding this comment

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

You probably meant to use pcase here.

@mfiano
Copy link

mfiano commented Oct 21, 2018

Thanks so much for this! Can't wait for it to be merged

@bbatsov bbatsov merged commit 90997d6 into bbatsov:master Oct 23, 2018
@bbatsov
Copy link
Owner

bbatsov commented Oct 23, 2018

Thanks!

@mookid mookid deleted the kill-buffers-custom branch October 23, 2018 19:47
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.

Killing all project buffers also kills non-file buffers
3 participants