;ELC ;;; Compiled ;;; in Emacs version 28.0.50 ;;; with all optimizations. (byte-code "\300\301\302\303\304\305%\210\306\307\310\311\312\313\314\315\304\301& \210\306\316\302\317\312\320\304\301&\210\306\321\302\322\312\323\304\301&\210\306\324\302\325\312\326\304\301&\210\306\327\302\330\312\331\304\301&\210\306\332\333\334\312\335\304\301&\210\306\336\302\337\340\341\342\343\312\335\344\301& \207" [custom-declare-group zoom nil "Enforce a fixed and automatic balanced window layout." :group windows custom-declare-variable zoom-size '(80 . 24) "Size hint for the selected window.\n\nIt can be either a cons or a function.\n\nEach component of the cons can be either an absolute value in\nlines/columns or a ratio between the selected window and the\nframe size. In the former case the window is resized according\nto its body size, i.e., the total window size can be much larger.\nIn any case, windows are never shrinked if they are already\nlarger than the resulting size.\n\nThe function takes no arguments and returns a cons as specified\nabove." :type (choice (function :tag "Custom") (cons :tag "Fixed" (choice (integer :tag "Columns") (float :tag "Width ratio")) (choice (integer :tag "Lines") (float :tag "Height ratio")))) :safe consp zoom-ignored-major-modes "List of ignored major modes.\n\nSelected windows using any of these major modes should not be\nenlarged (only balanced)." (repeat symbol) zoom-ignored-buffer-names "List of ignored buffer names.\n\nSelected windows displaying any of these buffers should not be\nenlarged (only balanced)." (repeat string) zoom-ignored-buffer-name-regexps "List of ignored buffer name regexps.\n\nSelected windows displaying buffers matching any of these regexps\nshould not be enlarged (only balanced)." (repeat regexp) zoom-ignore-predicates "List of additional predicates that allow to ignore windows.\n\nThese functions are called (in order) to decide whether the\nselected window should be ignored (only balanced) or not.\nPredicates take no parameters and as soon as one function returns\na non-nil value, the selected window is ignored and the others\nare not called." (repeat function) zoom-minibuffer-preserve-layout t "Non-nil means that the layout is retained when the minubuffer is entered.\n\nOtherwise, since the minibuffer cannot be zoomed, all the other\nwindows are simply balanced. Setting this variable to nil can be\nuseful when third-party modes use the minibuffer to display more\nthan few lines." boolean zoom-mode "Non-nil if Zoom mode is enabled.\nSee the `zoom-mode' command\nfor a description of this minor mode.\nSetting this variable directly does not take effect;\neither customize it (see the info node `Easy Customization')\nor call the function `zoom-mode'." :set custom-set-minor-mode :initialize custom-initialize-default :require] 12) #@601 Perform `zoom' automatically as the selected window changes. This is a minor mode. If called interactively, toggle the `Zoom mode' mode. If the prefix argument is positive, enable the mode, and if it is zero or negative, disable the mode. If called from Lisp, toggle the mode if ARG is `toggle'. Enable the mode if ARG is nil, omitted, or is a positive number. Disable the mode if ARG is a negative number. To check whether the minor mode is enabled in the current buffer, evaluate `(default-value 'zoom-mode)'. The mode's hook is called both when the mode is enabled and when it is disabled. (defalias 'zoom-mode #[(&optional arg) "\305 \306\303 \307=\203\310\303!?\202\" \247\203! \311W\203!\312\202\"\313\"\210\314\302!\2039\315\303\n\"\310\303!\2039\303\nB \203C\316 \210\202F\317 \210\320\321\310\303!\203R\322\202S\323\"\210\324\325!\203~\326\303!\210\305 \203k\305 \232\203~\327\330\331\310\303!\203y\332\202z\333\f#\210))\334 \210\310\303!\207" [#1=#:last-message arg global-minor-modes zoom-mode local current-message set-default toggle default-value 1 nil t boundp delq zoom--on zoom--off run-hooks zoom-mode-hook zoom-mode-on-hook zoom-mode-off-hook called-interactively-p any customize-mark-as-set "" message "Zoom mode %sabled%s" "en" "dis" force-mode-line-update] 4 (#$ . 2848) (list (if current-prefix-arg (prefix-numeric-value current-prefix-arg) 'toggle))]) (defvar zoom-mode-hook nil) (byte-code "\301\302N\204\f\303\301\302\304#\210\303\301\305\306#\210\303\301\307\310C#\210\311\312\313\314\300!\205#\310\211%\207" [zoom-mode-map zoom-mode-hook variable-documentation put "Hook run after entering or leaving `zoom-mode'.\nNo problems result if this variable is not bound.\n`add-hook' automatically binds it. (This is true for all hook variables.)" custom-type hook standard-value nil add-minor-mode zoom-mode " Z" boundp] 6) #@74 Zoom the current window and balance the others according to `zoom-size'. (defalias 'zoom #[nil "\203\301\302!\207\303 \207" [zoom-mode message "Window zooming is automatic (M-x zoom-mode to disable)" zoom--update] 2 (#$ . 4732) nil]) #@49 Enable hooks and advices and update the layout. (defalias 'zoom--on #[nil "\304\305\306\307B\310\311$\210\312\313\314\315#\210\312\316\314\315#\210\312\317\314\315#\210\320 \311\211\205? @\321 p\322\216\323\324\"\210\310 \210+ A\211\204$\311*\207" [frame --dolist-tail-- #1=#:old-buffer #2=#:old-frame advice--add-function :after #[nil "\300\301!\207" [default-value pre-redisplay-function] 2] #[(gv--val) "\301\302\"\207" [gv--val set-default pre-redisplay-function] 3] zoom--handler nil advice-add mouse-drag-mode-line :override ignore mouse-drag-vertical-line mouse-drag-header-line frame-list selected-frame #[nil "\302!\203 \303\304\"\210\305 !\205 q\207" [#2# #1# frame-live-p select-frame norecord buffer-live-p] 3] select-frame norecord] 6 (#$ . 4975)]) #@59 Disable hooks and advices and evenly balance the windows. (defalias 'zoom--off #[nil "\303\304\305!\306\"\211\304\305!=\204\307\305\"\210)\310\311\312\"\210\310\313\312\"\210\310\314\312\"\210\315 \316\211\205<\n@\317 !\210\nA\211\204-\316*\207" [#1=#:new frame --dolist-tail-- advice--remove-function default-value pre-redisplay-function zoom--handler set-default advice-remove mouse-drag-mode-line ignore mouse-drag-vertical-line mouse-drag-header-line frame-list nil balance-windows] 4 (#$ . 5758)]) #@46 Keep track of the currently selected window. (defvar zoom--last-window nil (#$ . 6277)) #@101 Get a snapshot of the current frame. The return value is used to determine if an update is needed. (defalias 'zoom--get-frame-snapshot #[nil "\301\302\303\304\305 \"D\"\207" [track-mouse format "%s" mapcar #[(window) "\301 \302 E\207" [window window-total-width window-total-height] 3] window-list] 6 (#$ . 6372)]) #@55 Handle an update event. Argument IGNORED is ignored. (defalias 'zoom--handler #[(&optional ignored) "\305 \306\307\310\"\232?\205?\311\307\310#\210\312\313 \232\204(\n\203$\314 \204( \203, \202.\313 !r\315\216\316\f@\317\"\210\313 \320 +)\207" [snapshot zoom--last-window zoom-minibuffer-preserve-layout track-mouse save-selected-window--state zoom--get-frame-snapshot frame-parameter nil zoom--frame-snapshot set-frame-parameter internal--before-with-selected-window selected-window window-minibuffer-p #[nil "\301!\207" [save-selected-window--state internal--after-with-selected-window] 2] select-window norecord zoom--update] 4 (#$ . 6696)]) #@48 Update the window layout in the current frame. (defalias 'zoom--update #[nil "\304\211\305\211\306 \210\307 ?\205\310 \210\311\312!?\205\313 ,\207" [window-resize-pixelwise window-combination-resize window-configuration-change-hook zoom-mode nil t balance-windows zoom--window-ignored-p zoom--resize derived-mode-p image-mode zoom--fix-scroll] 4 (#$ . 7361)]) #@59 Check whether the selected window will be ignored or not. (defalias 'zoom--window-ignored-p #[nil "\306\307 !\206h\310 \206h \235\206h\311 \n\235\206h\3122? \313\211\205= @\314\f\311 \"\2035\315\312\316\"\210 A\211\204%\313*0\206h\3122h\313\211\205f @\211 \203^\315\312\316\"\210 A\211\204P\313*0\207" [major-mode zoom-ignored-major-modes zoom-ignored-buffer-names zoom-ignored-buffer-name-regexps regex --dolist-tail-- frame-root-window-p selected-window window-minibuffer-p buffer-name ignored nil string-match throw t zoom-ignore-predicates predicate] 4 (#$ . 7735)]) #@62 Resize the selected window according to the user preference. (defalias 'zoom--resize #[nil "\302!\203  \202\f\303 \304\"\210\303 \305\")\207" [zoom-size size-hint-cons functionp zoom--resize-one-dimension t nil] 3 (#$ . 8338)]) #@240 Resize one dimension of the selected window according to the user preference. Argument SIZE-HINT-CONS is the size hint provided by the user. Argument HORIZONTAL determines whether the window should be resized horizontally or vertically. (defalias 'zoom--resize-one-dimension #[(size-hint-cons horizontal) "\203 @\202 A\203\306 \202\307 \310\n!\203,\203'\311 \2027\312 \2027\2035\313 \2027\314 \310\n!\203F\315\n _!\202G\n\211\fZ\316]\317\320#\321\320#.\207" [horizontal size-hint-cons size-hint frame-size window-size min-window-size frame-width frame-height floatp window-total-width window-total-height window-body-width window-body-height round 0 window-resizable nil window-resize desired-delta delta] 5 (#$ . 8579)]) #@41 Fix the horizontal scrolling if needed. (defalias 'zoom--fix-scroll #[nil "\302\303 !\210\205i\304 ZV\205\305i\304 \306\245Z!\207" [truncate-lines hscroll-margin scroll-right window-hscroll window-body-width scroll-left 2] 4 (#$ . 9344)]) (provide 'zoom)