diff --git a/CHANGELOG.md b/CHANGELOG.md index 2d3e595e1..bd42ef10e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,6 +18,7 @@ * [#1340](https://github.com/bbatsov/projectile/pull/1340): Fix remote projects being removed if TRAMP can't connect. * [#1655](https://github.com/bbatsov/projectile/pull/1655): Fix `projectile-replace-regexp` searching the wrong files when called with prefix arg. * [#1659](https://github.com/bbatsov/projectile/issues/1659): Fix `projectile-project-vcs` to work outside a project. +* [#1637](https://github.com/bbatsov/projectile/pull/1661): Integrate with savehist-mode ## 2.3.0 (2020-11-27) diff --git a/projectile.el b/projectile.el index 1f11fd1bf..14766a4b5 100644 --- a/projectile.el +++ b/projectile.el @@ -5125,6 +5125,15 @@ Otherwise behave as if called interactively. (advice-remove 'compilation-find-file #'compilation-find-file-projectile-find-compilation-buffer) (advice-remove 'delete-file #'delete-file-projectile-remove-from-cache)))) +;;; savehist-mode - When `savehist-mode' is t, projectile-project-command-history will be saved. +;; See https://github.com/bbatsov/projectile/issues/1637 for more details +(if (bound-and-true-p savehist-loaded) + (add-to-list 'savehist-additional-variables 'projectile-project-command-history) + (defvar savehist-additional-variables nil) + (add-hook 'savehist-mode-hook + (lambda() + (add-to-list 'savehist-additional-variables 'projectile-project-command-history)))) + ;;;###autoload (define-obsolete-function-alias 'projectile-global-mode 'projectile-mode "1.0")