branch: elpa/projectile commit 6261561052b128c0a0e352e726453e7ac6f8dbdc Author: Bozhidar Batsov <bozhi...@batsov.dev> Commit: Bozhidar Batsov <bozhi...@batsov.dev>
Revert "[Fix #1804] Make it possible to ignore special project buffers" This reverts commit f5a2a3ab268b905c796de255e04790e6e69a61ab. This out we already had this functionality under the name `projectile-globally-ignored-buffers`. --- CHANGELOG.md | 1 - projectile.el | 31 ------------------------------- test/projectile-test.el | 14 -------------- 3 files changed, 46 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5f60c47e5c..e4cd9f9d2f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,7 +5,6 @@ ### New features * [#1591](https://github.com/bbatsov/projectile/issues/1591): Add `project.el` integration that will make Projectile the default provider for project lookup. -* [#1799](https://github.com/bbatsov/projectile/pull/1799): Make it possible to ignore special project buffers. * Add new command `projectile-find-references` (bound to `C-c C-p ?` and `C-c C-p s x`). ### Bug fixed diff --git a/projectile.el b/projectile.el index 2b29bb26c9..52493cac02 100644 --- a/projectile.el +++ b/projectile.el @@ -822,27 +822,6 @@ If the value is nil, there is no limit to the opend buffers count." :type 'integer :package-version '(projectile . "2.2.0")) -(defcustom projectile-ignore-special-project-buffers t - "When t ignore special project buffers. - -See `projectile-ignored-project-buffers'." - :group 'projectile - :type 'boolean - :package-version '(projectile . "2.7.0")) - -(defcustom projectile-ignored-project-buffers - '( - "*scratch*" ; Lisp Interaction Buffer - "*lsp-log*" ; LSP Mode Troubleshooting Buffer - ) - "A list of buffers considered that should never be killed or -associated with any specific project. - -See `projectile-ignore-special-project-buffers'." - :group 'projectile - :type '(repeat string) - :package-version '(projectile . "2.7.0")) - (defvar projectile-project-test-suffix nil "Use this variable to override the current project's test-suffix property. It takes precedence over the test-suffix for the project type when set. @@ -1662,22 +1641,12 @@ If PROJECT is not specified the command acts on the current project." default-directory))) (and (not (string-prefix-p " " (buffer-name buffer))) (not (projectile-ignored-buffer-p buffer)) - (not (projectile-ignored-project-buffers-p buffer)) directory (string-equal (file-remote-p directory) (file-remote-p project-root)) (not (string-match-p "^http\\(s\\)?://" directory)) (string-prefix-p project-root (file-truename directory) (eq system-type 'windows-nt)))))) -(defun projectile-ignored-project-buffers-p (buffer) - "Check if BUFFER should never associated with any specific project" - (when projectile-ignore-special-project-buffers - (with-current-buffer buffer - (cl-some - (lambda (name) - (string-match-p name (buffer-name))) - projectile-ignored-project-buffers)))) - (defun projectile-ignored-buffer-p (buffer) "Check if BUFFER should be ignored. diff --git a/test/projectile-test.el b/test/projectile-test.el index cf445a10f3..875b01ec52 100644 --- a/test/projectile-test.el +++ b/test/projectile-test.el @@ -1038,20 +1038,6 @@ Just delegates OPERATION and ARGS for all operations except for`shell-command`'. (expect (current-buffer) :to-be (get-file-buffer "project/file"))))))) -(describe "projectile-ignored-project-buffers-p" - (it "checks if buffer should never associated with any specific project" - (let ((projectile-ignore-special-project-buffers t) - (projectile-ignored-project-buffers '("*nrepl messages*" "*something*"))) - (expect (projectile-ignored-project-buffers-p (get-buffer-create "*nrepl messages*")) :to-be-truthy) - (expect (projectile-ignored-project-buffers-p (get-buffer-create "*something*")) :to-be-truthy) - (expect (projectile-ignored-project-buffers-p (get-buffer-create "test")) :not :to-be-truthy))) - (it "check if buffer should not ignored when not enabled" - (let ((projectile-ignore-special-project-buffers nil) - (projectile-ignored-project-buffers '("*nrepl messages*" "*something*"))) - (expect (projectile-ignored-project-buffers-p (get-buffer-create "*nrepl messages*")) :not :to-be-truthy) - (expect (projectile-ignored-project-buffers-p (get-buffer-create "*something*")) :not :to-be-truthy) - (expect (projectile-ignored-project-buffers-p (get-buffer-create "test")) :not :to-be-truthy)))) - (describe "projectile-ignored-buffer-p" (it "checks if buffer should be ignored" (let ((projectile-globally-ignored-buffers '("*nrepl messages*" "*something*")))