From 21a1d3a1580dae59010bc51e85038ea5e80554c9 Mon Sep 17 00:00:00 2001 From: tastytea Date: Wed, 12 Feb 2020 14:39:47 +0100 Subject: [PATCH] Emacs: Rewrite my/switch-project() so that it works. Call projectile-find-file before treemacs. --- init.d/programming/common.el | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/init.d/programming/common.el b/init.d/programming/common.el index 070b8ce..48a6f56 100644 --- a/init.d/programming/common.el +++ b/init.d/programming/common.el @@ -1,6 +1,6 @@ ;;; common.el --- Common programming settings. -*- lexical-binding: t; -*- -;; Time-stamp: <2020-02-11T23:37:35+0100> +;; Time-stamp: <2020-02-12T14:39:05+0100> ;;; Commentary: @@ -132,13 +132,14 @@ (substring (shell-command-to-string "nproc --ignore=1") 0 -1))) (defun my/switch-project () - "Open `treemacs', add project to workspace and find file in project." - (treemacs-add-and-display-current-project) - (treemacs-collapse-other-projects) - (treemacs-toggle-node) + "Find file in project, add project to `treemacs' and +collapse other projects." (if (member 'counsel-projectile-mode minor-mode-list) (counsel-projectile-find-file) - (projectile-find-file))) + (projectile-find-file)) + (treemacs-add-and-display-current-project) + (treemacs-collapse-other-projects) + (other-window 1)) (defun my/projectile-kill-buffers () "Kill project buffers and delete other windows."