;ELC ;;; Compiled ;;; in Emacs version 28.0.50 ;;; with all optimizations. (byte-code "\300\301!\210\300\302!\210\300\303!\210\300\304!\210\300\305!\210\300\306!\207" [require dash s treemacs-rendering treemacs-core-utils treemacs-fringe-indicator treemacs-mouse-interface] 2) #@119 Internal building block. Creates a `treemacs-define-${NAME}-extension' function and the necessary helpers. (fn NAME) (defalias 'treemacs--build-extension-addition '(macro . #[257 "\301\302\303\304\305\306\203\307\202\310\"BC#!\301\302\311\304\305\306\203$\307\202%\310\"BC#!\301\302\312\304\305\306\203:\307\202;\310 \"BC#!\313\314\315BB\314\316BB\317\320\302\321\304\305\306\203^\307\202_\310\"B\305\306\203m\307\202n\310\"BD#\322\323\324\325\326\327\330D\331BBD\332\327\330D\333BBD\334BBBB\335BBB\257F\207" [s-lex-value-as-lisp intern s-format "treemacs-define-${name}-extension" aget "name" format "%S" "%s" "treemacs--${name}-top-extensions" "treemacs--${name}-bottom-extensions" progn defvar (nil) (nil) cl-defun (&key extension predicate position) "Define an extension of type `${name}' for treemacs to use.\nEXTENSION is an extension function, as created by `treemacs-define-expandable-node'\nwhen a `:root' argument is given.\n\nPREDICATE is a function that will be called to determine whether the extension\nshould be displayed. It is invoked with a single argument, which is the treemacs\nproject struct that is being expanded. All methods that can be invoked on this\ntype start with the `treemacs-project->' prefix.\n\nPOSITION is either `top' or `bottom', indicating whether the extension should be\nrendered as the first or last element of a project.\n\nSee also `treemacs-remove-${name}-extension'." -let [cell (cons extension predicate)] pcase position 'top add-to-list quote (cell) 'bottom (cell) ((other (error "Invalid extension position value `%s'" other))) (t)] 20 (#$ . 290)])) #@119 Internal building block. Creates a `treemacs-remove-${NAME}-extension' function and the necessary helpers. (fn NAME) (defalias 'treemacs--build-extension-removal '(macro . #[257 "\301\302\303\304\305\306\203\307\202\310\"BC#!\301\302\311\304\305\306\203$\307\202%\310\"BC#!\301\302\312\304\305\306\203:\307\202;\310 \"BC#!\313\314\315\302\316\304\305\306\203S\307\202T\310 \"B\305\306\203b\307\202c\310\"BD#\317\320\321\322\n\323\324 EED\325\322\n\323\326 EED\327BBBB\330BBBBBD\207" [s-lex-value-as-lisp intern s-format "treemacs-remove-${name}-extension" aget "name" format "%S" "%s" "treemacs--${name}-top-extensions" "treemacs--${name}-bottom-extensions" progn cl-defun (extension posistion) "Remove an EXTENSION of type `${name}' at a given POSITION.\n See also `treemacs-define-${name}-extension'." pcase posistion 'top setq --reject (equal extension (car it)) 'bottom (equal extension (car it)) ((other (error "Invalid extension position value `%s'" other))) (t)] 18 (#$ . 1933)])) #@102 Internal building block. Creates treemacs--apply-${NAME}-top/bottom-extensions functions. (fn NAME) (defalias 'treemacs--build-extension-application '(macro . #[257 "\301\302\303\304\305\306\203\307\202\310\"BC#!\301\302\311\304\305\306\203$\307\202%\310\"BC#!\301\302\312\304\305\306\203:\307\202;\310 \"BC#!\301\302\313\304\305\306\203P\307\202Q\310\n\"BC#!\314\315\316\302\317\304\305\306\203i\307\202j\310\"BC#\320\321D\322BB\257\315\323\302\324\304\305\306\203\212\307\202\213\310\"BC#\320\321D\325BB\257E\207" [s-lex-value-as-lisp intern s-format "treemacs--apply-${name}-top-extensions" aget "name" format "%S" "%s" "treemacs--apply-${name}-bottom-extensions" "treemacs--${name}-top-extensions" "treemacs--${name}-bottom-extensions" progn defsubst (node data) "Apply the top extensions for NODE of type `${name}'\nAlso pass additional DATA to predicate function." dolist cell ((let ((extension (car cell)) (predicate (cdr cell))) (when (or (null predicate) (funcall predicate data)) (funcall extension node)))) (node data) "Apply the bottom extensions for NODE of type `${name}'\nAlso pass additional DATA to predicate function." ((let ((extension (car cell)) (predicate (cdr cell))) (when (or (null predicate) (funcall predicate data)) (funcall extension node))))] 17 (#$ . 2961)])) (defvar treemacs--project-top-extensions nil) (defvar treemacs--project-bottom-extensions nil) #@688 Define an extension of type `project' for treemacs to use. EXTENSION is an extension function, as created by `treemacs-define-expandable-node' when a `:root' argument is given. PREDICATE is a function that will be called to determine whether the extension should be displayed. It is invoked with a single argument, which is the treemacs project struct that is being expanded. All methods that can be invoked on this type start with the `treemacs-project->' prefix. POSITION is either `top' or `bottom', indicating whether the extension should be rendered as the first or last element of a project. See also `treemacs-remove-project-extension'. (fn &key EXTENSION PREDICATE POSITION) (defalias 'treemacs-define-project-extension #[128 "\300\301\"A@\300\302\"A@\300\303\"A@B\304\267\202+\305\306\"\210\2022\305\307\"\210\2022\310\311\"\266\312\207" [plist-member :extension :predicate :position #s(hash-table size 2 test eq rehash-size 1.5 rehash-threshold 0.8125 purecopy t data (top 27 bottom 35)) add-to-list treemacs--project-top-extensions treemacs--project-bottom-extensions error "Invalid extension position value `%s'" t] 9 (#$ . 4393)]) #@135 Remove an EXTENSION of type `project' at a given POSITION. See also `treemacs-define-project-extension'. (fn EXTENSION POSISTION) (defalias 'treemacs-remove-project-extension #[514 "\211\302\267\202j\303\304\303\211\203.\211A\262\242\262\262T\262@\232\204 B\262\202 \266\211\237\262\202q\303 \304\303\211\203`\211A\262\242\262\262T\262@\232\204=B\262\202=\266\211\237\262\202q\211\305\306\"\266\307\207" [treemacs--project-top-extensions treemacs--project-bottom-extensions #s(hash-table size 2 test eq rehash-size 1.5 rehash-threshold 0.8125 purecopy t data (top 6 bottom 56)) nil 0 error "Invalid extension position value `%s'" t] 9 (#$ . 5562)]) #@118 Apply the top extensions for NODE of type `project' Also pass additional DATA to predicate function. (fn NODE DATA) (defalias 'treemacs--apply-project-top-extensions #[514 "\211\205#\211@\211@A\211\203\211!\203!\210\266A\266\202\202\207" [treemacs--project-top-extensions] 8 (#$ . 6268)]) (byte-code "\300\301\302\303#\304\301\305\306#\207" [function-put treemacs--apply-project-top-extensions speed -1 put byte-optimizer byte-compile-inline-expand] 5) #@121 Apply the bottom extensions for NODE of type `project' Also pass additional DATA to predicate function. (fn NODE DATA) (defalias 'treemacs--apply-project-bottom-extensions #[514 "\211\205#\211@\211@A\211\203\211!\203!\210\266A\266\202\202\207" [treemacs--project-bottom-extensions] 8 (#$ . 6744)]) (byte-code "\300\301\302\303#\304\301\305\306#\207" [function-put treemacs--apply-project-bottom-extensions speed -1 put byte-optimizer byte-compile-inline-expand] 5) (defvar treemacs--directory-top-extensions nil) (defvar treemacs--directory-bottom-extensions nil) #@692 Define an extension of type `directory' for treemacs to use. EXTENSION is an extension function, as created by `treemacs-define-expandable-node' when a `:root' argument is given. PREDICATE is a function that will be called to determine whether the extension should be displayed. It is invoked with a single argument, which is the treemacs project struct that is being expanded. All methods that can be invoked on this type start with the `treemacs-project->' prefix. POSITION is either `top' or `bottom', indicating whether the extension should be rendered as the first or last element of a project. See also `treemacs-remove-directory-extension'. (fn &key EXTENSION PREDICATE POSITION) (defalias 'treemacs-define-directory-extension #[128 "\300\301\"A@\300\302\"A@\300\303\"A@B\304\267\202+\305\306\"\210\2022\305\307\"\210\2022\310\311\"\266\312\207" [plist-member :extension :predicate :position #s(hash-table size 2 test eq rehash-size 1.5 rehash-threshold 0.8125 purecopy t data (top 27 bottom 35)) add-to-list treemacs--directory-top-extensions treemacs--directory-bottom-extensions error "Invalid extension position value `%s'" t] 9 (#$ . 7331)]) #@139 Remove an EXTENSION of type `directory' at a given POSITION. See also `treemacs-define-directory-extension'. (fn EXTENSION POSISTION) (defalias 'treemacs-remove-directory-extension #[514 "\211\302\267\202j\303\304\303\211\203.\211A\262\242\262\262T\262@\232\204 B\262\202 \266\211\237\262\202q\303 \304\303\211\203`\211A\262\242\262\262T\262@\232\204=B\262\202=\266\211\237\262\202q\211\305\306\"\266\307\207" [treemacs--directory-top-extensions treemacs--directory-bottom-extensions #s(hash-table size 2 test eq rehash-size 1.5 rehash-threshold 0.8125 purecopy t data (top 6 bottom 56)) nil 0 error "Invalid extension position value `%s'" t] 9 (#$ . 8510)]) #@120 Apply the top extensions for NODE of type `directory' Also pass additional DATA to predicate function. (fn NODE DATA) (defalias 'treemacs--apply-directory-top-extensions #[514 "\211\205#\211@\211@A\211\203\211!\203!\210\266A\266\202\202\207" [treemacs--directory-top-extensions] 8 (#$ . 9226)]) (byte-code "\300\301\302\303#\304\301\305\306#\207" [function-put treemacs--apply-directory-top-extensions speed -1 put byte-optimizer byte-compile-inline-expand] 5) #@123 Apply the bottom extensions for NODE of type `directory' Also pass additional DATA to predicate function. (fn NODE DATA) (defalias 'treemacs--apply-directory-bottom-extensions #[514 "\211\205#\211@\211@A\211\203\211!\203!\210\266A\266\202\202\207" [treemacs--directory-bottom-extensions] 8 (#$ . 9710)]) (byte-code "\300\301\302\303#\304\301\305\306#\207" [function-put treemacs--apply-directory-bottom-extensions speed -1 put byte-optimizer byte-compile-inline-expand] 5) (defvar treemacs--top-level-top-extensions nil) (defvar treemacs--top-level-bottom-extensions nil) #@692 Define an extension of type `top-level' for treemacs to use. EXTENSION is an extension function, as created by `treemacs-define-expandable-node' when a `:root' argument is given. PREDICATE is a function that will be called to determine whether the extension should be displayed. It is invoked with a single argument, which is the treemacs project struct that is being expanded. All methods that can be invoked on this type start with the `treemacs-project->' prefix. POSITION is either `top' or `bottom', indicating whether the extension should be rendered as the first or last element of a project. See also `treemacs-remove-top-level-extension'. (fn &key EXTENSION PREDICATE POSITION) (defalias 'treemacs-define-top-level-extension #[128 "\300\301\"A@\300\302\"A@\300\303\"A@B\304\267\202+\305\306\"\210\2022\305\307\"\210\2022\310\311\"\266\312\207" [plist-member :extension :predicate :position #s(hash-table size 2 test eq rehash-size 1.5 rehash-threshold 0.8125 purecopy t data (top 27 bottom 35)) add-to-list treemacs--top-level-top-extensions treemacs--top-level-bottom-extensions error "Invalid extension position value `%s'" t] 9 (#$ . 10305)]) #@139 Remove an EXTENSION of type `top-level' at a given POSITION. See also `treemacs-define-top-level-extension'. (fn EXTENSION POSISTION) (defalias 'treemacs-remove-top-level-extension #[514 "\211\302\267\202j\303\304\303\211\203.\211A\262\242\262\262T\262@\232\204 B\262\202 \266\211\237\262\202q\303 \304\303\211\203`\211A\262\242\262\262T\262@\232\204=B\262\202=\266\211\237\262\202q\211\305\306\"\266\307\207" [treemacs--top-level-top-extensions treemacs--top-level-bottom-extensions #s(hash-table size 2 test eq rehash-size 1.5 rehash-threshold 0.8125 purecopy t data (top 6 bottom 56)) nil 0 error "Invalid extension position value `%s'" t] 9 (#$ . 11485)]) (byte-code "\300\301\302\303#\210\304\301\302\305#\210\300\306\307\303#\210\304\306\307\305#\207" [defalias treemacs-define-root-extension treemacs-define-top-level-extension nil make-obsolete "v2.4" treemacs-remove-root-extension treemacs-remove-top-level-extension] 4) #@156 Apply the top extensions for NODE of type `root' for the current WORKSPACE. Returns t if extensions were inserted. (fn WORKSPACE &optional HAS-PREVIOUS) (defalias 'treemacs--apply-root-top-extensions #[513 "\211?\302\303\211\203A\211A\262\242\262\262T\262@A\211\203(\211 !\203<\2048 \2035\304\2026\305c\210 \262\266\202\266\211?\207" [treemacs--top-level-top-extensions treemacs-space-between-root-nodes 0 nil "\n\n" "\n"] 11 (#$ . 12473)]) #@159 Apply the bottom extensions for NODE of type `root' for the current WORKSPACE. Returns t if extensions were inserted. (fn WORKSPACE &optional HAS-PREVIOUS) (defalias 'treemacs--apply-root-bottom-extensions #[513 "\211?\302\303\211\203A\211A\262\242\262\262T\262@A\211\203(\211 !\203<\2048 \2035\304\2026\305c\210 \262\266\202\266\211?\207" [treemacs--top-level-bottom-extensions treemacs-space-between-root-nodes 0 nil "\n\n" "\n"] 11 (#$ . 12949)]) #@138 Turn STRING into an icon for treemacs. Optionally include MORE-PROPERTIES (like `face' or `display'). (fn STRING &rest MORE-PROPERTIES) (defalias 'treemacs-as-icon #[385 "\300\301\302\303%\207" [apply propertize icon t] 8 (#$ . 13434)]) (byte-code "\300\301\302\303#\300\301\304\305#\306\301\307\310#\207" [function-put treemacs-as-icon lisp-indent-function 1 speed -1 put byte-optimizer byte-compile-inline-expand] 6) #@1087 Macro that produces the strings required to render a single treemacs node. Meant to be used as a `:render-action' for `treemacs-define-expandable-node'. ICON is a simple string serving as the node's icon, and must be created with `treemacs-as-icon'. If the icon is for a file you can also use `treemacs-icon-for-file'. LABEL-FORM must return the string that will serve as the node's label text, based on the element that should be rendered being bound as `item'. So for example if rendering a list of buffers RENDER-FORM would look like `(buffer-name item)'. STATE is the symbol that will identify the type of the node. FACE is its face. KEY-FORM is the form that will give the node a unique key, necessary for the node's (and the full custom tree's) ability to stay expanded and visible when the project is refreshed, but also for compatibility and integration with `follow-mode' and `filewatch-mode.' MORE-PROPERTIES is a plist of text properties that can arbitrarily added to the node for quick retrieval later. (fn &key ICON LABEL-FORM STATE FACE KEY-FORM MORE-PROPERTIES) (defalias 'treemacs-render-node '(macro . #[128 "\300\301\"A@\300\302\"A@\300\303\"A@\300\304\"A@\300\305\"A@\300\306\"A@\2035\2035\2035\204=\307\310\311\312\313#!\210\314\315\316\317\320DED\321B\322\323\320\324 \325\f\326\327\330\331\316\205`\332D\333\334\303\335\336\337\340\341\315\342\257\f#BBBBBB\343BBBB\257\207" [plist-member :icon :label-form :state :face :key-form :more-properties error apply format "[Treemacs] All values except :more-properties and :face are mandatory" nil let* path append (treemacs-button-get node :path) list ((dom-node (treemacs-dom-node->create! :key path :parent parent-dom-node))) (treemacs-dom-node->insert-into-dom! dom-node) (when parent-dom-node (treemacs-dom-node->add-child! parent-dom-node dom-node)) (unless (zerop depth) prefix) propertize 'button '(t) 'category 'default-button 'face :custom t :parent node :depth depth :path :key ((when (zerop depth) (if treemacs-space-between-root-nodes "\n\n" "\n")))] 34 (#$ . 13864)])) #@813 Define a type of node that is a leaf and cannot be further expanded. Based on the given NAME this macro will define a `treemacs-${name}-state' state variable and a `treemacs-${name}-icon' icon variable. If the icon should not be static, and should be instead computed every time this node is rendered in its parent's :render-action use 'dynamic-icon as a value for ICON. The ICON is a string that should be created with `treemacs-as-icon'. If the icon is for a file you can also use `treemacs-icon-for-file'. RET-ACTION, TAB-ACTION and MOUSE1-ACTION are function references that will be invoked when RET or TAB are pressed or mouse1 is double-clicked a node of this type. VISIT-ACTION is used in `treemacs-visit-node-no-split' actions. (fn NAME ICON &key RET-ACTION TAB-ACTION MOUSE1-ACTION VISIT-ACTION) (defalias 'treemacs-define-leaf-node '(macro . #[642 "\300\301\"A@\300\302\"A@\300\303\"A@\300\304\"A@\305\306\307 \"!\305\306\310\n\"!\311\312\313DE \314\232?\205:\312 E\204C\205L\315\n\206K\316E\205W\317\nE\205b\320\nE\205p\321\313 D\322 F\323BBBBBBB\207" [plist-member :ret-action :tab-action :mouse1-action :visit-action intern format "treemacs-%s-state" "treemacs-%s-icon" progn defvar quote 'dynamic-icon treemacs-define-RET-action 'treemacs-visit-node-default treemacs-define-TAB-action treemacs-define-doubleclick-action put :treemacs-visit-action (t)] 19 (#$ . 15959)])) (byte-code "\300\301\302\303#\300\207" [function-put treemacs-define-leaf-node lisp-indent-function 1] 4) #@2718 Define a type of node with given NAME that can be further expanded. ICON-OPEN and ICON-CLOSED are strings and must be created by `treemacs-as-icon'. They will be defvar'd as 'treemacs-icon-${name}-open/closed'. As an alternative to static icons you can also supply ICON-OPEN-FORM and ICON-CLOSED-FORM that will be dynamically executed whenever a new icon is needed. Keep in mind that, since child nodes are first rendered by their parents, an ICON-CLOSED-FORM will need to be repeated in the parent's RENDER-ACTION. QUERY-FUNCTION is a form and will be invoked when the node is expanded. It must provide the list of elements that will be rendered with RENDER-ACTION. RENDER-ACTION is another form that will render the single items provided by QUERY-FUNCTION. For every RENDER-FORM invocation the element to be rendered is bound under the name `item'. The form itself should end in a call to `treemacs-render-node'. RET-ACTION will define what function is called when RET is pressed on this type of node. Only RET, without TAB and mouse1 can be defined since for expandable nodes both TAB and RET should toggle expansion/collapse. VISIT-ACTION is used in `treemacs-visit-node-no-split' actions. AFTER-EXPAND and AFTER-COLLAPSE are optional forms that will be called after a node has been expanded or collapsed. The closed or opened node marker will be visible under the name `node' in their scope. ROOT-MARKER is a simple boolean. It indicates the special case that the node being defined is a top level entry point. When this value is non-nil this macro will create an additional function in the form `treemacs-${NAME}-extension' that can be passed to `treemacs-define-project-extension'. It also means that the following pieces of additional information are required to render this node: ROOT-LABEL is the displayed label of the root node. ROOT-FACE is its face. ROOT-KEY-FORM is the form that will give the root node its unique key, the same way as the KEY-FORM argument in `treemacs-render-node'. TOP-LEVEL-MARKER works much the same way as ROOT-MARKER (and is mutually exclusive with it). The difference is that it declares the node defined here to a top level element with nothing above it, like a project, instead of a top level node *inside* a project. Other than that things work the same. Setting TOP-LEVEL-MARKER will define a function named `treemacs-${NAME}-extension' that can be passed to `treemacs-define-root-extension', and it requires the same additional keys. (fn NAME &key ICON-OPEN ICON-CLOSED ICON-OPEN-FORM ICON-CLOSED-FORM RENDER-ACTION QUERY-FUNCTION RET-ACTION VISIT-ACTION AFTER-EXPAND AFTER-COLLAPSE ROOT-MARKER ROOT-LABEL ROOT-FACE ROOT-KEY-FORM TOP-LEVEL-MARKER) (defalias 'treemacs-define-expandable-node '(macro . #[385 "\301\302\"A@\301\303\"A@\301\304\"A@\301\305\"A@\301\306\"A@\301\307\"A@\301\310\"A@\301\311\"A@\301 \312\"A@\301\n\313\"A@\301 \314\"A@\301\f\315\"A@\301 \316\"A@\301\317\"A@\301\320\"A@\211\203l\203\204\203t\211\203\204\204|\211\203\204\321\322\323\324\325#!\210\f\204\216\203\242 \204\230 \203\242 \203\242\n\204\252\321\322\323\326\325#!\210\203\274\f\203\274\321\322\323\327\325#!\210 \203\316 \203\316\321\322\323\330\325#!\210\211\331\232\332\323\333\334!\"!\332\323\335\334!\"!\332\323\336\334!\"!\332\323\337\334!\"!\332\323\340\334!\"!\332\323\341\334!\"!\332\323\342\334!\"!\332\323\343\334!\"!\344\205%\345 E\2050\345 E\345 \346 DE\345 \346 DE\347\350\fE\347\351\fE\347\352 E\347\353E\204^\205t\344\354\206h\355E\354\206r\356EE\357\205\215\360\346D\361F\360\346D\361FD\362\363\323\364*\"\365\366\367\370\371\372\373\374\346D\375BBD\376BB\377B\257D\257\362\201@\323\201A+\"\201B\201C%D\201DB\201E\201F\201G\201H\346D\201I!?\205\3610\203\357 \202\361.\201J\201K\201L\201M\201N\201C\201O\201P\201Q\201R\201S8\257 \201T\344\201U\201V1F\257 E\257\362\201W\323\201X,\"\201Y\366\367\201Z\201[\372\373\374\346 D\201\\BBD\201]BB\201^B\257D\257\362\201_\323\201X-\"\201`\201F\201G\201H\346D\201I!?\205\217/\203\215\202\217-\201a\344\201b+E\257 \257\201c\346D\201dDE\201c\346D\201dDE\205g\203\315\203\315\204\327\321\322\323\201e\325#!\210\201f\332\323\201g\3340!\226\"!\201h\201i\201j\201k\201l\201m$ED\201nBB\201o\201p\201q\201r\201s2\203\"\2020\201t*\201u\201v\201w\201x\201y/\201z\201K\201{2\201|\201k\201O\201P\201}\201K\201~\201\201\2006\257\257\257\201\201BBBB\205\362\203{\203{\204\205\321\322\323\201\202\325#!\210\332\323\201g\3340!\226\"!\360\201\203\206\236\201\204 #\210\344\203`\362\325\201\205\201\206\201i\201\207\201\210\201\211*\201|*\201\212BBBBBD\201\213\201\214\201\215\201{*\201\216BBBDE\201\217'\201\220BB\201\221\201q\201t\201\222\201\223\201\224\201\225\201\226\201\227\201K\201\230\201K\201z\201K\201{6\201|\201l\201z:E\201O\201\231\201\232\201\207\201\2008\257D\201B\201\233\201\234\346$D\201\235BB\201\236BBB\257DD\201\237BBBB\202\357\344\362\201\240\201\205\367\201\241\201\207\201\210\201\211+\201|+\201\242BBBBB\"\201q3\203\223#\202\2251D\201\217(\201\243BB\201q\201t,\201\244\201\245\201\246\201\247\201\2501\201z\201K\201{4\201|\201l\201z8E\201O\201\251\201\232\201\207\201\2006\257D\257D\201\252BBBBDD\262\257\"BBBBBBBBBB\207" [load-file-name plist-member :icon-open :icon-closed :icon-open-form :icon-closed-form :render-action :query-function :ret-action :visit-action :after-expand :after-collapse :root-marker :root-label :root-face :root-key-form :top-level-marker error apply format "[Treemacs] Root and top-level markers cannot both be set." nil "[Treemacs] All values (except additional root information) are mandatory" "[Treemacs] :icon-open and :icon-open-form are mutually exclusive." "[Treemacs] :icon-closed and :icon-closed-form are mutually exclusive." 'variadic intern "treemacs-icon-%s-open" symbol-name "treemacs-icon-%s-closed" "treemacs-%s-open-state" "treemacs-%s-closed-state" "treemacs-expand-%s" "treemacs-collapse-%s" "treemacs--do-expand-%s" "treemacs--do-collapse-%s" progn defvar quote add-to-list 'treemacs--open-node-states 'treemacs--closed-node-states 'treemacs-valid-button-states 'treemacs-valid-button-states treemacs-define-RET-action 'treemacs-visit-node-default 'treemacs-visit-node-default append put :treemacs-visit-action defun (&optional _) "Expand treemacs nodes of type `%s'." (interactive) treemacs-block -let [node (treemacs-node-at-point)] (when (null node) (treemacs-return (treemacs-pulse-on-failure "There is nothing to do here."))) when not eq ((treemacs-button-get node :state)) ((treemacs-return (treemacs-pulse-on-failure "This function cannot expand a node of type '%s'." (propertize (format "%s" (treemacs-button-get node :state)) 'face 'font-lock-type-face)))) (node) (node) "Execute expansion of treemacs nodes of type `%s'." let items ((depth (1+ (treemacs-button-get node :depth))) (parent-dom-node (treemacs-find-in-dom (treemacs-button-get node :path)))) treemacs--button-open :button node :new-state :new-icon :immediate-insert t :open-action treemacs--create-buttons :nodes :depth depth :node-name item :node-action :post-open-action (treemacs-on-expand (treemacs-button-get node :path) node) (treemacs--reentry (treemacs-button-get node :path)) (&optional _) "Collapse treemacs nodes of type `%s'." (interactive) [node (treemacs-node-at-point)] (when (null node) (treemacs-return (treemacs-pulse-on-failure "There is nothing to do here."))) ((treemacs-button-get node :state)) ((treemacs-return (treemacs-pulse-on-failure "This function cannot collapse a node of type '%s'." (propertize (format "%s" (treemacs-button-get node :state)) 'face 'font-lock-type-face)))) (node) (node) treemacs--button-close :post-close-action (treemacs-on-collapse (treemacs-button-get node :path)) treemacs-define-TAB-action function "[Treemacs] :root-label, :root-face and :root-key-form must be provided when `:root-marker' is non-nil" cl-defun "treemacs-%s-extension" (parent) let* (depth (1+ (treemacs-button-get parent :depth))) path list (or (treemacs-button-get parent :project) (treemacs-button-get parent :key)) ((parent-dom-node (treemacs-find-in-dom (treemacs-button-get parent :path))) (new-dom-node (treemacs-dom-node->create! :key path :parent parent-dom-node))) (treemacs-dom-node->insert-into-dom! new-dom-node) (when parent-dom-node (treemacs-dom-node->add-child! parent-dom-node new-dom-node)) insert "\n" (treemacs--get-indentation depth) propertize 'button '(t) 'category 'default-button 'face :custom :key :path :no-git :parent parent :state (nil) "[Treemacs] :root-label :root-face :root-key-form must be provided when `:top-level-marker' is non-nil" :defined-in buffer-name treemacs-with-writable-buffer save-excursion pr treemacs-project->create! :name (:path-status 'extension) (button-start (point-marker)) dom-node treemacs-dom-node->create! (:position button-start) treemacs--set-project-position ((point-marker)) (treemacs-dom-node->insert-into-dom! dom-node) "Hidden Node\n" 'button '(t) 'category 'default-button 'invisible 'skip -1 :project ((marker (copy-marker (point) t))) funcall (button-start) ((goto-char marker)) (t) (&rest _) vector (:path-status 'extension) ((point-marker)) 'button '(t) 'category 'default-button 'face 0 (nil)] 79 (#$ . 17502)])) (byte-code "\300\301\302\303#\300\207" [function-put treemacs-define-expandable-node lisp-indent-function 1] 4) #@552 Define a variadic top level node with given NAME. The term "variadic" means that the node will produce an unknown amount of child nodes when expanded. For example think of an extension that groups buffers based on the major mode, with each major-mode being its own top-level group, so it is not known which (if any) major-mode groupings exist. Works the same as `treemacs-define-expandable-node', so the same restrictions and rules apply for QUERY-FUNCTION, RENDER-ACTION and ROOT-KEY-FORM. (fn NAME &key QUERY-FUNCTION RENDER-ACTION ROOT-KEY-FORM) (defalias 'treemacs-define-variadic-node '(macro . #[385 "\300\301\"A@\300\302\"A@\300\303\"A@\304\305\306\307\306\310\306\311\306\312\313\301\302\303\257\207" [plist-member :query-function :render-action :root-key-form treemacs-define-expandable-node :icon-closed "" :icon-open :root-label :root-face :top-level-marker 'variadic] 23 (#$ . 27173)])) (byte-code "\300\301\302\303#\300\207" [function-put treemacs-define-variadic-node lisp-indent-function 1] 4) #@62 Initialise treemacs in an external buffer for extension use. (defalias 'treemacs-initialize #[0 "\303 \210\304\305 \210)\304\306\307 \210*\310\301!\210\311\211\207" [buffer-read-only treemacs--in-this-buffer treemacs-fringe-indicator-mode treemacs--disable-fringe-indicator nil erase-buffer t treemacs-mode make-local-variable :extension] 2 (#$ . 28201)]) (provide 'treemacs-extensions)