;ELC ;;; Compiled ;;; in Emacs version 28.0.50 ;;; with all optimizations. (byte-code "\300\301!\210\300\302!\210\303\304\305\306\307\310%\210\311\312\313\314\315\316\307\304&\210\311\317\320\321\315\322\307\304&\210\311\323\324\325\315\322\307\304&\210\311\326\327\330\315\322\307\304&\210\311\331\305\332\315\333\307\304&\207" [require cl quail custom-declare-group swap-buffers nil "swap-buffers customization group" :group convenience custom-declare-variable swap-buffers-qwerty-shortcuts '("a" "s" "d" "f" "j" "k" ";" "w" "e" "i" "o") "todo" :type list swap-buffers-increase 12 "How much to increase text size in the window numbering, maximum." integer swap-buffers-timeout 5 "After this many seconds, cancel the swapping window." swap-buffers-threshold 2 "Only active after this many windows open." swap-buffers-keep-focus "Whether to keep focus on the first window." boolean] 8) #@63 Return a list of one-letter strings to label current windows. (defalias 'swap-buffers-enumerate #[nil "\306 \307\310!!\311 \311\211 \n=?\n\204\2038\f:\2038\f@\211 B \312 \"\fA\202 \237.\207" [w #1=#:--cl-minip-- #2=#:--cl-var-- swap-buffers-qwerty-shortcuts #3=#:--cl-var-- x selected-window minibufferp window-buffer nil next-window #4=#:--cl-var--] 4 (#$ . 903)]) #@78 Return the label to use for a given window number. NUM is label num in list. (defalias 'swap-buffers-label #[(num) "S\301 8\207" [num swap-buffers-enumerate] 2 (#$ . 1299)]) #@55 List windows for current frame, starting at top left. (defalias 'swap-buffers-list #[nil "\300\301\302\303 #\207" [window-list nil "" frame-first-window] 4 (#$ . 1480)]) #@72 Return the window opposite to selected one. Works only with 2 windows. (defalias 'swap-buffers-other-window #[nil "\302\303 \304\305\306\307 #\"\304 G\211\310U\203\303 \202) \311U\203%@\202)\312\313\314\"*\207" [other-window windows-count remq selected-window window-list nil "" frame-first-window 1 2 error "%s" "Function works only with 2 windows."] 7 (#$ . 1656)]) #@78 Create an overlay to diplay in the WIN window with label NUM while choosing. (defalias 'swap-buffers-display-number #[(win num) "\306!\307\n!\310\n!\311\f\211 #\312 \313\314 \315\316\317\320\321F##\210\312 \322\n#\210 ,\207" [num label win buffer wp ol swap-buffers-label window-buffer window-point make-overlay overlay-put before-string propertize face :height 4.0 :foreground "red" window] 10 (#$ . 2038)]) #@152 Return a list of all the windows where `eobp' is currently true so that we can restore that important property (think auto scrolling) after switching. (defalias 'swap-buffers-list-eobp #[nil "\303 \304\211:\203%@r\305 !q\210m)\203 \nBA\211\202\n\237+\207" [#1=#:--cl-var-- win #2=#:--cl-var-- swap-buffers-list nil window-buffer] 3 (#$ . 2459)]) #@70 For each window in EOBP-WINDOW-LIST move the point to end of buffer. (defalias 'swap-buffers-restore-eobp #[(eobp-window-list) "\303 :\203 @r\304\n!q\210\305 \210) A\211\202*\303\207" [eobp-window-list #1=#:--cl-var-- win nil window-buffer end-of-buffer] 3 (#$ . 2825)]) #@96 Display an overlay in each window showing a unique key, then ask user for the window to select (defalias 'swap-buffers-prompt-for-selected-window #[(prompt-message) "\306 \307\310\311 \310\211\211\211 !\312\216\313\300\310\"\210\314 \310\"\211#\203t#@\211\"\315\"!B\nB\316\"!\203O\"\316\"!B B\317\"\310\"\210\320\"!\203] \202f\321\" \" B T #A\211#\204**\f\204\324\322\323\203\212\324\325\326!\"\202\214$\310%#!\211&\203\236&\327=\203\250\330 !\210\331 \210\202\320&9\204\320\332\333\334 \"'\335&'\"\211(\203\310(T\202\317\330 !\210\331 \210*)\202u)\f. \207" [cursor-type dedicated-windows window-points overlays key eobps current-window-configuration 1 nil swap-buffers-list-eobp #[nil "\306\307\"\210\310\311 \"\210\312\n!\210 \313\211\203' @\314\f@\fA\"\210 A\211\204*\313\211\205C @\315\f@\fA\"\210 A\211\2041\313*\207" [original-cursor overlays config window-points w --dolist-tail-- set-default cursor-type mapc delete-overlay set-window-configuration nil set-window-point set-window-dedicated-p dedicated-windows] 4] set-default swap-buffers-list window-point window-dedicated-p set-window-dedicated-p minibuffer-window-active-p swap-buffers-display-number event-basic-type read-event format "Move to window [minibuffer is %s]: " swap-buffers-label return swap-buffers-restore-eobp keyboard-quit mapcar string-to-char swap-buffers-enumerate position original-cursor minibuffer-num num config win --dolist-tail-- prompt-message swap-buffers-timeout input wchars pos] 10 (#$ . 3111)]) #@76 Swap buffers between win1 and win2. WIN1 and WIN2 windows to spaw buffers. (defalias 'swap-buffers-swap #[(win1 win2) "\306!\306\n!\307!\307\n!\310 \"\210\310\n \"\210\311 \"\210\311\n\f\",\207" [win1 buf1 win2 buf2 start1 start2 window-buffer window-start set-window-buffer set-window-start] 3 (#$ . 4686)]) #@44 Return the name of buffer from window WIN. (defalias 'swap-buffers-window-name #[(win) "\300\301\302\303 !!!\207" [substring-no-properties buffer-name window-buffer selected-window] 4 (#$ . 5009)]) #@103 Print message about buffers swap. MESSAGE-FORMAT format string. FROM-WIN and TO-WIN -- source windows (defalias 'swap-buffers-log-message #[(message-format from-win to-win) "\303 \n#\207" [message-format from-win to-win message] 4 (#$ . 5214)]) #@2  (defalias 'swap-buffers-above-threshold\? #[nil "\302 G\211 V)\207" [window-count swap-buffers-threshold window-list] 3 (#$ . 5465)]) #@2  (defalias 'swap-buffers-destination-window #[nil "\301 \203\302\303!\211S\304 8)\207\305 \207" [index swap-buffers-above-threshold\? swap-buffers-prompt-for-selected-window "Move to window: " swap-buffers-list swap-buffers-other-window] 3 (#$ . 5606)]) #@148 Swap buffer from selected window with specified buffer. If NEGATIVE-KEEP-FOCUS-OPTION is t -- use the opposite setting of swap-buffers-keep-focus. (defalias 'swap-buffers #[(&optional negative-keep-focus-option) "\306 G\307 \310 \311 \f\203 ?\202 X\203)\312 \313 \"\210\202.\312 \"\210\2047\314 !\210\315\316 #\210\317\n!-\207" [window-count from-win eobps to-win negative-keep-focus-option swap-buffers-keep-focus window-list selected-window swap-buffers-list-eobp swap-buffers-destination-window swap-buffers-swap swap-buffers-other-window select-window swap-buffers-log-message "Swap %S with %S" swap-buffers-restore-eobp keep-focus swap-buffers-threshold] 4 (#$ . 5870) "P"]) (defalias 'swap-buffers-dired-open-in-window #[(win) "\301\302\303 !\"\207" [win set-window-buffer find-file-noselect dired-get-file-for-visit] 4]) (defalias 'swap-buffers-dired-find-file #[nil "\301 \302\303!\210\302\304\"\210\305!)\207" [win swap-buffers-destination-window message "hello" "w: %S" swap-buffers-dired-open-in-window] 3 nil nil]) (provide 'swap-buffers)