;ELC ;;; Compiled ;;; in Emacs version 28.0.50 ;;; with all optimizations. (byte-code "\300\301!\210\300\302!\207" [require dash cl-lib] 2) (defvar windwow-list-of-buffer-lists nil) (defvar windwow-list-of-window-commands nil) (byte-code "\303\304\"\303\305\"\303\207" [user-emacs-directory windwow-buffer-persistence-file-name windwow-window-persistence-file-name expand-file-name "windwow-persist-buffer.eld" "windwow-persist-window.eld"] 3) #@24 Save DATA to FILENAME. (defalias 'windwow-save-to-file #[(data filename) "\305!\205(\306\307\310\"\311\216r q\210\312\313\f!)c)r q\210\314\312\211\n\312\315%\210,\207" [filename #1=#:temp-buffer #2=#:temp-file print-length data file-writable-p generate-new-buffer " *temp file*" t #[nil "\301!\205 \302!\207" [#1# buffer-name kill-buffer] 2] nil prin1-to-string write-region 0] 7 (#$ . 460)]) #@31 Return content from FILENAME. (defalias 'windwow-read-from-file #[(filename) "\302!\205\303\304\305\"r q\210\306\216\307!\210\310\311 !+\207" [filename #1=#:temp-buffer file-exists-p generate-new-buffer " *temp*" t #[nil "\301!\205 \302!\207" [#1# buffer-name kill-buffer] 2] insert-file-contents read buffer-string] 3 (#$ . 868)]) #@37 Initialize buffer and window lists. (defalias 'windwow-init-vars #[nil "\304!\304\n!\211\207" [windwow-buffer-persistence-file-name windwow-list-of-buffer-lists windwow-window-persistence-file-name windwow-list-of-window-commands windwow-read-from-file] 2 (#$ . 1214)]) #@40 Save buffer and window lists to files. (defalias 'windwow-persist-vars-function #[nil "\304 \"\210\304\n \"\207" [windwow-list-of-buffer-lists windwow-buffer-persistence-file-name windwow-list-of-window-commands windwow-window-persistence-file-name windwow-save-to-file] 3 (#$ . 1493)]) (byte-code "\300 \210\301\302\303\"\207" [windwow-init-vars add-hook kill-emacs-hook windwow-persist-vars-function] 3) #@56 Remove persist hook. Called when windwow is unloaded. (defalias 'windwow-unload-function #[nil "\300\301\302\"\207" [remove-hook kill-emacs-hook windwow-persist-vars-function] 3 (#$ . 1906)]) #@40 Get names of buffers in current frame. (defalias 'windwow-get-buffer-list #[nil "\300\301\302\303\211\304 #\"\207" [cl-mapcar #[(window) "\301\302!!\207" [window buffer-name window-buffer] 3] window-list nil frame-first-window] 6 (#$ . 2105)]) #@56 Switch to buffers from BUFFERS. Ignore extra buffers. (defalias 'windwow-load-buffer-list-buffers #[(buffers) "\301\302\303\304\211\305 ##\207" [buffers cl-mapcar #[(buffer window) "\302\303! \301#\207" [buffer window window--display-buffer get-buffer] 4] window-list nil frame-first-window] 7 (#$ . 2356)]) #@42 Make display name for a list of BUFFERS. (defalias 'windwow-get-buffer-list-name #[(buffers) "\301\302\303#\207" [buffers mapconcat identity " "] 4 (#$ . 2673)]) #@100 Save current buffers as NAME. Switch to this list of buffers by calling 'windwow-load-buffer-list. (defalias 'windwow-save-buffer-list #[(name) "\302 \303 \")\207" [buffer-list name windwow-get-buffer-list windwow-save-buffer-list-args] 3 (#$ . 2843) (list (completing-read "Enter buffer list name: " windwow-list-of-buffer-lists))]) #@121 Save current buffers as concatenated buffer names. Switch to this list of buffers by calling 'windwow-load-buffer-list. (defalias 'windwow-save-buffer-list-no-name #[nil "\301 \302\303!\")\207" [buffer-list windwow-get-buffer-list windwow-save-buffer-list-args windwow-get-buffer-list-name] 3 (#$ . 3186) nil]) #@108 Store (NAME . BUFFERS) into state. BUFFERS is a list of buffers. Used internally by autoloaded functions. (defalias 'windwow-save-buffer-list-args #[(name buffers) " B\nB\211\207" [name buffers windwow-list-of-buffer-lists] 2 (#$ . 3507)]) #@65 Switch to buffers from a BUFFER-LIST that was previously saved. (defalias 'windwow-load-buffer-list #[(buffer-list) "\302\303 \"A!\207" [buffer-list windwow-list-of-buffer-lists windwow-load-buffer-list-buffers assoc] 4 (#$ . 3756) (list (completing-read "Load buffer list: " windwow-list-of-buffer-lists nil t ""))]) #@57 Load BUFFER-LIST and switch to a BUFFER from that list. (defalias 'windwow-load-buffer-from-list #[(buffer-list buffer) "\301!\207" [buffer switch-to-buffer] 2 (#$ . 4081) (let* ((list-name (completing-read "Choose buffer-list: " windwow-list-of-buffer-lists)) (b-cur (completing-read "Choose buffer: " (cdr (assoc list-name windwow-list-of-buffer-lists))))) (list list-name b-cur))]) #@252 Get dimensions of windows in current frame. Saved as '(FRAME-WIDTH FRAME-HEIGHT WINDOW-WIDTHS WINDOW-HEIGHTS) where WINDOW-WIDTHS is a list of window widths and WINDOW-HEIGHTS is a list of window heights. This is also referred to as a window-config. (defalias 'windwow-current-frame-data #[nil "\305 \306!\307!\310\306\311\312\211\313 #\"\310\307\311\312\211\313 #\"\211 \n F-\207" [parent vert-dimens horiz-dimens vert-frame horiz-frame frame-root-window window-total-width window-total-height -map window-list nil frame-first-window] 10 (#$ . 4474)]) #@61 Generate split window commands to recreate a WINDOW-CONFIG. (defalias 'windwow-get-split-window-commands #[(window-config) "\301\302\211#\207" [window-config windwow-get-split-window-commands-recur nil] 4 (#$ . 5041)]) #@211 Recursive call for generating split window commands of WINDOW-CONFIG. MATCHES tracks the possible matched split windows at this step of recursion and COMMANDS tracks current split-window-commands at this step. (defalias 'windwow-get-split-window-commands-recur #[(window-config matches commands) "AA@A\203Q\306!\3072O \310\n:\203L\n@\311 \" @\312\313 !\314 \"\"\315\f B#\211\203D\316\307\"\210,\nA\211\202*\3100)\207\207" [window-config matches #1=#:--cl-var-- match new-window-config direction windwow-get-possible-splits --cl-block-nil-- nil windwow-remove-from-list windwow-add-to-config windwow-create-new-window windwow-remove-from-config windwow-get-split-window-commands-recur throw new-set commands result] 8 (#$ . 5268)]) #@158 Add a WINDOW-PAIR to a window CONFIG. The height and width of WINDOW-PAIR are appended by ‘cons’ to the list of window heights and widths, respectively. (defalias 'windwow-add-to-config #[(window-pair config) "AA@AAA@@A@ @\nB A BF*\207" [config second-list first-list window-pair] 5 (#$ . 6035)]) #@77 Splits CELLS, a list of lists, into list of its ‘car’s and ‘cadr’s. (defalias 'windwow-unzip-cons-cells #[(cells) "\302\303\304#\305 @!\305 A@!)D\207" [cells temp -reduce-from #[(memo item) "@ @BA A@BD\207" [item memo] 3] (nil nil) reverse] 4 (#$ . 6348)]) #@81 Remove SPLIT-BUNDLE, a split-command and pair of windows, from a window CONFIG. (defalias 'windwow-remove-from-config #[(split-bundle config) "AA@AAA@ A@ AA@\306 \f\" @\n@B A\nABD \n\307\310 A@\310 @\n\"\"! @A@ .BB\207" [config split-bundle v-vals h-vals second-list first-list -zip windwow-unzip-cons-cells windwow-remove-from-list merged merged-config removed] 6 (#$ . 6623)]) #@79 Create a window from SPLIT-BUNDLE, using the split-command from SPLIT-BUNDLE. (defalias 'windwow-create-new-window #[(split-bundle) "@\302=\203A@\211@ A\\AA@@)B\207AA@A@@ @ A\\)B\207" [split-bundle sum-cell vertical] 4 (#$ . 7024)]) #@117 Get list of SPLIT-BUNDLES that exist in WINDOW-CONFIG. These are possible window pairs that can be merged together. (defalias 'windwow-get-possible-splits #[(window-config) "AA@A@\211@ A@\306 \f\n \307%-\207" [window-config v-max h-max windows vert horiz windwow-get-possible-splits-recur nil] 7 (#$ . 7273)]) #@315 Recursive call for getting split-bundles. HORIZ is current horizontal dimension, VERT is current vertical dimension. H-MAX is horiz of frame, the maximum width, V-MAX is vert of frame, the maximum height. DIRECTIONS-AND-WINDOWS is current list of split bundles, which is a list of split commands and window pairs. (defalias 'windwow-get-possible-splits-recur #[(horiz vert h-max v-max directions-and-windows) "\2038\306@A \n$\306 @ A $\307  \310$\307\f \311$\f \312A A \n\313 \f#%,\207\207" [horiz vert v-max h-max v-matches h-matches windwow-get-match-indices windwow-build-sets horizontal vertical windwow-get-possible-splits-recur append v-set h-set directions-and-windows] 9 (#$ . 7598)]) #@165 Get indices of split window match. Checks matches of ELEM in COLL while making sure sum of matching elements (same index) of COMPARE-COLL is less than COMPARE-MAX. (defalias 'windwow-get-match-indices #[(elem coll compare-coll compare-max) "\304 \305\306\n &\207" [elem coll compare-coll compare-max windwow-get-match-indices-recur 0 nil] 7 (#$ . 8316)]) #@264 Recursive call for getting matching indices. Checks if ELEM matches the element in COLL at INDEX, using INDICES to track matches, while making sure sum of elements in COMPARE-COLL is less than COMPARE-MAX and they are the result of an exact split window command. (defalias 'windwow-get-match-indices-recur #[(elem coll index indices compare-coll compare-max) "\203<\306 A\nT @\nT 8 @\232\205) \f\\ X\205)\307 \fZ!\310X*\2034\n\nB\2026\n  &\207\n\207" [coll elem index compare-coll compare-elem-2 compare-elem-1 windwow-get-match-indices-recur abs 2 compare-max indices] 7 (#$ . 8680)]) #@58 Return a cons cell of max and min of elements V1 and V2. (defalias 'windwow-ordered-cons-cell #[(v1 v2) " ] ^B\207" [v1 v2] 3 (#$ . 9288)]) #@164 Create list of split-bundles. The split-bundles are window pairs from elements at INDICES and the first element of H-SET and V-SET and DIRECTION, a split-command. (defalias 'windwow-build-sets #[(indices h-set v-set direction) "\301\302\"\207" [indices -map #[(index) "T 8T\n8 \306 @\f\"\306\n@ \"E*\207" [index h-set v-set v-val h-val direction windwow-ordered-cons-cell] 5]] 3 (#$ . 9437)]) #@46 Remove first appearance of MY-VAL from LIST. (defalias 'windwow-remove-from-list #[(my-val list) "\301\302\"\207" [list -remove-first #[(x) " \232\207" [my-val x] 2]] 3 (#$ . 9841)]) #@51 Get split and switch commands from WINDOW-CONFIG. (defalias 'windwow-get-usable-commands #[(window-config) "\302!\303 \")\207" [window-config commands windwow-get-split-window-commands windwow-get-switch-and-split-commands] 3 (#$ . 10032)]) #@505 Get split and switch commands a list of split-bundles and window config. MATCHES a list of split-bundles - '(SPLIT-COMMAND (H1 . H2) (V1 . V2)) and a WINDOW-CONFIG. A SPLIT-COMMAND is the symbol ‘horizontal’ or the symbol ‘vertical’. H1 and H2 are the horizontal dimensions of the window pair, and V1 and V2 are the vertical dimensions. This wraps 'windwow-parse-matches which returns commands in reverse order. The split and switch commands are used to preserve the correct nesting of windows. (defalias 'windwow-get-switch-and-split-commands #[(matches window-config) "\302\303 \"!\207" [matches window-config reverse windwow-parse-matches] 4 (#$ . 10283)]) #@216 Get split and switch commands from SPLIT-BUNDLES and a WINDOW-CONFIG. The split-bundles are '(split-command (h . h) (v . v)). This is named 'parse because the split-bundles are used to generate the switch commands. (defalias 'windwow-parse-matches #[(split-bundles window-config) "\302\303\304 @ A@BC\305\306 AA\"%\207" [split-bundles window-config windwow-parse-matches-recur nil 0 apply -zip] 8 (#$ . 10960)]) #@228 Recursive call for getting split and switch commands. MATCHES are the unused split-commands, COMMANDS are a list of split and switch commands. INDEX is used to track the step of recursion and WINDOW-LIST is a list of windows. (defalias 'windwow-parse-matches-recur #[(matches commands index window-list final-list) "\306!\203\307 \n\"\205d \207\f 8@\211@\310 \"\211\311A!\232\203W\312A B\f\313\f #\n%\211\203G\202S\312\314 B\315\f \" \n%)\202c\312\314 B\315\f \" \n%,\207" [matches window-list final-list commands index current windwow-is-empty windwow-window-lists-equal windwow-split-window-pair-in-direction windwow-merge-pair windwow-parse-matches-recur windwow-insert-split-window-at-index switch windwow-increment-window-index match command pair answer] 9 (#$ . 11380)]) (defalias 'windwow-window-lists-equal #[(list-1 list-2) "G G=\205 \302 \303#\207" [list-1 list-2 windwow-window-lists-equal-recur t] 4]) (defalias 'windwow-window-lists-equal-recur #[(list-1 list-2 val) "\204 \203G@ @\211\n\232\203\306A A\f#\202EA@ A@\211\n\232\203? \232\203?\306AA AA\f#\202D\306\307\211\211#**\207\f\207" [list-1 list-2 item-2 item-1 val next-item-2 windwow-window-lists-equal-recur nil next-item-1] 5]) #@59 Change '((A . B) (C . D)) to '((A . C) (B . D)) of CELLS. (defalias 'windwow-merge-pair #[(cells) "@A@\211@ @B\nA A*BD\207" [cells cell-2 cell-1] 4 (#$ . 12641)]) #@64 Increment INDEX by one while modding by length of WINDOW-LIST. (defalias 'windwow-increment-window-index #[(index window-list) "\302T G\"\207" [index window-list mod] 3 (#$ . 12814)]) #@49 Insert at INDEX a WINDOW-PAIR into WINDOW-LIST. (defalias 'windwow-insert-split-window-at-index #[(index window-pair window-list) "\303 @\304 A@\n##\207" [index window-pair window-list -insert-at -replace-at] 7 (#$ . 13005)]) #@133 Split in DIRECTION a WINDOW, (H . V). H is the horizontal dimension (width) and V is the vertical dimension (height) of the window. (defalias 'windwow-split-window-pair-in-direction #[(direction window) "\303=\203\304 @!\211@ AB\nA A)BD\207\304 A! @\n@B @\nA)BD\207" [direction window splitted vertical windwow-split-dimension] 4 (#$ . 13240)]) #@112 Return DIMENSION split in 2 as a cons cell. If even it is halved, if not the CAR is greater than the CDR by 1. (defalias 'windwow-split-dimension #[(dimension) "\302!\203\f\303\245\211B\207T\303\245\211\211S)B\207" [dimension bigger-half windwow-is-even 2] 3 (#$ . 13597)]) #@29 Return t if NUMBER is even. (defalias 'windwow-is-even #[(number) "\301\246\302U\207" [number 2 0] 2 (#$ . 13882)]) #@32 Return t if DIS-LIST is empty. (defalias 'windwow-is-empty #[(dis-list) "<\205@?\205\f\301\207" [dis-list t] 1 (#$ . 14005)]) #@74 Load and execute a list of split and switch COMMANDS. Preserves buffers. (defalias 'windwow-load-window-configuration-commands #[(commands) "\302 \303 \210\304 !\210\305!)\207" [buffers commands windwow-get-buffer-list delete-other-windows windwow-execute-split-window-commands windwow-load-buffer-list-buffers] 2 (#$ . 14142)]) #@46 Execute a list of split and switch COMMANDS. (defalias 'windwow-execute-split-window-commands #[(commands) "\301\302\"\207" [commands -each #[(command) "\301\267\202\302\303\211\304#\207\302\303\211\305#\207\306\307!\207\303\207" [command #s(hash-table size 3 test eq rehash-size 1.5 rehash-threshold 0.8125 purecopy t data (vertical 6 horizontal 12 switch 18)) split-window nil right below other-window 1] 4]] 3 (#$ . 14479)]) #@104 Save current window arrangement as NAME. Load window arrangement with 'window-load-window-arrangement. (defalias 'windwow-save-window-arrangement #[(name) "\302\303 !\304 \")\207" [window-commands name windwow-get-usable-commands windwow-current-frame-data windwow-save-window-configuration-commands] 3 (#$ . 14918) (list (completing-read "Enter window arrangement name: " windwow-list-of-window-commands))]) #@97 Internal function for saving current window configuration. Saves (NAME . WINDOW-COMMANDS) pair. (defalias 'windwow-save-window-configuration-commands #[(name window-commands) " B\nB\211\207" [name window-commands windwow-list-of-window-commands] 2 (#$ . 15335)]) #@51 Load NAME, a previously saved window arrangement. (defalias 'windwow-load-window-arrangement #[(name) "\302\303 \"A!\207" [name windwow-list-of-window-commands windwow-load-window-configuration-commands assoc] 4 (#$ . 15606) (list (completing-read "Load window arrangement: " windwow-list-of-window-commands nil t ""))]) #@67 Load a window arrangement, COMMANDS, and a buffer list, BUFFERS. (defalias 'windwow-load-window-arrangement-and-buffer-list #[(commands buffers) "\302!\210\303 !\207" [commands buffers windwow-load-window-configuration-commands windwow-load-buffer-list-buffers] 2 (#$ . 15934) (let* ((split-commands-name (completing-read "Choose window arrangement: " windwow-list-of-window-commands nil t #1="")) (list-name (completing-read "Choose buffer-list: " windwow-list-of-buffer-lists nil t #1#))) (list (assoc split-commands-name windwow-list-of-window-commands) (assoc list-name windwow-list-of-buffer-lists)))]) (provide 'windwow)