;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!\207" [require s dash treemacs-workspaces treemacs-customization treemacs-logging] 2) #@58 The name of the buffer used to edit treemacs' workspace. (defconst treemacs--org-edit-buffer-name "*Edit Treemacs Workspaces*" (#$ . 246)) #@75 File that stores the treemacs state as it was during the last load error. (defconst treemacs--last-error-persist-file (treemacs-join-path user-emacs-directory ".cache" "treemacs-persist-at-last-error") (#$ . 391)) (make-obsolete-variable 'treemacs--last-error-persist-file 'treemacs-last-error-persist-file "v2.7") #@61 The regular expression to match org's "key :: value" lines. (defconst treemacs--persist-kv-regex "^ ?- path :: \\(?:\\sw\\|\\s_\\|\\s.\\|[[:space:]]\\)+$" (#$ . 712)) #@61 The regular expression to match lines with workspace names. (defconst treemacs--persist-workspace-name-regex "^\\* .+$" (#$ . 885)) #@60 The regular expression to match lines with projects names. (defconst treemacs--persist-project-name-regex "^\\*\\* .+$" (#$ . 1023)) #@72 compiler-macro for inlining `treemacs-iter-p'. (fn CL-WHOLE-ARG CL-X) (defalias 'treemacs-iter-p--cmacro #[514 "\300\301\302\303\211\211&\207" [cl--defsubst-expand (cl-x) (cl-block treemacs-iter-p (and (memq (type-of cl-x) cl-struct-treemacs-iter-tags) t)) nil] 9 (#$ . 1162)]) (put 'treemacs-iter-p 'compiler-macro 'treemacs-iter-p--cmacro) #@13 (fn CL-X) (defalias 'treemacs-iter-p #[257 "\301!>\205 \302\207" [cl-struct-treemacs-iter-tags type-of t] 3 (#$ . 1514)]) (byte-code "\300\301\302\303#\304\305\306\301#\207" [function-put treemacs-iter-p side-effect-free error-free put treemacs-iter cl-deftype-satisfies] 5) #@76 compiler-macro for inlining `treemacs-iter->list'. (fn CL-WHOLE-ARG CL-X) (defalias 'treemacs-iter->list--cmacro #[514 "\300\301\302\303\211\211&\207" [cl--defsubst-expand (cl-x) (cl-block treemacs-iter->list (progn (aref cl-x 1))) nil] 9 (#$ . 1800)]) (put 'treemacs-iter->list 'compiler-macro 'treemacs-iter->list--cmacro) #@63 Access slot "list" of `treemacs-iter' struct CL-X. (fn CL-X) (defalias 'treemacs-iter->list #[257 "\211\300H\207" [1] 3 (#$ . 2135)]) (byte-code "\300\301\302\303#\304\305\306\"\207" [function-put treemacs-iter->list side-effect-free t defalias copy-treemacs-iter copy-sequence] 4) #@90 compiler-macro for inlining `treemacs-iter->create!'. (fn CL-WHOLE &cl-quote &key LIST) (defalias 'treemacs-iter->create!--cmacro #[385 "\300\301\"A@\302\303\304\305\305&\207" [plist-member :list cl--defsubst-expand (list) (cl-block treemacs-iter->create! (record 'treemacs-iter list)) nil] 10 (#$ . 2424)]) (put 'treemacs-iter->create! 'compiler-macro 'treemacs-iter->create!--cmacro) #@66 Constructor for objects of type `treemacs-iter'. (fn &key LIST) (defalias 'treemacs-iter->create! #[128 "\300\301\"A@\302\303\"\207" [plist-member :list record treemacs-iter] 5 (#$ . 2823)]) (byte-code "\300\301\302\303#\304\305\306\307\310\306\311\312\305\303& \207" [function-put treemacs-iter->create! side-effect-free t cl-struct-define treemacs-iter nil cl-structure-object record ((cl-tag-slot) (list)) cl-struct-treemacs-iter-tags] 11) #@80 Get the next element of iterator SELF. SELF: Treemacs-Iter struct. (fn SELF) (defalias 'treemacs-iter->next! #[257 "\211\300H@\300HA\211\300I\266\207" [1] 7 (#$ . 3275)]) (byte-code "\300\301\302\303#\300\207" [function-put treemacs-iter->next! compiler-macro treemacs-iter->next!--inliner] 4) #@26 (fn INLINE--FORM SELF) (defalias 'treemacs-iter->next!--inliner #[514 "\3002@\211\301!\203\211\202\302\303!\304\305\306\307DDD\310\311\307DDDD\312\307D\310E\305F=\2036\211\266\203\202?\313DC\"\266\2030\207" [inline--just-use macroexp-copyable-p make-symbol "self" let head car treemacs-iter->list tail cdr setf macroexp-let*] 10 (#$ . 3582)]) #@76 Peek at the first element of SELF. SELF: Treemacs-Iter struct. (fn SELF) (defalias 'treemacs-iter->peek #[257 "\211\300H@\206\301\207" [1 "__EMPTY__"] 3 (#$ . 3949)]) (byte-code "\300\301\302\303#\300\301\304\305#\300\207" [function-put treemacs-iter->peek compiler-macro treemacs-iter->peek--inliner side-effect-free t] 5) #@26 (fn INLINE--FORM SELF) (defalias 'treemacs-iter->peek--inliner #[514 "\30020\211\301!\203\211\202\302\303!\304\305\306DD\307E=\203&\211\266\203\202/\310DC\"\266\2030\207" [inline--just-use macroexp-copyable-p make-symbol "self" or car treemacs-iter->list "__EMPTY__" macroexp-let*] 8 (#$ . 4283)]) #@62 No saving and loading in noninteractive and CI environments. (defalias 'treemacs--should-not-run-persistence\? #[0 "\206\301\302!\207" [noninteractive getenv "CI"] 2 (#$ . 4603)]) (byte-code "\300\301\302\303#\300\207" [function-put treemacs--should-not-run-persistence\? compiler-macro treemacs--should-not-run-persistence\?--inliner] 4) #@21 (fn INLINE--FORM) (defalias 'treemacs--should-not-run-persistence\?--inliner #[257 "\3002 \301\302\303\304DE0\207" [inline--just-use or noninteractive getenv "CI"] 5 (#$ . 4951)]) #@91 Read a list of workspaces from the lines in ITER. ITER: Treemacs-Iter Struct. (fn ITER) (defalias 'treemacs--read-workspaces #[257 "\302\303\304H@\206 \305\"\203a\306\307\302\211#\310! >\204#\311\312\307D\"\210\211\211\304\304H@\304HA\211\304I\266\266\202\313\302OI\266\310! >\204O\311\312\307D\"\210\211\211\313\314!I\266\211B\266\202\202\211\237\207" [treemacs--persist-workspace-name-regex cl-struct-treemacs-workspace-tags nil s-matches\? 1 "__EMPTY__" record treemacs-workspace type-of signal wrong-type-argument 2 treemacs--read-projects] 12 (#$ . 5140)]) #@106 Read a list of projects from ITER until another section is found. ITER: Treemacs-Iter Struct (fn ITER) (defalias 'treemacs--read-projects #[257 "\306\307\310H@\206 \311\"\203n\306\312\313\306\211\211\211%\310H@\310HA\211\310I\266\266\202\314\306O\315\316\"\203O\211\317\306O\262\320! >\204H\321\322\313D\"\210\211\323\324I\266\320! >\204^\321\322\313D\"\210\211\310I\266\307\n\310H@\206p\311\"\203\216\310H@\310HA\211\310I\266\266\202B\262\202e\204\316 :\204\232\fC\306 \204\305\325\326\327\330\331\332#\333\334\327\320! >\204\273\321\322\313\nD\"\210\310H\331\335#\"#\210\336\337\340\"\266\202\211\203r\211@\341\342\"\211A\262\242@\343!\211\344\232\203I\320! >\204\373\321\322\313\nD\"\210\211\345\346!\203!G\310V\203\211GSH\347=\203\350\351O\202C\202C\3068\352!\211G\310V\203?\211GSH\347=\203?\211\350\351O\202@\211\262)I\266\202k :\204Q\fC\306 \204e\325\326\327\330\331\332#\333\353 \"#\210\336\337\340\"\266A\266\202\202\317\210\354\211\354=\203 \320! >\204\211\321\322\313D\"\210\211\314\355\320! >\204\236\321\322\313 D\"\210\345H!I\266\320! >\204\265\321\322\313D\"\210\314H\356>\204\301\357\2029\360=\203\361\362\363\333\364\320! >\204\336\321\322\313\nD\"\210\310H\320 ! >\204\363\321\322\313 D\"\210\345H#\306\324$\"A\262\2029\262\202t\211\365=\203f :\204\fC\306 \204]\325\326\327\330\331\332#\333\366\327\320 ! >\204:\321\322\313 D\"\210\310H\331\335#\327\320\n! >\204S\321\322\313\fD\"\210 \345H\331\367###\210\336\337\340\"\266\202B\266\205\202\211\237\207" [treemacs--persist-project-name-regex cl-struct-treemacs-project-tags treemacs--persist-kv-regex treemacs--saved-eldoc-display treemacs-eldoc-display treemacs--no-messages nil s-matches\? 1 "__EMPTY__" record treemacs-project 3 s-starts-with\? "COMMENT " 8 type-of signal wrong-type-argument 4 t message "%s %s" propertize "[Treemacs]" face ((:inherit warning :weight bold)) format "Project %s has no path and will be ignored." font-lock-type-face add-hook pre-command-hook treemacs--restore-eldoc-after-log s-split " :: " s-trim "- path" 2 file-remote-p 47 0 -1 expand-file-name "Encountered unknown project key-value in line [%s]" retry treemacs--get-path-status (local-unreadable remote-unreadable extension) keep ask (("Keep the project in the project list" . keep) ("Retry" . retry) ("Remove the project from the project list" . remove)) assoc completing-read "Project %s at %s cannot be read." remove "The location of project %s at %s cannot be read. Project was removed from the project list." font-lock-string-face file-name-handler-alist treemacs-missing-project-action] 18 (#$ . 5736)]) #@53 Persist treemacs' state in `treemacs-persist-file'. (defalias 'treemacs--persist #[0 "\206\306\307!\206\310\311N??\205c\312 !\204\313\314 !\315\"\210\3161=\317\211\211\211\211\320 !\211\2038\211\266\203\321\202A\322 \323\"\262\317\210rq\210\317 \324\317\211\203{\211A\262\242\262\262T\262\325!2>\204m\326\327\330D\"\210\331H\203JB\262\202J\266\211\237\262\211\203\211@\332\333\325!2>\204\231\326\327\330D\"\210\334H\"B\262\325!2>\204\261\326\327\330D\"\210\211\331H\211\203\211@\332\335\325!3>\204\314\326\327\336D\"\210\337H\203\326\340\202\327\341\325!3>\204\350\326\327\336D\"\210\334H#B\262\332\342\343\325!3>\204\326\327\336D\"\210\331H!\"B\262A\266\202\202\264\210A\266\202\202\201\210ed|\210\344\345\237\"c\210\3214\346 \210)\211?\2058\347 +\266\2030\2075:\204H6C5\31767\204]\350\351\352\353\354\355#\332\356\"#\210\357\360\361\"\262\207" [noninteractive treemacs-persist-file abbreviated-home-dir directory-abbrev-alist desktop-save-buffer treemacs--workspaces getenv "CI" treemacs :state-is-restored file-exists-p make-directory file-name-directory :with-parents (error) nil get-file-buffer t find-file-noselect :no-warn 0 type-of signal wrong-type-argument treemacs-workspace 2 format "* %s\n" 1 "** %s%s\n" treemacs-project 4 "COMMENT " "" " - path :: %s\n" abbreviate-file-name apply concat save-buffer kill-buffer message "%s %s" propertize "[Treemacs]" face ((:inherit error :weight bold)) "Error '%s' when persisting workspace." add-hook pre-command-hook treemacs--restore-eldoc-after-log cl-struct-treemacs-workspace-tags cl-struct-treemacs-project-tags inhibit-message treemacs--saved-eldoc-display treemacs-eldoc-display treemacs--no-messages] 14 (#$ . 8471)]) #@168 Read the relevant lines from given TXT or `treemacs-persist-file'. Will read all lines, except those that start with # or contain only whitespace. (fn &optional TXT) (defalias 'treemacs--read-persist-lines #[256 "\211\206 \301!\205 \302\303\304\"r\211q\210\305\306\"\216\307!\210\310 *\262\211\205'\311!\262\211\2050\312!\262\211\205i\313\314\313\211\203c\211A\262\242\262\262T\262\315!\204;\316\317\"\204;B\262\202;\266\211\237\262\207" [treemacs-persist-file file-exists-p generate-new-buffer " *temp*" t make-closure #[0 "\301\300!\205 \302\300!\207" [V0 buffer-name kill-buffer] 2] insert-file-contents buffer-string s-trim s-lines nil 0 s-blank-str\? s-starts-with\? "#"] 10 (#$ . 10251)]) #@1256 Recursively verify the make-up of the given LINES, based on their CONTEXT. Lines must start with a workspace name, followed by a project name, followed by the project's path property, followed by either the next project or the next workspace. The previously looked at line type is given by CONTEXT. The previously looked at line is given by PREV. PATHS contains all the project paths previously seen in the current workspace. These are used to make sure that no file path appears in the workspaces more than once. PROJ-COUNT counts the number of non-disabled projects in a workspace to make sure that there is at least of project that will be displayed. A successful validation returns just the symbol 'success, in case of an error a list of 3 items is returned: the symbol 'error, the exact line where the error happened, and the error message. In some circumstances (for example when a project is missing a path property) it makes sense to display the error not in the currently looked at line, but the one above, which is why the previously looked at line PREV is given as well. LINES: List of Strings CONTEXT: Keyword PREV: String PATHS: List PROJ-COUNT: Int (fn LINES &optional (CONTEXT :start) (PREV nil) (PATHS nil) (PROJ-COUNT 0)) (defalias 'treemacs--validate-persist-lines #[385 "\211\203 \211A\262\242\202\304\211A\262\242\211A\262\242\203'\211A\262\242\202(\305\30627\307@\211\203\376\310\267\202\372\311\"\204K\312\306\313\314!E\"\210\315A\316\317\305%\2022\311 \"\204h\312\306\313\320!E\"\210\321\322\"\211\204tT\262\315 A\323\317%\262\2022\311\n\"\204\225\312\306\313\324!E\"\210\325\326\"A@ \327 \230\203\301\330!\204\301\331!\204\301\312\306\313\332\333!\334\335\336#\"E\"\210\317\305\317\211\211\203\211A\262\242\262\262\211\262\203\230\206\372\321\211GSH\337=\203\365\202\370\340P\"\266\202\211\262\204\262\262T\262\202\307\266\211\262\204m\317\305\317\211\211\203e\211A\262\242\262\262\211\262\203e\230\206P\321\211GSH\337=\203K\202N\340P\"\266\202\211\262\204e\262\262T\262\202\266\211\262\203\200\312\306\313\332\341!\334\335\336#\"E\"\210\315 A\342 B%\262\2022\311\"\311 \"\203\276\305U\203\260\312\306\313 \343!E\"\210\315\nA\316\317\305%\266\202\2022\211\203\341\321\322\"\211\204\316T\262\315 A\323\n\n%\262\266\202\2022\344\345D\"\205\365\312\306\313 \346!E\"\266\202\2022\317\2022\347\267\202(\305U\203\312\306\313\343!E\"\210\312\306\350\"\2022\312\306\313\304\351!E\"\2022\312\306\313\352!E\"\262\2620\207" [treemacs--persist-workspace-name-regex treemacs--persist-project-name-regex treemacs--persist-kv-regex treemacs--org-edit-buffer-name :start 0 --cl-block-__body__-- #[257 "\300\301\302#\207" [propertize face warning] 5 "\n\n(fn TXT)"] #s(hash-table size 4 test eq rehash-size 1.5 rehash-threshold 0.8125 purecopy t data (:start 58 :workspace 87 :project 131 :property 402)) s-matches\? throw error "First item must be a workspace name" treemacs--validate-persist-lines :workspace nil "Workspace name must be followed by project name" s-starts-with\? "** COMMENT" :project "Project name must be followed by path declaration" s-split " :: " buffer-name file-remote-p file-exists-p format "File '%s' does not exist" propertize face font-lock-string-face 47 "/" "Path '%s' appears in the workspace more than once." :property "Workspace must contain at least 1 project that is not disabled." -none\? identity "Path property must be followed by the next workspace or project" #s(hash-table size 2 test eq rehash-size 1.5 rehash-threshold 0.8125 purecopy t data (:property 516 :start 540)) success "Input is empty" "Cannot end with a project or workspace name"] 20 (#$ . 10989)]) #@55 Restore treemacs' state from `treemacs-persist-file'. (defalias 'treemacs--restore #[0 "\206\306\307!?\2056\310 \211\203\364\311\312 \"\313\314\315\"r\211q\210\316\317\"\216\3201\276\321!\211\322=\203;\323\324\325\"!\211\202\270\211:\205\270\211\242\211\326=\205\266\243\211:\205\264\211\242\243\211:\205\262\211\242\243\211?\205\260\327 \330\331#\"\210 :\204v\fC\332 \204\252\333\334\335\336\337\340#\330\341\342\267\202\224\343\202\234\344\202\234\330\345\"\262\330\346\3355\337\347#\"$#\210\350\351\352\"\266\202\266\202\266\202\262\262\2620\202\355\327\"\210 :\204\313\fC\332 \204\347\333\334\335\336\337\340#\330\353\330\346\3355\337\347#\"##\210\350\351\352\"\262*\262)\2024\324\354\355\332#C\356\3576!7\"A\211\204\324\360\332\211#\262\3576!B7B7\361!8>\204*\362\363\360D\"\210\211\211\364\n@I\262\262\262\207" [noninteractive kill-emacs-hook treemacs--workspaces treemacs--saved-eldoc-display treemacs-eldoc-display treemacs--no-messages getenv "CI" treemacs--read-persist-lines remq treemacs--persist generate-new-buffer " *temp*" t make-closure #[0 "\301\300!\205 \302\300!\207" [V0 buffer-name kill-buffer] 2] (error) treemacs--validate-persist-lines success treemacs--read-workspaces record treemacs-iter error treemacs--write-error-persist-state format "'%s' in line '%s'" nil message "%s %s" propertize "[Treemacs]" face ((:inherit error :weight bold)) "Could not restore saved state, %s:\n%s\n%s" #s(hash-table size 2 test eq rehash-size 1.5 rehash-threshold 0.8125 purecopy t data (:start 140 :end 144)) "found error in the first line" "found error in the last line" "found error in line '%s'" "Broken state was saved to %s" font-lock-string-face add-hook pre-command-hook treemacs--restore-eldoc-after-log "Error '%s' when loading the persisted workspace.\n%s" treemacs-workspace "Default" assoc treemacs-scope->current-scope treemacs-scope-shelf type-of signal wrong-type-argument 2 treemacs-last-error-persist-file treemacs--current-scope-type treemacs--scope-storage cl-struct-treemacs-scope-shelf-tags] 24 (#$ . 14818)]) #@62 First load of the workspaces, if it hasn't happened already. (defalias 'treemacs--maybe-load-workspaces #[0 "\300\301N?\205\302 \210\303\300\301\304#\207" [treemacs :state-is-restored treemacs--restore put t] 4 (#$ . 16940)]) (byte-code "\300\301\302\303#\300\207" [function-put treemacs--maybe-load-workspaces compiler-macro treemacs--maybe-load-workspaces--inliner] 4) #@21 (fn INLINE--FORM) (defalias 'treemacs--maybe-load-workspaces--inliner #[257 "\3002\301\302\303\304D\305E\306C\307\303\304D\305\310FF0\207" [inline--just-use unless get quote treemacs :state-is-restored treemacs--restore put t] 8 (#$ . 17319)]) #@93 Write broken state LINES and ERROR to `treemacs-last-error-persist-file'. (fn LINES ERROR) (defalias 'treemacs--write-error-persist-state #[514 "\301\302\303\304!\"\301\305\"\306\307\310\311\"\"Q\312!\204 \313\314!\315\"\210\316\317\317\320%\207" [treemacs-last-error-persist-file format "# State when last error occurred on %s\n" format-time-string "%F %T" "# Error was %s\n\n" apply concat mapcar #[257 "\211\300P\207" ["\n"] 3 "\n\n(fn IT)"] file-exists-p make-directory file-name-directory :with-parents write-region nil :silent] 9 (#$ . 17573)]) (byte-code "\300\301\302\"\210\303\304!\207" [add-hook kill-emacs-hook treemacs--persist provide treemacs-persistence] 3)