update packages
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
;;; treemacs.el --- A tree style file viewer package -*- lexical-binding: t -*-
|
||||
|
||||
;; Copyright (C) 2023 Alexander Miller
|
||||
;; Copyright (C) 2024 Alexander Miller
|
||||
|
||||
;; This program is free software; you can redistribute it and/or modify
|
||||
;; it under the terms of the GNU General Public License as published by
|
||||
@@ -155,6 +155,7 @@ Real implementation will be `fset' based on `treemacs-git-mode' value."
|
||||
(command `(,treemacs-python-executable
|
||||
"-O"
|
||||
,treemacs--git-status.py
|
||||
,treemacs-git-executable
|
||||
,git-root
|
||||
,(number-to-string treemacs-max-git-entries)
|
||||
,treemacs-git-command-pipe
|
||||
@@ -197,7 +198,7 @@ GIT-FUTURE: Pfuture"
|
||||
"Start a simple git status process for files under PATH."
|
||||
(let* ((default-directory (file-truename path))
|
||||
(process-environment (cons "GIT_OPTIONAL_LOCKS=0" process-environment))
|
||||
(future (pfuture-new "git" "status" "--porcelain" "--ignored=matching" "-z" ".")))
|
||||
(future (pfuture-new treemacs-git-executable "status" "--porcelain" "--ignored=matching" "-z" ".")))
|
||||
(process-put future 'default-directory default-directory)
|
||||
future))
|
||||
|
||||
@@ -285,7 +286,8 @@ OVERRIDE-STATUS: Boolean"
|
||||
"NONE")))
|
||||
(cmd `(,treemacs-python-executable
|
||||
"-O"
|
||||
,treemacs--single-file-git-status.py ,file ,current-face ,@parents)))
|
||||
,treemacs--single-file-git-status.py
|
||||
,treemacs-git-executable ,file ,current-face ,@parents)))
|
||||
(pfuture-callback cmd
|
||||
:directory parent
|
||||
:name "Treemacs Update Single File Process"
|
||||
@@ -330,7 +332,7 @@ Used when asynchronous processes report back git changes."
|
||||
(when btn
|
||||
(treemacs--do-apply-annotation btn ,git-face))))))
|
||||
|
||||
(defun treemacs--collapsed-dirs-process (path project)
|
||||
(defun treemacs--flattened-dirs-process (path project)
|
||||
"Start a new process to determine directories to collapse under PATH.
|
||||
Only starts the process if PROJECT is locally accessible (i.e. exists, and
|
||||
is not remote.)
|
||||
@@ -349,24 +351,34 @@ Every string list consists of the following elements:
|
||||
(when (and (> treemacs-collapse-dirs 0)
|
||||
treemacs-python-executable
|
||||
(treemacs-project->is-local-and-readable? project))
|
||||
;; needs to be set or we'll run into trouble when deleting
|
||||
;; haven't taken the time to figure out why, so let's just leave it at that
|
||||
(-let [default-directory path]
|
||||
(pfuture-new treemacs-python-executable
|
||||
"-O"
|
||||
treemacs--dirs-to-collapse.py
|
||||
path
|
||||
(number-to-string treemacs-collapse-dirs)
|
||||
(if treemacs-show-hidden-files "t" "x")))))
|
||||
(let (;; needs to be set or we'll run into trouble when deleting
|
||||
;; haven't taken the time to figure out why, so let's just leave it at that
|
||||
(default-directory path)
|
||||
(search-paths nil))
|
||||
(treemacs-walk-reentry-dom (treemacs-find-in-dom path)
|
||||
(lambda (node)
|
||||
(-let [key (treemacs-dom-node->key node)]
|
||||
(when (stringp key) (push key search-paths)))))
|
||||
(-let [command
|
||||
`(,treemacs-python-executable
|
||||
"-O"
|
||||
,treemacs--dirs-to-collapse.py
|
||||
,(number-to-string treemacs-collapse-dirs)
|
||||
,(if treemacs-show-hidden-files "t" "x")
|
||||
,@search-paths)]
|
||||
(apply #'pfuture-new command)))))
|
||||
|
||||
(defun treemacs--parse-collapsed-dirs (future)
|
||||
"Parse the output of collapsed dirs FUTURE.
|
||||
Splits the output on newlines, splits every line on // and swallows the first
|
||||
newline."
|
||||
(defun treemacs--parse-flattened-dirs (path future)
|
||||
"Parse the output of flattened dirs in PATH with FUTURE."
|
||||
(when future
|
||||
(-let [output (pfuture-await-to-finish future)]
|
||||
(when (= 0 (process-exit-status future))
|
||||
(read output)))))
|
||||
(-if-let (output (process-get future 'output))
|
||||
(ht-get output path)
|
||||
(let* ((stdout (pfuture-await-to-finish future))
|
||||
(output (if (= 0 (process-exit-status future))
|
||||
(read stdout)
|
||||
(ht))))
|
||||
(process-put future 'output output)
|
||||
(ht-get output path)))))
|
||||
|
||||
(defun treemacs--prefetch-gitignore-cache (path)
|
||||
"Pre-load all the git-ignored files in the given PATH.
|
||||
@@ -385,6 +397,7 @@ run because the git cache has yet to be filled."
|
||||
(pfuture-callback `(,treemacs-python-executable
|
||||
"-O"
|
||||
,treemacs--find-ignored-files.py
|
||||
,treemacs-git-executable
|
||||
,@path)
|
||||
:on-error (ignore)
|
||||
:on-success
|
||||
@@ -397,7 +410,7 @@ run because the git cache has yet to be filled."
|
||||
(unless cache
|
||||
(setf cache (make-hash-table :size 20 :test 'equal))
|
||||
(ht-set! treemacs--git-cache root cache))
|
||||
(ht-set! cache file "!")
|
||||
(ht-set! cache file 'treemacs-git-ignored-face)
|
||||
(push file ignored-files)))
|
||||
(treemacs-run-in-every-buffer
|
||||
(treemacs-save-position
|
||||
|
||||
Reference in New Issue
Block a user