From 560868dbb5e7d19d166bab4da1d0221adba887bb Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Sun, 13 Apr 2014 21:08:20 +0100 Subject: Emacs: remove project-persist mode I didn't use it, and projectile can switch projects on its own now. --- tag-emacs/emacs.d/Cask | 1 - tag-emacs/emacs.d/init.el | 66 ----------------------------------------------- 2 files changed, 67 deletions(-) (limited to 'tag-emacs') 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))) -- cgit 1.4.1