;ELC ;;; Compiled ;;; in Emacs version 26.3 ;;; with all optimizations. ;;; This file uses dynamic docstrings, first added in Emacs 19.29. ;;; This file does not contain utf-8 non-ASCII characters, ;;; and so can be loaded in Emacs versions earlier than 23. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (byte-code "\300\301\302\303\304\305%\210\306\307\310\311\312DD\313\304\301\314\311&\210\306\315\310\311\316DD\317\304\301\314\320&\210\306\321\310\311\322DD\323\304\301\314\324&\210\306\325\310\311\326DD\327\304\301\314\324&\210\306\330\310\311\331DD\332\304\301\314\324&\207" [custom-declare-group wconf nil "Easily use several window configurations." :group convenience custom-declare-variable wconf-change-config-function funcall function #[0 "\300\207" [wconf-change-config-default] 1] "Function called with current config whenever it is set." :type wconf-file #[0 "\301\302\"\207" [user-emacs-directory expand-file-name "wconf-window-configs.el"] 3] "File used to save and load window configurations." file wconf-fallback-buffer-name #[0 "\300\207" [#1="*scratch*"] 1 #1#] "Name of the buffer to substitute for buffers which are not available." string wconf-no-configs-string #[0 "\300\207" [#2="-----"] 1 #2#] "String to use if there are no configurations at all." wconf-no-config-name #[0 "\300\207" [#3="---"] 1 #3#] "String to use for the empty window configuration."] 8) #@64 List of configurations; each item a list (active stored name). (defvar wconf--configs nil (#$ . 1496)) #@117 Index of currently shown configuration. After clean and load this can be nil although wconf--configs is not empty. (defvar wconf--index nil (#$ . 1606)) #@63 String representing information on the current configuration. (defvar wconf-string nil (#$ . 1766)) (require 'cl-lib) #@26 (fn &optional CURRENT) (defalias 'wconf--ensure-configs #[256 "\204\302\303!\210\211\205 ?\205\302\304!\207" [wconf--configs wconf--index error "wconf: No window configurations" "wconf: No window configuration is currently used"] 3 (#$ . 1890)]) (put 'wconf--ensure-configs 'byte-optimizer 'byte-compile-inline-expand) #@24 (fn &optional INDEX) (defalias 'wconf--ensure-index #[256 "\301\302GS#?\205\303\304\"\207" [wconf--configs <= 0 error "wconf: No window configuration index %s"] 5 (#$ . 2224)]) (put 'wconf--ensure-index 'byte-optimizer 'byte-compile-inline-expand) (defalias 'wconf--not-from-minibuffer #[0 "\300\301 !\205\n\302\303!\207" [minibuffer-window-active-p frame-selected-window error "wconf: Cannot change window configs when minibuffer is active"] 2]) (put 'wconf--not-from-minibuffer 'byte-optimizer 'byte-compile-inline-expand) (defalias 'wconf--current-config #[0 "\300\301\302 !\303\"\207" [window-state-get frame-root-window selected-frame writable] 3]) #@14 (fn INDEX) (defalias 'wconf- #[257 "\2118\207" [wconf--configs] 3 (#$ . 2892)]) #@14 (fn INDEX) (defalias 'wconf--to-string #[257 "\211\203\301\302\303!\304!AA@#\207\305P\207" [wconf-no-config-name format "%s:%s" number-to-string wconf- "-:"] 6 (#$ . 2981)]) (defalias 'wconf--update-info #[0 "\302!\205 \211\205\303 !@\"\207" [wconf-change-config-function wconf--index functionp wconf-] 4]) (defalias 'wconf--update-active-config #[0 "\205 \301!\211\302 \240\262\207" [wconf--index wconf- wconf--current-config] 3]) #@14 (fn INDEX) (defalias 'wconf--use-config #[257 "\211\301\302!@\303\304 !\305#\210\306 \207" [wconf--index window-state-put wconf- frame-root-window selected-frame safe wconf--update-info] 5 (#$ . 3436)]) #@28 Remove all configurations. (defalias 'wconf--reset #[0 "\302\211\303 \207" [wconf--configs wconf--index nil wconf--update-info] 2 (#$ . 3649)]) #@55 Return a deep copy of WC, using `copy-tree'. (fn WC) (defalias 'wconf--copy #[257 "\300\301\"\207" [copy-tree t] 4 (#$ . 3801)]) #@95 Update `wconf-string' to represent configuration CONFIG at position INDEX. (fn INDEX CONFIG) (defalias 'wconf-change-config-default #[514 "\203\n\303!\202 \304 \207" [wconf--configs wconf-no-configs-string wconf-string wconf--to-string force-mode-line-update] 4 (#$ . 3938)]) #@92 Save stored configurations in FILENAME, defaults to `wconf-file'. (fn &optional FILENAME) (defalias 'wconf-save #[256 "\211\206\211\302\303\304!!\305\306\307\310\311!\312\"\313$\216r\211q\210\314\315\316 \"p\"\210)r\211q\210\317\320\211\320\306%\210*\266\321\322\"\207" [wconf-file wconf--configs get-buffer-create generate-new-buffer-name " *temp file*" make-byte-code 0 "\301\300!\205 \302\300!\207" vconcat vector [buffer-name kill-buffer] 2 prin1 mapcar cdr write-region nil message "wconf: Save stored configurations in %s"] 10 (#$ . 4227) "F"]) #@10 (fn B) (defalias 'wconf--sanitize-buffer #[257 "\301A@!?\205+\211\211A\240\266\302\303\"\211\304\241\266\302\305\"\211\304\241\266\302\306\"\211\307\241\262\207" [wconf-fallback-buffer-name get-buffer assoc start 1 point dedicated nil] 4 (#$ . 4793)]) #@13 (fn NODE) (defalias 'wconf--sanitize-window-tree #[257 "\300\301\"\211\203\302!\202\303\304\"\207" [assoc buffer wconf--sanitize-buffer mapc #[257 "\211:\205\211@\300>\205\301A!\207" [(leaf vc hc) wconf--sanitize-window-tree] 3 "\n\n(fn X)"]] 5 (#$ . 5063)]) #@94 Load stored configurations from FILENAME, defaults to `wconf-file'. (fn &optional FILENAME) (defalias 'wconf-load #[256 "\211\206\302!\204\303\304\"\210\305 \210\306\307!r\211q\210\310\311\312\313\314!\315\"\316$\216\317!\210eb\210\320\321\322p!\"*\210\323\324\"\266\325 \207" [wconf-file wconf--configs file-readable-p error "wconf: Cannot read file %s" wconf--reset generate-new-buffer " *temp*" make-byte-code 0 "\301\300!\205 \302\300!\207" vconcat vector [buffer-name kill-buffer] 2 insert-file-contents mapcar #[257 "\300@!\210\301@!B\207" [wconf--sanitize-window-tree wconf--copy] 3 "\n\n(fn F)"] read message "wconf: Load stored configurations from %s" wconf--update-info] 9 (#$ . 5342) "f"]) #@282 Clone the current configuration or create a new "empty" one. The new configuration is appended to the list and becomes active. With optional prefix argument NEW, or if there are no configurations yet, create a new configuration from the current window config. (fn &optional NEW) (defalias 'wconf-create #[256 "\302\303 !\203 \304\305!\210\306 \210\307\204\204'\310\311G\"\210\312 \312 \313E\202X\314\2040\304\315!\210\211\205< ?\205<\304\316!\266\317 !\310\320\321 !\"\210\322@!\322A@!AA@E\262C\"\323GS!\207" [wconf--configs wconf--index minibuffer-window-active-p frame-selected-window error "wconf: Cannot change window configs when minibuffer is active" wconf--update-active-config append message "wconf: Created new configuration %s" wconf--current-config "new" current "wconf: No window configurations" "wconf: No window configuration is currently used" wconf- "wconf: Cloned configuration %s" wconf--to-string wconf--copy wconf--use-config] 8 (#$ . 6067) "P"]) #@29 Kill current configuration. (defalias 'wconf-kill #[0 "\302\204 \303\304!\210\211\205 ?\205\303\305!\266\306\307 !\203\"\303\310!\210\311 !\312\313\211G Z\"\314\315G \316#\"\"\211\203P\317GS W\203J S\202K !\210\202V\320 \210\321 \210\322\323\"\207" [wconf--configs wconf--index current error "wconf: No window configurations" "wconf: No window configuration is currently used" minibuffer-window-active-p frame-selected-window "wconf: Cannot change window configs when minibuffer is active" wconf--to-string append butlast last - 1 wconf--use-config wconf--reset wconf--update-info message "wconf: Killed configuration %s"] 10 (#$ . 7062) nil]) #@53 Swap configurations at positions I and J. (fn I J) (defalias 'wconf-swap #[514 "\302\204 \303\304!\210\211\205 ?\205\303\305!\266\306\307GS#?\205'\303\310\"\266\211\306\307GS#?\2059\303\310\"\266\311 \210\312!\233\211\312!\240\266\233\211\240\266 D>\203_\313 !\210\314\315\316!\316!#\207" [wconf--configs wconf--index nil error "wconf: No window configurations" "wconf: No window configuration is currently used" <= 0 "wconf: No window configuration index %s" wconf--update-active-config wconf- wconf--use-config message "wconf: Swapped configurations %s and %s" number-to-string] 7 (#$ . 7730) (byte-code "\302\204 \303\304!\210\211\205 ?\205\303\305!\266\306\307 !\203\"\303\310!\210 \311\312!D\207" [wconf--configs wconf--index current error "wconf: No window configurations" "wconf: No window configuration is currently used" minibuffer-window-active-p frame-selected-window "wconf: Cannot change window configs when minibuffer is active" read-number "Swap current config with index: "] 3)]) #@50 Rename current configuration to NAME. (fn NAME) (defalias 'wconf-rename #[257 "\302\204 \303\304!\210\211\205 ?\205\303\305!\266\306 !AA\211\240\266\307\310\"\210\311 \207" [wconf--configs wconf--index current error "wconf: No window configurations" "wconf: No window configuration is currently used" wconf- message "wconf: Renamed configuration to \"%s\"" wconf--update-info] 4 (#$ . 8773) (byte-code "\302\204 \303\304!\210\211\205 ?\205\303\305!\266\306\307\310 !AA@\"C\207" [wconf--configs wconf--index current error "wconf: No window configurations" "wconf: No window configuration is currently used" read-string "New window configuration name: " wconf-] 4)]) #@11 (fn WC) (defalias 'wconf--store #[257 "\211\211A\300@!\240\207" [wconf--copy] 5 (#$ . 9462)]) (put 'wconf--store 'byte-optimizer 'byte-compile-inline-expand) #@11 (fn WC) (defalias 'wconf--restore #[257 "\211\211\300A@!\240\207" [wconf--copy] 5 (#$ . 9629)]) (put 'wconf--restore 'byte-optimizer 'byte-compile-inline-expand) #@39 Store currently active configuration. (defalias 'wconf-store #[0 "\302\204 \303\304!\210\211\205 ?\205\303\305!\266\306 \210\307 !\211\211A\310@!\240\266\311\312\313 !\"\207" [wconf--configs wconf--index current error "wconf: No window configurations" "wconf: No window configuration is currently used" wconf--update-active-config wconf- wconf--copy message "wconf: Stored configuration %s" wconf--to-string] 5 (#$ . 9800) nil]) #@34 Store all active configurations. (defalias 'wconf-store-all #[0 "\302\204 \303\304!\210\211\205 ?\205\303\305!\266\306 \210\307\310\"\210\311\312!\207" [wconf--configs wconf--index current error "wconf: No window configurations" "wconf: No window configuration is currently used" wconf--update-active-config mapc wconf--store message "wconf: Stored all configurations"] 3 (#$ . 10244) nil]) #@31 Restore stored configuration. (defalias 'wconf-restore #[0 "\302\204 \303\304!\210\211\205 ?\205\303\305!\266\306\307 !\203\"\303\310!\210\311 !\211\211\312A@!\240\266\313 !\210\314\315\316 !\"\207" [wconf--configs wconf--index current error "wconf: No window configurations" "wconf: No window configuration is currently used" minibuffer-window-active-p frame-selected-window "wconf: Cannot change window configs when minibuffer is active" wconf- wconf--copy wconf--use-config message "wconf: Restored configuration %s" wconf--to-string] 5 (#$ . 10649) nil]) #@36 Restore all stored configurations. (defalias 'wconf-restore-all #[0 "\302\204 \303\304!\210\211\205 ?\205\303\305!\266\306\307\"\210\310 !\210\311\312!\207" [wconf--configs wconf--index current error "wconf: No window configurations" "wconf: No window configuration is currently used" mapc wconf--restore wconf--use-config message "wconf: Restored all configurations"] 3 (#$ . 11224) nil]) #@61 Change to current config INDEX. (fn INDEX &optional FORCE) (defalias 'wconf-switch-to-config #[513 "\302\204 \303\304!\210\211\205 ?\205\303\305!\266\306\307 !\203\"\303\310!\210\206)\311\312!\211\313\314GS#?\2059\303\315\"\266\316 \210 =\203N\204N\317\320!\202X\321!\210\317\322\323!\"\207" [wconf--configs wconf--index nil error "wconf: No window configurations" "wconf: No window configuration is currently used" minibuffer-window-active-p frame-selected-window "wconf: Cannot change window configs when minibuffer is active" read-number "Switch to config number: " <= 0 "wconf: No window configuration index %s" wconf--update-active-config message "wconf: Nothing to do" wconf--use-config "wconf: Switched to configuration %s" wconf--to-string] 8 (#$ . 11628) "P"]) #@42 Switch to previous window configuration. (defalias 'wconf-use-previous #[0 "\302\204 \303\304!\210\211\205 ?\205\303\305!\266\306\307 \206\310SG\"!\207" [wconf--configs wconf--index nil error "wconf: No window configurations" "wconf: No window configuration is currently used" wconf-switch-to-config mod 1] 4 (#$ . 12427) nil]) #@38 Switch to next window configuration. (defalias 'wconf-use-next #[0 "\302\204 \303\304!\210\211\205 ?\205\303\305!\266\306\307 \206\310TG\"!\207" [wconf--configs wconf--index nil error "wconf: No window configurations" "wconf: No window configuration is currently used" wconf-switch-to-config mod -1] 4 (#$ . 12771) nil]) (provide 'wconf)