Emacs: Only enable caching for .emacs.d, better workaround.
This commit is contained in:
parent
d41b1a9963
commit
6c0dd5b147
|
@ -1,4 +0,0 @@
|
|||
;;; Directory Local Variables
|
||||
;;; For more information see (info "(emacs) Directory Variables")
|
||||
|
||||
((nil . ((projectile-enable-caching . t))))
|
|
@ -1,6 +1,6 @@
|
|||
;;; common.el --- Common programming settings. -*- lexical-binding: t; -*-
|
||||
|
||||
;; Time-stamp: <2020-08-03T01:31:35+0200>
|
||||
;; Time-stamp: <2020-08-03T02:56:38+0200>
|
||||
|
||||
;;; Commentary:
|
||||
|
||||
|
@ -106,9 +106,26 @@
|
|||
(substring
|
||||
(shell-command-to-string "nproc --ignore=1") 0 -1)))
|
||||
|
||||
(defun my/projectile-enable-caching? (&rest args)
|
||||
"Turn on caching for certain projects.
|
||||
Ignores ARGS."
|
||||
(if (string= (projectile-project-name) ".emacs.d")
|
||||
(progn
|
||||
(message "Turning on caching for \"%s\"."
|
||||
(projectile-project-name))
|
||||
(setq-local projectile-enable-caching t))
|
||||
(kill-local-variable 'projectile-enable-caching)))
|
||||
(advice-add 'projectile-find-file
|
||||
:before #'my/projectile-enable-caching?)
|
||||
(advice-add 'counsel-projectile-find-file
|
||||
:before #'my/projectile-enable-caching?)
|
||||
|
||||
(defun my/switch-project ()
|
||||
"Find file in project, add project to `treemacs' and
|
||||
collapse other projects."
|
||||
; Enable caching maybe before listing files.
|
||||
(my/projectile-enable-caching?)
|
||||
|
||||
(if (member 'counsel-projectile-mode minor-mode-list)
|
||||
(counsel-projectile-find-file)
|
||||
(projectile-find-file))
|
||||
|
|
Loading…
Reference in New Issue
Block a user