From d35e7b85bf630332d8de2e4bde0bbb0075637aac Mon Sep 17 00:00:00 2001 From: Hong Xu Date: Sat, 5 Oct 2019 12:47:12 -0700 Subject: [PATCH] Allow users to enable treemacs-tag-follow-mode as initial setup. --- CHANGELOG.develop | 1 + layers/+filetree/treemacs/README.org | 9 +++++---- layers/+filetree/treemacs/packages.el | 8 ++++++-- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.develop b/CHANGELOG.develop index 1ce3f9bf5..a9a0e6451 100644 --- a/CHANGELOG.develop +++ b/CHANGELOG.develop @@ -2744,6 +2744,7 @@ Other: Breen) - Made sure treemacs' minor modes will be disabled when they are configured to be off. +- Add =tag= as an accepted value for option =treemacs-use-follow-mode=. **** Typescript - Call tsfmt with extension of current buffer for TSX formatting (thanks to Victor Andrée) diff --git a/layers/+filetree/treemacs/README.org b/layers/+filetree/treemacs/README.org index 8993fb448..d618f0ff2 100644 --- a/layers/+filetree/treemacs/README.org +++ b/layers/+filetree/treemacs/README.org @@ -37,7 +37,7 @@ readme]]. In a short summary Treemacs offers the following: - Optionally fontifying files based on their git status. - Optionally collapsing single-dir-child directories into one. - Doing both asynchronously for an imperceptible performance cost. -- Optional =follow-mode= to automatically focus the currently selected file. +- Optional =follow-mode= to automatically focus the currently selected file or tag. - Optional =filewatch-mode= to automatically refresh the view after (and only after) changes to the shown filesystem. @@ -47,12 +47,13 @@ To use this layer, add =treemacs= to the existing * Configuration ** Follow mode -To have treemacs automatically sync with your current buffer set the -layer variable =treemacs-use-follow-mode= to non-nil. +To have Treemacs automatically sync with your current: +- Buffer's file, set the layer variable =treemacs-use-follow-mode= to =t=. +- Tag, set the layer variable =treemacs-use-follow-mode= to =tag=. #+BEGIN_SRC emacs-lisp (setq-default dotspacemacs-configuration-layers '( - (treemacs :variables treemacs-use-follow-mode t))) + (treemacs :variables treemacs-use-follow-mode 'tag))) #+END_SRC Default is =t=. diff --git a/layers/+filetree/treemacs/packages.el b/layers/+filetree/treemacs/packages.el index 075787152..c1a8ea837 100644 --- a/layers/+filetree/treemacs/packages.el +++ b/layers/+filetree/treemacs/packages.el @@ -1,8 +1,9 @@ ;;; packages.el --- treemacs Layer packages File for Spacemacs ;; -;; Copyright (c) 2012-2018 Sylvain Benner & Contributors +;; Copyright (c) 2012-2019 Sylvain Benner & Contributors ;; ;; Author: Alexander Miller +;; Hong Xu ;; URL: https://github.com/syl20bnr/spacemacs ;; ;; This file is not part of GNU Emacs. @@ -65,9 +66,12 @@ (spacemacs/define-evil-state-face "treemacs" "MediumPurple1") ;; minor modes are enabled by default, so they must be explicitly ;; turned off - (if treemacs-use-follow-mode + (if (eq treemacs-use-follow-mode t) (treemacs-follow-mode t) (treemacs-follow-mode -1)) + (if (eq treemacs-use-follow-mode 'tag) + (treemacs-tag-follow-mode t) + (treemacs-tag-follow-mode -1)) (if treemacs-use-filewatch-mode (treemacs-filewatch-mode t) (treemacs-filewatch-mode -1))