update packages

This commit is contained in:
2021-01-08 19:32:30 +01:00
parent ce8f24d28a
commit f5649dceab
467 changed files with 26642 additions and 22487 deletions

View File

@@ -1,6 +1,6 @@
;;; treemacs.el --- A tree style file viewer package -*- lexical-binding: t -*-
;; Copyright (C) 2020 Alexander Miller
;; Copyright (C) 2021 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
@@ -31,18 +31,20 @@
"Determine the location of python 3."
(--if-let (executable-find "python3") it
(when (eq system-type 'windows-nt)
(->> "where python"
(shell-command-to-string)
(s-trim)
(s-lines)
(--first
(when (file-exists-p it)
(->> (concat (shell-quote-argument it) " --version")
(shell-command-to-string)
(s-trim)
(s-replace "Python " "")
(s-left 1)
(version<= "3"))))))))
(condition-case _
(->> "where python"
(shell-command-to-string)
(s-trim)
(s-lines)
(--first
(when (file-exists-p it)
(->> (concat (shell-quote-argument it) " --version")
(shell-command-to-string)
(s-trim)
(s-replace "Python " "")
(s-left 1)
(version<= "3")))))
(error nil)))))
(cl-macrolet
((define-action-widget (name include-default include-tab include-ret)
@@ -116,6 +118,21 @@ indentation will be a space INTEGER pixels wide."
(const :tag "" px)))
:group 'treemacs)
(defcustom treemacs-read-string-input 'from-child-frame
"The function treemacs uses to read user input.
Only applies to plaintext input, like when renaming a project, file or
workspace.
There are 2 options:
- `from-child-frame': will use the `cfrs' package to read input from a small
child frame pop-up. Only available in GUI frames, otherwise the default
minibuffer input is used.
- `from-minibuffer': will read input from the minibuffer, same as baseline
Emacs."
:type '(choice (const :tag "With Child Frame Popup" 'from-child-frame)
(const :tag "From the Minibuffer (Emacs Default)" 'from-minibuffer))
:group 'treemacs)
(defcustom treemacs-move-forward-on-expand nil
"When non-nil treemacs will move to the first child of an expanded node."
:type 'boolean
@@ -182,7 +199,7 @@ of how this config works and how to modify it."
(defcustom treemacs-default-visit-action
'treemacs-visit-node-no-split
"Defines the behavior of `treemacs-visit-node-default'."
"Defines the behaviour of `treemacs-visit-node-default'."
:type 'treemacs-default-action
:group 'treemacs)
@@ -221,24 +238,24 @@ To keep the alist clean changes should not be made directly, but with
Files will still always be shown after directories.
Valid values are:
* alphabetic-asc,
* alphabetic-desc,
* alphabetic-case-insensitive-asc,
* alphabetic-case-insensitive-desc,
* size-asc,
* size-desc,
* mod-time-asc,
* mod-time-desc
* `alphabetic-asc',
* `alphabetic-desc',
* `alphabetic-case-insensitive-asc',
* `alphabetic-case-insensitive-desc',
* `size-asc',
* `size-desc',
* `mod-time-asc',
* `mod-time-desc'
* a custom function
In the latter case it must be a function that can be passed to `sort' to sort
absolute filepaths. For an example see `treemacs--sort-alphabetic-asc'
Note about performance:
Treemacs does its best to optimize its performance critical path, it does so
Treemacs does its best to optimise its performance critical path, it does so
by doing as little work as possible and producing as little garbage as possible.
Deciding on the order in which its nodes are inserted is a part of this path.
As such certain tradeoffs need to be accounted far.
As such certain trade-offs need to be accounted far.
In plaintext: some sort settings are much slower than others. Alphabetic
sorting \(the default) is fastest and causes no additional overhead (even when
@@ -271,13 +288,13 @@ treemacs views containing hundreds or even thousands of nodes."
Ignored files will *never* be shown in the treemacs buffer (unlike dotfiles)
whose presence is controlled by `treemacs-show-hidden-files').
Each predicate is a function that takes 2 arguments: a files's name and its
Each predicate is a function that takes 2 arguments: a file's name and its
absolute path and returns t if the file should be ignored and nil otherwise. A
file which returns t for *any* function in this list counts as ignored.
By default this list contains `treemacs--std-ignore-file-predicate' which
filters out '.', '..', Emacs' lock files as well as flycheck's temp files, and
therefore should not be directly overwritten, but added to and removed from
filters out '.', '..', Emacs' lock files as well temp files created by flycheck,
and therefore should not be directly overwritten, but added to and removed from
instead.
Additionally `treemacs--mac-ignore-file-predicate' is also included on
Mac-derived operating systems (when `system-type' is `darwin')."
@@ -291,7 +308,7 @@ functions in this list will be called on files just before they would be
rendered, when the files' git status information is now available. This for
example allows to make files ignored by git invisible.
The functions in this list are therefore expected to have a different signature:
They must take two arguments - a file's absolute path and a hashtable that maps
They must take two arguments - a file's absolute path and a hash table that maps
files to their git status. The files' paths are the table's keys, its values are
characters (and not strings) indicating the file's git condition. The chars map
map as follows: (the pattern is derived from 'git status --porcelain')
@@ -323,19 +340,19 @@ See also `treemacs-filewatch-mode'."
:group 'treemacs)
(defcustom treemacs-goto-tag-strategy 'refetch-index
"Inidicates how to move to a tag when its buffer is dead.
"Indicates how to move to a tag when its buffer is dead.
The tags in the treemacs view store their position as markers (or overlays if
semantic mode is on) pointing to a buffer. If that buffer is killed, or has
never really been open, as treemacs kills buffer after fetching their tags if
they did no exist before, the stored positions become stale, and treemacs needs
to use a different method to move to that tag. This variale sets that method.
to use a different method to move to that tag. This variable sets that method.
Its possible values are:
* refetch-index
Call up the file's imenu index again and use its information to jump.
* call-xref
Call `xref-find-definitions' to find the tag. Only available since Emacs 25.
Call `xref-find-definitions' to find the tag.
* issue-warning
Just issue a warning that the tag's position pointer is invalid."
:type 'integer
@@ -349,7 +366,7 @@ directory.
The value determines how many directories can be collapsed at once, both as a
performance cap and to prevent too long directory names in the treemacs view.
To minimize this option's impact on display performace the search for
To minimise this option's impact on display performance the search for
directories to collapse is done asynchronously in a python script and will thus
only work when python installed. The script should work both on python 2 and 3."
:type 'integer
@@ -376,6 +393,11 @@ The change will apply the next time a treemacs buffer is created."
:type 'boolean
:group 'treemacs)
(defcustom treemacs-expand-added-projects t
"When non-nil newly added projects will be expanded."
:type 'boolean
:group 'treemacs)
(defcustom treemacs-recenter-after-project-jump 'always
"Decides when to recenter view after moving between projects.
Specifically applies to calling `treemacs-next-project' and
@@ -407,7 +429,7 @@ Possible values are:
(defcustom treemacs-pulse-on-success t
"When non-nil treemacs will pulse the current line as a success indicator.
This applies to actions like `treemacs-copy-path-at-point'."
This applies to actions like `treemacs-copy-relative-path-at-point'."
:type 'boolean
:group 'treemacs)
@@ -483,7 +505,9 @@ Note that this does *not* take `scroll-margin' into account."
2)))
"The value for `imenu-generic-expression' treemacs uses in elisp buffers.
More discriminating than the default as it distinguishes between functions,
inline functions, macros, faces, variables, customizations and types."
inline functions, macros, faces, variables, customisations and types.
Can be set to nil to use the default value."
:type 'alist
:group 'treemacs)
@@ -521,39 +545,17 @@ missing project will not appear in the project list next time Emacs is started."
(defcustom treemacs--fringe-indicator-bitmap
(if (fboundp 'define-fringe-bitmap)
(define-fringe-bitmap 'treemacs--fringe-indicator-bitmap
(vector #b00000111
#b00000111
#b00000111
#b00000111
#b00000111
#b00000111
#b00000111
#b00000111
#b00000111
#b00000111
#b00000111
#b00000111
#b00000111
#b00000111
#b00000111
#b00000111
#b00000111
#b00000111
#b00000111
#b00000111
#b00000111
#b00000111
#b00000111
#b00000111
#b00000111
#b00000111))
(define-fringe-bitmap 'treemacs--fringe-indicator-bitmap-default (make-vector 200 #b00000111))
'vertical-bar)
"The fringe bitmap used by the fringe-indicator minor mode."
:type 'fringe-bitmap
:options (if (fboundp 'fringe-bitmaps)
(cons 'treemacs--fringe-indicator-bitmap fringe-bitmaps)
nil)
:type (append '(choice)
;; :type is evaluated before the call to define-fringe-bitmap
;; so 'treemacs--fringe-indicator-bitmap-default is not yet in
;; fringe-bitmaps
'((const treemacs--fringe-indicator-bitmap-default))
;; `fringe-bitmpas' is void in the CI build Emacs
(when (bound-and-true-p fringe-bitmaps)
(mapcar (lambda (sym) `(const ,sym)) fringe-bitmaps)))
:group 'treemacs)
(defcustom treemacs-show-cursor nil
@@ -661,7 +663,7 @@ not apply to the simple `treemacs-git-mode.'"
(defcustom treemacs-python-executable (treemacs--find-python3)
"The python executable used by treemacs.
An asynchronous python process is used in two optional feaures:
An asynchronous python process is used in two optional features:
`treemacs-collapse-dirs' and the extended variant of `treemacs-git-mode'.
There is generally only one reason to change this value: an extended
@@ -675,8 +677,8 @@ the python3 binary."
"Text to be appended to treemacs' git command.
With `treemacs-git-mode' the command `git status --porcelain --ignored .' is
run to fetch a directory's git information. The content of this variable will
be appended to this git command. This might be useful in cases when git's
output is so large that it leads to palpable delays, while setting
be appended to this git command. This might be useful in cases when the output
produced by git is so large that it leads to palpable delays, while setting
`treemacs-max-git-entries' leads to loss of information. In such a scenario an
additional filter statement (for example `| grep -v \"/vendor_dir/\"') can be
used to reduce the size of the output to a manageable volume for treemacs."
@@ -691,6 +693,14 @@ In practice means that treemacs will become invisible to commands like
:type 'boolean
:group 'treemacs-window)
(defcustom treemacs-window-background-color nil
"Custom background colours for the treemacs window.
Value must be a cons cell consisting of two colours: first the background of the
treemacs window proper, then a second colour for treemacs' `hl-line' overlay
marking the selected line."
:type '(cons color color)
:group 'treemacs-window)
(defcustom treemacs-width 35
"Width of the treemacs window."
:type 'integer
@@ -701,7 +711,7 @@ In practice means that treemacs will become invisible to commands like
On the one hand this will alleviate issues of unequally sized window splits when
treemacs is visible (since Emacs does not quite understand that treemacs has
fixed window size). On the other hand it may lead to issues with other packages
like shell-pop, as making treemacs a side-window makes it unsplittable."
like shell-pop, as making treemacs a side-window renders it un-splittable."
:type 'boolean
:group 'treemacs-window)
@@ -709,7 +719,7 @@ like shell-pop, as making treemacs a side-window makes it unsplittable."
"When non-nil treemacs will have the `no-delete-other-windows' parameter.
This parameter prevents the treemacs window from closing when calling
`delete-other-windows' or when a command like `magit-status' would launch a new
fullscreen buffer.
full-screen buffer.
Note that treemacs has its own delete-windows command with
`treemacs-delete-other-windows' that behaves the same as `delete-other-windows',
but won't close treemacs itself.
@@ -757,7 +767,7 @@ deleted."
(defcustom treemacs-rename-project-functions nil
"Hooks to run whenever a project is renamed.
Will be called with the renamed project and the old name as its argumens."
Will be called with the renamed project and the old name as its arguments."
:type 'hook
:group 'treemacs-hooks)
@@ -776,7 +786,7 @@ been deleted."
(defcustom treemacs-rename-workspace-functions nil
"Hooks to run whenever a workspace is renamed.
Will be called with the renamed workspace and the old name as its argumens."
Will be called with the renamed workspace and the old name as its arguments."
:type 'hook
:group 'treemacs-hooks)
@@ -860,10 +870,16 @@ The hooks will be run *after* the treemacs buffer was destroyed."
:type 'hook
:group 'treemacs-hooks)
(defcustom treemacs-select-hook nil
(define-obsolete-variable-alias 'treemacs-select-hook 'treemacs-select-functions "2.9")
(defcustom treemacs-select-functions nil
"Hooks to run when the treemacs window is selected.
This only applies to commands like `treemacs' or `treemacs-select-window', not
general window selection commands like `other-window'."
The hook should accept one argument which is a symbol describing treemacs'
visibility before the select was invoked, as it would have been returned by
`treemacs-current-visibility'.
This hook only applies to commands like `treemacs' or `treemacs-select-window',
not general window selection commands like `other-window'."
:type 'hook
:group 'treemacs-hooks)
@@ -880,7 +896,7 @@ current scope (frame or perspective) it was found for."
"Decides how treemacs determines a file's extension.
There are 2 options:
- An extension should be everything past the *last* period of the file name.
In this case this shoud be set to `treemacs-last-period-regex-value'
In this case this should be set to `treemacs-last-period-regex-value'
- An extension should be everything past the *first* period of the file name.
In this case this should be set to `treemacs-first-period-regex-value'"
:group 'treemacs
@@ -894,10 +910,37 @@ If nil treemacs will look for default value provided by `spaceline', `moody'
or `doom-modeline' in that order. Finally, if none of these packages is
available \"Treemacs\" text will be displayed.
Setting this to `none' will disable the modeline.
For more specific information about formatting mode line check `mode-line-format'."
:type 'sexp
:group 'treemacs)
(defcustom treemacs-workspace-switch-cleanup nil
"Indicates which, if any, buffers should be deleted on a workspace switch.
Only applies when interactively calling `treemacs-switch-workspace'.
Valid values are
- nil to do nothing
- `files' to delete buffers visiting files
- `all' to delete all buffers other than treemacs and the scratch buffer
In any case treemacs itself and the scratch and messages buffer will be
unaffected."
:type '(choice (const :tag "All Buffers" all)
(const :tag "Only File Buffers" files)
(const :tag "None" nil))
:group 'treemacs)
(defcustom treemacs-imenu-scope 'everything
"Determines which items treemacs' imenu function will collect.
There are 2 options:
- `everything' will collect entries from every project in the workspace.
- `current-project' will only gather the index for the project at point."
:type '(choice (const :tag "Everything" everything)
(const :tag "Current Project Only" current-project))
:group 'treemacs)
(provide 'treemacs-customization)
;;; treemacs-customization.el ends here