diff options
author | Alan Pearce | 2014-04-13 21:08:20 +0100 |
---|---|---|
committer | Alan Pearce | 2014-04-13 21:08:20 +0100 |
commit | 560868dbb5e7d19d166bab4da1d0221adba887bb (patch) | |
tree | 698e0336372f07e780dca03edc3f3e9bd1e840ce /tag-emacs | |
parent | 5e1656ec57ef7dbbd69d060fd6fb78d174a170e0 (diff) | |
download | dotfiles-560868dbb5e7d19d166bab4da1d0221adba887bb.tar.lz dotfiles-560868dbb5e7d19d166bab4da1d0221adba887bb.tar.zst dotfiles-560868dbb5e7d19d166bab4da1d0221adba887bb.zip |
Emacs: remove project-persist mode
I didn't use it, and projectile can switch projects on its own now.
Diffstat (limited to 'tag-emacs')
-rw-r--r-- | tag-emacs/emacs.d/Cask | 1 | ||||
-rw-r--r-- | tag-emacs/emacs.d/init.el | 66 |
2 files changed, 0 insertions, 67 deletions
diff --git a/tag-emacs/emacs.d/Cask b/tag-emacs/emacs.d/Cask index 425a684..78bdeb2 100644 --- a/tag-emacs/emacs.d/Cask +++ b/tag-emacs/emacs.d/Cask @@ -41,7 +41,6 @@ (depends-on "paredit") (depends-on "php-extras") (depends-on "php-mode") -(depends-on "project-persist") (depends-on "projectile") (depends-on "puppet-mode") (depends-on "quickrun") diff --git a/tag-emacs/emacs.d/init.el b/tag-emacs/emacs.d/init.el index 961c709..cf8fb51 100644 --- a/tag-emacs/emacs.d/init.el +++ b/tag-emacs/emacs.d/init.el @@ -725,72 +725,6 @@ Values: `desktop', `server', `laptop'") (setq projectile-switch-project-action #'projectile-dired projectile-remember-window-configs t))) -(use-package project-persist - :commands (project-persist-mode) - :bind (("C-c P d" . project-persist-delete) - ("C-c P f" . project-persist-find) - ("C-c P k" . project-persist-close) - ("C-c P n" . project-persist-create) - ("C-c P s" . project-persist-save)) - :init (eval-when-compile - (autoload #'pp/settings-get "project-persist")) - :config (progn - (project-persist-mode t) - - (setq project-persist-auto-save-global t) - - (add-hook 'project-persist-before-load-hook #'kill-all-buffers) - - (defun emacs-process-p (pid) - "If pid is the process ID of an emacs process, return t, else nil. -Also returns nil if pid is nil." - (when pid - (let ((attributes (process-attributes pid)) (cmd)) - (dolist (attr attributes) - (if (string= "comm" (car attr)) - (setq cmd (cdr attr)))) - (if (and cmd (or (string= "emacs" cmd) (string= "emacs.exe" cmd))) t)))) - - (defadvice desktop-owner (after pry-from-cold-dead-hands activate) - "Don't allow dead emacsen to own the desktop file." - (when (not (emacs-process-p ad-return-value)) - (setq ad-return-value nil))) - - (defun load-project-desktop () - "Load the project's desktop if available" - (ignore-errors - (let ((default-directory project-persist-current-project-settings-dir)) - (desktop-read)))) - - (defun kill-all-buffers () - "Kill all file-based buffers." - (interactive) - (mapc (lambda (buf) - (when (buffer-file-name buf) - (when (and (buffer-modified-p buf) - (y-or-n-p (format "Buffer %s is modified - save it?" (buffer-name buf)))) - (save-some-buffers nil buf)) - (set-buffer-modified-p nil) - (kill-buffer buf))) - (buffer-list))) - - (add-hook 'project-persist-after-close-hook - (lambda () - (kill-all-buffers) - (projectile-global-mode -1))) - - (add-hook 'project-persist-after-load-hook - (lambda () - (setq default-directory (pp/settings-get 'root-dir)) - (load-project-desktop) - (projectile-global-mode 1))) - - (add-hook 'project-persist-after-save-hook - (lambda () - (message (format "Saving project desktop (%s)" project-persist-current-project-settings-dir)) - (desktop-save project-persist-current-project-settings-dir))) -)) - (use-package vc :config (progn (setq vc-follow-symlinks t))) |