From 7660013eadd742f9ba98842001fbf7d14d7758dd Mon Sep 17 00:00:00 2001 From: tastytea Date: Fri, 27 Mar 2020 00:05:09 +0100 Subject: [PATCH] Emacs: Only open treemacs automatically if window-width is >= 120. --- init.d/programming/common.el | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/init.d/programming/common.el b/init.d/programming/common.el index 8714847..d165f31 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-03-18T14:58:25+0100> +;; Time-stamp: <2020-03-27T00:04:55+0100> ;;; Commentary: @@ -110,9 +110,10 @@ collapse other projects." (if (member 'counsel-projectile-mode minor-mode-list) (counsel-projectile-find-file) (projectile-find-file)) - (treemacs-add-and-display-current-project) - (treemacs-collapse-other-projects) - (other-window 1)) + (when (>= (window-total-width) 120) + (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."